Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Penalized Regression for Inference of Polygenic Risk Scores

License

NotificationsYou must be signed in to change notification settings

shz9/penprs

Repository files navigation

PenPRS is a Python package that includes summary statistics based sparse and accurate penalized regression models for the inference of Polygenic Risk Scores (PRS) using Linkage Disequilibrium (LD) and GWAS Summary Statistics. The models currently available include:

  • LASSO
  • SSL (Spike-and-slab LASSO PRS)
    • SSLAlpha (Alpha-heritability modeled SSL)

PenPRS integrates withmagenpy for data harmonization and LD loading and computation. Details related to model methodology and specifications are present in the paper.

Reference

Song, J., Zabad, S., Yang, A., Gravel, S., & Li, Y. (2025).Sparse polygenic risk score inference with the spike-and-slab LASSO.Bioinformatics.https://doi.org/10.1093/bioinformatics/btaf578

Installation

To install the package fromGitHub, use the following command:

pip install git+https://github.com/shz9/penprs.git

Quickstart

importmagenpyasmgpfrompenprs.model.LassoimportLassofrompenprs.model.SSLimportSSLfrompenprs.model.SSLAlphaimportSSLAlpha# Load a genotype reference and GWAS summary statistics data (chromosome 22)gdl=mgp.GWADataLoader(mgp.tgp_eur_data_path(),sumstats_files=mgp.ukb_height_sumstats_path(),sumstats_format="fastgwa")# Compute block LD matrix:ld_block_url="https://bitbucket.org/nygcresearch/ldetect-data/raw/ac125e47bf7ff3e90be31f278a7b6a61daaba0dc/EUR/fourier_ls-all.bed"gdl.compute_ld('block',ld_blocks_file=ld_block_url,dtype='int16',compute_spectral_properties=True,output_dir='temp/block_ld/')# Initialize respective modelslasso_model=Lasso(gdl,lam=100)ssl_model=SSL(gdl,l0=750,l1=10)# Perform single fit using model initialized argumentslasso_model.fit()# fit using lam=100ssl_model.fit()# fit using l0=750, l1=10

Viewing model effect size estimates (BETA):

# Viewing the effect size estimates (BETA) for LASSOlasso_model.to_table().head()
CHRSNPPOSA1A2BETA
22rs13153816871137AG0.001439
22rs960590317054720CT-0.000000
22rs574664717057138GT-0.001534
22rs1698073917058616TC-0.001342
22rs960592317065079AT0.006215

Pathwise and Warm-Start fashioned fit

# To solve in a path-wise or warm-start fashion# save_intermediate=True to save effect size estimate per ladder steplasso_model_pw=Lasso(gdl)ssl_model_ws=SSL(gdl)# Performs path-wise fit across the default 20 step ladderlasso_model_pw.pathwise_fit(save_intermediate=True)# Performs warm-start fit across the default 20 step ladderssl_model_ws.warm_start_fit(save_intermediate=True)

Command Line Interface (CLI)

You can fit theSSL model with Grid-Search (GS) from the command line usingpenprs_fit:

penprs_fit -l path_to_train_ld \-s path_to_train_sumstats \--output-dir path_to_output_dir \-m SSL\# model: options = LASSO, SSL, SSLAlpha--hyp-search GS\# hyperparameter search: options = GS (Grid Search), WS (Warm Start)--validation-ld-panel path_to_validation_ld \--validation-sumstats path_to_validation_sumstats \--use-symmetric-ld \--grid-metric pseudo_validation \--threads 4

For more information on the command line arguments, seepenprs_fit --help

Citation

If you use this package in your research, please cite the following paper:

@article{10.1093/bioinformatics/btaf578,author ={Song, Junyi and Zabad, Shadi and Yang, Archer and Gravel, Simon and Li, Yue},title ={Sparse Polygenic Risk Score Inference with the Spike-and-Slab LASSO},journal ={Bioinformatics},pages ={btaf578},year ={2025},month ={10},doi ={10.1093/bioinformatics/btaf578},url ={https://doi.org/10.1093/bioinformatics/btaf578},eprint ={https://academic.oup.com/bioinformatics/advance-article-pdf/doi/10.1093/bioinformatics/btaf578/64738987/btaf578.pdf},}

About

Penalized Regression for Inference of Polygenic Risk Scores

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors2

  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp