View source: R/iPRSue_estimates_BT.R
iPRSue_estimates_BT | R Documentation |
Computes individual-level polygenic risk scores (PRS) with uncertainty estimates using a simulation-based approach for binary traits. This implementation follows the iPRSue framework, simulating multiple PRSs by sampling from the GWAS effect size distribution and deriving individual-level confidence intervals.
iPRSue_estimates_BT(
gwas,
target_pheno,
target_geno_mat,
no_of_PRSs = 500,
significance_level = 0.05,
seed = NULL
)
gwas |
A data frame with GWAS summary statistics for binary traits. Must contain |
target_pheno |
Character. Path to the target phenotype file. Assumes no header and individual IDs in the second column. |
target_geno_mat |
Character. Path to the genotype matrix of target individuals. No header is expected; columns correspond to SNPs. |
no_of_PRSs |
Integer. Number of simulations used to construct PRS uncertainty intervals. Default is 500. |
significance_level |
Numeric. Significance level for confidence intervals (e.g., 0.05 gives 95% CI). Default is 0.05. |
seed |
Integer or NULL. Random seed for reproducibility. If NULL, results may vary across runs. Default is NULL. |
For each SNP, the function simulates no_of_PRSs
effect sizes from a normal distribution defined by its GWAS beta and SE.
These sampled betas are multiplied by the genotype matrix to generate PRS replicates for each individual.
Confidence intervals are then calculated using the specified significance level.
This function is designed for binary traits and should be used with GWAS summary statistics obtained from logistic regression.
A data frame containing the following columns:
Individual identifier (from target phenotype file).
Mean of simulated PRSs for each individual.
Variance across simulated PRSs.
Lower bound of the confidence interval.
Upper bound of the confidence interval.
## Not run:
# Step 1: Run GWAS on binary trait
results <- GWAS_BT(
plink_path = "./plink2",
b_file = "./binary_file_prefix",
discovery_pheno = "./discovery_phenotype_file",
discovery_cov = "./discovery_covariate_file",
thread = 48
)
# Step 2: Estimate individual PRS with uncertainty
bpt <- system.file("Bpt.txt", package = "iPRSue", mustWork = TRUE)
gt <- system.file("Gt.txt", package = "iPRSue", mustWork = TRUE)
prs_estimates <- iPRSue_estimates_BT(
gwas = results,
target_pheno = bpt,
target_geno_mat = gt,
no_of_PRSs = 500,
significance_level = 0.05,
seed = 123
)
head(prs_estimates)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.