Skip to content

lucivargas/PRSmetrics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PRSmetrics

PRSmetrics is an R package to calculate common metrics often used to evaluate Polygenic Score (PGS) performance.

calc_or():

  • Calculate odds Ratios (OR) across PGS quantiles for binary outcomes (e.g., compare risk of disease in the top 10% vs. bottom 10%)

You can install the development version of this package from GitHub:

# install.packages("devtools")
devtools::install_github("lucivargas/PRSmetrics")

Dependencies:

- dplyr
- ggplot2
- epitools
- stats
- magrittr

Example: Simulating a PGS dataset and calculating ORs

# Load package
library(PRSmetrics)

# Simulate PGS dataset
set.seed(123)
pgs <- rnorm(10000, mean = 0, sd = 4)
beta <- 0.3 # effect size
mu <- qlogis(0.3) # set prevalence to 30%
prob_case <- plogis(mu + beta * pgs)
outcome <- rbinom(n, size = 1, prob = prob_case)

# Run the function
res <- calc_or(pgs, outcome, pgs_quantiles = seq(0, 1, by=0.1))

# View results
res$results
res$quantiles
res$plot

About

Useful functions to evaluate PRS performance

Resources

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages