PRS_binary {GxEprs} | R Documentation |
PRS_binary function This function uses plink2 and outputs Polygenic Risk Scores (PRSs) of all the individuals, using pre-generated GWAS and/or GWEIS summary statistics. Note that the input used in this function can be generated by using GWAS_binary and/or GWEIS_binary functions. Users may save the output in a user-specified file (see examples).
Description
PRS_binary function This function uses plink2 and outputs Polygenic Risk Scores (PRSs) of all the individuals, using pre-generated GWAS and/or GWEIS summary statistics. Note that the input used in this function can be generated by using GWAS_binary and/or GWEIS_binary functions. Users may save the output in a user-specified file (see examples).
Usage
PRS_binary(plink_path, b_file, summary_input)
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 |
summary_input |
Pre-generated GWAS and/or GWEIS summary statistics |
Value
This function will output
prs.sscore |
PRSs for each individual |
Examples
## Not run:
a <- GWAS_binary(plink_path, DummyData, Bphe_discovery, Bcov_discovery)
trd <- a[c("ID", "A1", "BETA")]
b <- GWEIS_binary(plink_path, DummyData, Bphe_discovery, Bcov_discovery)
add <- b[c("ID", "A1", "ADD_BETA")]
gxe <- b[c("ID", "A1", "INTERACTION_BETA")]
x <- PRS_binary(plink_path, DummyData, summary_input = trd)
sink("B_trd.sscore") #to create a file in the working directory
write.table(x, sep = " ", row.names = FALSE, quote = FALSE) #to write the output
sink() #to save the output
head(x) #to read the head of all columns in the output
x$FID #to extract the family ID's of full dataset
x$IID #to extract the individual ID's of full dataset
x$PRS #to extract the polygenic risk scores of full dataset
y <- PRS_binary(plink_path, DummyData, summary_input = add)
sink("B_add.sscore") #to create a file in the working directory
write.table(y, sep = " ", row.names = FALSE, quote = FALSE) #to write the output
sink() #to save the output
z <- PRS_binary(plink_path, DummyData, summary_input = gxe)
sink("B_gxe.sscore") #to create a file in the working directory
write.table(z, sep = " ", row.names = FALSE, quote = FALSE) #to write the output
sink() #to save the output
## End(Not run)
[Package GxEprs version 1.2 Index]