Complete post-GWAS causal inference workflow that triangulates evidence across heritability partitioning, genetic correlation, Mendelian randomization (with CHP-aware sensitivity via CAUSE / LHC-MR), colocalization, fine-mapping (SuSiE / FOCUS), mediation, TWAS, cis-pQTL drug-target MR, effector-gene prioritization (L2G / PoPS / cS2G), and (optionally) GenomicSEM common-factor GWAS. Suitable for nominating causal exposures, picking the right tissue for downstream analyses, mapping a lead SNP to a candidate effector gene, de-risking or nominating a drug target, and producing a STROBE-MR-compliant publication-grade evidence battery from GWAS summary statistics.
install.packages('remotes')
remotes::install_github('MRCIEU/TwoSampleMR')
remotes::install_github('rondolab/MR-PRESSO')
remotes::install_github('jean997/cause')
remotes::install_github('zhenin/HDL/HDL')
remotes::install_github('josefin-werme/LAVA')
remotes::install_github('jrs95/MRlap')
remotes::install_github('LizaDarrous/lhcMR')
install.packages('coloc')
install.packages('susieR')
install.packages('MendelianRandomization')
remotes::install_github('GenomicSEM/GenomicSEM') # GenomicSEM is GitHub-only (not on CRAN)
git clone https://github.com/abdenlab/ldsc-python3.git # Python 3 fork, working CLI (bulik/ldsc is Python 2.7, unmaintained)
cd ldsc-python3 && pip install . && cd .. # Poetry project (pyproject.toml); no environment.yml
git clone https://github.com/hakyimlab/MetaXcan.git
pip install pyfocus
# MAGMA ships as a zip, not a git repo. Grab the current program zip from the official CNCR page
# (https://cncr.nl/research/magma/) -- the old vu.data.surfsara.nl direct links now 404 after SURF's
# domain migration, so fetch the link from that page rather than hard-coding one here.
unzip magma_v1.10.zip
git clone https://github.com/FinucaneLab/pops.git # PoPS is run as pops.py from the clone; PyPI `pops` is unrelated
Input data: - GWAS summary statistics for exposure and outcome (TSV with SNP, BETA, SE, A1, A2, EAF, P, N columns) - Pre-computed LDSC weights and baseline-LD annotation (eur_w_ld_chr, baselineLD) - TWAS prediction weights (PredictDB MASHR models or FUSION elastic net) matched to the tissue prioritized in Step 0 - LD matrix for fine-mapping loci (in-sample preferred; reference-panel acceptable with estimate_s_rss check) - Cis-pQTL summary stats for drug-target MR (UKB-PPP, deCODE, Fenland, INTERVAL) - Open Targets L2G features and PoPS gene-feature table for effector-gene step
Tell your AI agent what you want to do: - "Run the full post-GWAS causal-inference pipeline on my GWAS summary stats" - "Estimate heritability, prioritize tissues, then run MR with CHP-aware sensitivity" - "Triangulate TWAS, colocalization, and cis-eQTL MR to nominate the causal gene" - "Run cis-pQTL drug-target MR with Olink and SomaScan cross-platform replication" - "Prioritize an effector gene from a GWAS lead locus using L2G, PoPS, and ABC" - "Test a common-factor GWAS model across my correlated traits via GenomicSEM"
"I have GWAS summary statistics for LDL cholesterol and coronary heart disease. Run the complete causal-inference pipeline including heritability partitioning, tissue prioritization, MR with CHP-aware sensitivity, coloc, fine-mapping, and effector-gene prioritization."
"Perform MR, sensitivity analysis, and colocalization to test if BMI causally affects type 2 diabetes, with CAUSE if rg > 0.3."
"Estimate SNP heritability with LDSC, partition with the baseline-LD model, and prioritize tissues via Finucane 2018 cell-type LDSC for my schizophrenia GWAS."
"Run stratified LDSC on my GWAS to pick the right GTEx tissue for downstream TWAS."
"Compute cross-trait LDSC rg between my exposure and outcome to decide whether CAUSE or LHC-MR is required."
"Run LAVA local genetic correlation across the genome to find regions of shared signal."
"Select strong instruments and check F-statistics for my exposure GWAS."
"Run MR-PRESSO with NbDistribution = 10000 to detect outlier instruments."
"Run CAUSE because LDSC rg > 0.3 between my traits and CHP is plausible."
"Colocalize my GWAS locus with whole-blood eQTL using coloc.susie because the region has multiple signals."
"Fine-map my GWAS locus with SuSiE rss, run estimate_s_rss for LD diagnostics, and report 95% credible sets with min_abs_corr >= 0.5."
"Run S-PrediXcan in whole-blood MASHR models and fine-map TWAS hits with FOCUS at PIP >= 0.8."
"Triangulate TWAS, coloc.susie, and cis-eQTL MR to nominate a single causal gene per locus."
"Run cis-pQTL MR for IL6R using UKB-PPP and replicate in deCODE SomaScan with PAV-excluded sensitivity."
"Screen on-target adverse phenotypes with pheWAS at the cis-pQTL for my drug target."
"Map this GWAS lead variant to a candidate effector gene using Open Targets L2G, PoPS, cS2G, coloc, and ABC."
"Reconcile L2G and PoPS calls at my locus and report concordance across 6 evidence streams."
"Test if CRP mediates the causal effect of BMI on CHD using two-step MR or MVMR with Imai sensitivity."
"Run CMAverse 4-way decomposition for exposure-mediator interaction."
"Fit a common-factor GenomicSEM model across my 5 psychiatric GWAS and run a common-factor GWAS with Q_SNP heterogeneity testing."
"Compare GenomicSEM common-factor GWAS against MTAG for the same trait set."