Analysis code accompanying the manuscript "Improving PGS for Lpa(a) and CAD with LPA-augmented LD panels"
This repository contains R code used for the study "Improving Polygenic Risk Scores for Lipoprotein(a) and Coronary Artery Disease with LPA-augmented LD panels".
This study is not yet published (under development/review).
Description of files in the data/ folder:
-
data/snplist.snplist:
curated set of 14,113 variants in the LPA gene region (6:159452514-162585307 on hg19/GRCh37) -
data/composite_variants_hm3_plus_LPA_LD_panel_HRC.txt:
composite list of variants of the HM3+ LD panel published by Privé et al., and the custom high-density LD panel (cf. variant list above), while restricting to variants present in the HRC r1.1 2016 reference panel
Both variant lists are in format "CHR:POS:REF:ALT" without header and with POS on genome build hg19/GRCh37.
-
Clone the repository
git clone https://github.com/genepi/LPA_LD_panel_public.git cd LPA_LD_panel_public -
Install dependencies
conda env create -f bigsnpr_env.yml conda activate bigsnpr
-
Download GWAS summary statistics and LD reference panels
GWAS summary statistics:
- CAD GWAS published by Aragam et al.
- Lp(a) GWAS (will be available upon publication of this study)
LD panels:
- HM3 published by Privé et al.
- HM3+ published by Privé et al.
NOTE: For some analyses (e.g. de-novo calculation of the custom high-density LD panel for the LPA gene region) individual-level data from the UKB is required.
Run scripts from terminal with Rscript in activated conda environment (recommended).
- Compute custom high-density LD reference panel for the LPA gene region:
Rscript src/01_panel_dev/01_generate_custom_LPA_LD_panel.R --bgen input.bgen --snplist data/snplist.snplist [--outdir OUTPUT] [--cores nr_cores]- Combine custom LPA LD panel with chr6 of public HM3+ LD panel:
Rscript src/01_panel_dev/02_merge_panels_chr6.R --corr0 x.LD_corr0.rds --ldscores x.LD_scores.rds --corr0_ref_chr6 LD_with_blocks_chr6.rds --ref_meta map_hm3_plus.rds [--snplist data/snplist.snplist] [--outdir OUTPUT]- Create de-novo PGS with LDpred2-auto (one example):
Rscript src/02_score_dev/LPA/01_construct_LPA_score_hm3.R --sumstats LPA_sumstats.regenie.gz --ldref_folder data/LD_ref/hm3/ [--outdir OUTPUT] [--cores nr_cores]- Compute PGS values in a target cohort:
Rscript src/03_score_calc/bigsnpr_calc_score_from_bgen.R --score score.txt --bgenfiles bgen_paths.txt [--bgensample geno.sample] [--targetsamples target_sample_ids.txt] [--outdir OUTPUT] [--cores nr_cores]- Get model, which can be used to calibrate Lp(a) PGS to the original measurement scale for Lp(a):
Rscript src/04_score_calib/LPA_scores_calibration_UKB_test_set.R --pheno UKB.txt --samples IDs.txt --score xxx.scores.txt [--outdir OUTPUT]For all scripts a message describing the input requirements can be generated like this:
Rscript src/01_panel_dev/01_generate_custom_LPA_LD_panel.R --helpThis code was developed at the Institute of Genetic Epidemiology, Medical University of Innsbruck