GWAS_binary {GxEprs} | R Documentation |
GWAS_binary function This function performs GWAS using plink2 and outputs the GWAS summary statistics with additive SNP effects. Users may save the output in a user-specified file (see example).
Description
GWAS_binary function This function performs GWAS using plink2 and outputs the GWAS summary statistics with additive SNP effects. Users may save the output in a user-specified file (see example).
Usage
GWAS_binary(plink_path, b_file, Bphe_discovery, Bcov_discovery, thread = 20)
Arguments
plink_path |
Path to the PLINK executable application |
b_file |
Prefix of the binary files, where all .fam, .bed and .bim files have a common prefix |
Bphe_discovery |
Name (with file extension) of the phenotype file containing family ID, individual ID and phenotype of the discovery dataset as columns, without heading |
Bcov_discovery |
Name (with file extension) of the covariate file containing family ID, individual ID, standardized covariate, square of standardized covariate, and/or confounders of the discovery dataset as columns, without heading |
thread |
Number of threads used |
Value
This function will perform GWAS and output
B_out.trd.sum |
GWAS summary statistics with additive SNP effects |
Examples
## Not run:
x <- GWAS_binary(plink_path, DummyData, Bphe_discovery, Bcov_discovery,
thread = 20)
sink("B_out.trd.sum") #to create a file in the working directory
write.table(x[c("ID", "A1", "BETA")], sep = " ",
row.names = FALSE, quote = FALSE) #to write the output
sink() #to save the output
head(x) #to obtain the head of GWAS summary statistics of additive SNP effects
x$CHROM #to extract the chromosome number
x$POS #to extract the base pair position
x$ID #to extract the SNP ID
x$REF #to extract the reference allele
x$ALT #to extract the alternate allele
x$A1 #to extract the minor allele
x$OBS_CT #to extract the number of allele observations
x$BETA #to extract the SNP effects
x$SE #to extract the standard errors of the SNP effects
x$Z_STAT #to extract the test statistics
x$P #to extract the p values
## End(Not run)