[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EBMG53NV79QSDVR2HHRGS3":3,"skill-same:01M7EBMG53NV79QSDVR2HHRGS3":78},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":30,"commitSha":31,"skillDirectory":32,"forksCount":14,"repositoryHtmlUrl":33,"repositoryHomepageUrl":33,"ownerHtmlUrl":34,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":35,"install":36,"resources":49},"01M7EBMG53NV79QSDVR2HHRGS3","bio-causal-genomics-colocalization-analysis",null,"Test whether two or more traits share a causal variant at a locus using Bayesian colocalization (coloc.abf, coloc.susie, HyPrColoc, moloc, eCAVIAR, SMR\u002FHEIDI, PWCoCo, SharePro). Use when integrating GWAS with eQTL\u002FsQTL\u002FpQTL\u002FmQTL, distinguishing shared causal variants from LD-driven coincidence, handling allelic heterogeneity, choosing between single-causal vs multi-causal methods, picking PP.H4 thresholds, running sensitivity over p12, or harmonising summary statistics for colocalization.","Mr-Nobody-Anonymous\u002FAll-skills","Mr-Nobody-Anonymous","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F184253119?v=4","01M7AEXFJHKTYQW5R0ZCQQTWFV","anonymous","01M7C00M3GQR4QKP9GZA42GFAK",0,"MIT","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-causal-genomics-colocalization-analysis\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: bio-causal-genomics-colocalization-analysis\ndescription: Test whether two or more traits share a causal variant at a locus using Bayesian colocalization (coloc.abf, coloc.susie, HyPrColoc, moloc, eCAVIAR, SMR\u002FHEIDI, PWCoCo, SharePro). Use when integrating GWAS with eQTL\u002FsQTL\u002FpQTL\u002FmQTL, distinguishing shared causal variants from LD-driven coincidence, handling allelic heterogeneity, choosing between single-causal vs multi-causal methods, picking PP.H4 thresholds, running sensitivity over p12, or harmonising summary statistics for colocalization.\ntool_type: r\nprimary_tool: coloc\nsource: \"https:\u002F\u002Fgithub.com\u002FGPTomics\u002FbioSkills\"\nsource_repository: \"GPTomics\u002FbioSkills\"\nsource_path: \"causal-genomics\u002Fcolocalization-analysis\u002FSKILL.md\"\nlicense: \"MIT\"\nimported_at: \"2026-09-20\"\n---\n\n## Version Compatibility\n\nReference examples tested with: coloc 5.2.3+, susieR 0.12.35+, hyprcoloc 1.0+ (GitHub jrs95\u002Fhyprcoloc), SMR 1.3.1+ (CLI, cnsgenomics.com), eCAVIAR 2.2+ (compiled from caviar\u002FeCAVIAR repo), PWCoCo 1.0+ (jwr-git\u002Fpwcoco), moloc 0.1+ (clagiamba\u002Fmoloc), SharePro_coloc 7.0+ (zhwm\u002FSharePro_coloc), R >= 4.1.\n\nBefore using code patterns, verify installed versions match. If versions differ:\n- R: `packageVersion('coloc')`; check `?coloc.abf`, `?coloc.susie`, `?runsusie`\n- CLI: `smr --version`, `pwcoco --help`, `sharepro_coloc.py --help`\n\nIf code throws AttributeError, NULL list elements, or `Error in coloc.abf: dataset must have...`, introspect the installed package signature and adapt the example rather than retrying.\n\n# Colocalization Analysis\n\n**\"Test whether my GWAS signal and an eQTL share the same causal variant\"** -> Compute Bayesian posterior probabilities over five hypotheses (H0 neither, H1 trait-1-only, H2 trait-2-only, H3 distinct causal variants, H4 shared causal variant) to discriminate true causal overlap from LD-driven coincidence, then run sensitivity analysis over the p12 prior.\n\n- R (single-causal, fastest): `coloc::coloc.abf(dataset1, dataset2, p12=5e-6)` -> `coloc::sensitivity(res, 'H4 > 0.75')`\n- R (multi-causal, needs LD): `runsusie(d1)` -> `runsusie(d2)` -> `coloc.susie(s1, s2)` -> per-credible-set PP\n- R (many traits, single-causal cluster): `hyprcoloc::hyprcoloc(effect.est = betas_mat, effect.se = ses_mat, trait.names = ..., snp.id = ...)` -> trait clusters\n- CLI (causality vs linkage): `smr --bfile ref --gwas-summary g.ma --beqtl-summary eqtl.besd --out smr` -> SMR p + HEIDI p\n- CLI (allelic heterogeneity): eCAVIAR `eCAVIAR -l ld1 -l ld2 -z z1 -z z2 -o out -c 2` -> CLPP per SNP\n- CLI (conditional): PWCoCo conditions on each independent signal via GCTA-COJO then runs pairwise coloc.abf\n\n## Algorithmic Taxonomy\n\n| Method | Model | Inputs | Output | Strength | Fails when |\n|--------|-------|--------|--------|----------|------------|\n| coloc.abf (Giambartolomei 2014) | Single causal variant per locus; Bayesian ABF | beta+varbeta or p+MAF; sample sizes; type\u002Fs\u002FsdY | PP.H0-H4 | Fast (~1s\u002Flocus), no LD required, mature, widely-cited | 2+ causal variants in moderate LD -> PP.H3 inflates spuriously; assumes a single causal per trait |\n| coloc.susie (Wallace 2021) | Multi-causal via SuSiE; per-credible-set pairwise coloc | Summary stats + ancestry-matched LD matrix | PP.H4 per (CS1, CS2) pair | Handles allelic heterogeneity; principled CS framework | Sensitive to LD-mismatch; sample-size-LD mismatch -> spurious credible sets; needs in-sample or matched LD |\n| SMR + HEIDI (Zhu 2016) | Tests pleiotropy (one variant -> both traits) vs linkage (two variants in LD) | GWAS .ma; eQTL .besd; LD reference (plink bfile) | SMR p (significance) + HEIDI p (null = shared causal) | Distinguishes shared-causal from linkage at a top SNP; standard for eQTLGen \u002F GTEx integration | Fails to discriminate when LD between causal SNPs > 0.7 (HEIDI loses power); HEIDI requires >= 10 SNPs near top |\n| eCAVIAR \u002F CLPP (Hormozdiari 2016) | Fine-mapping-aware; computes Colocalization Posterior Probability per SNP | Z-scores; LD matrices per trait | CLPP per SNP; per-locus sum | Handles allelic heterogeneity natively; per-SNP resolution | Computationally heavy at -c > 3 causal variants; CLPP thresholds debated (0.01 vs 0.1) |\n| PWCoCo (Robinson 2022) | Pairwise conditional via GCTA-COJO conditioning | Summary stats + individual-level LD bfile | Per-conditional-signal coloc.abf results | Cleanly handles AH at top GWAS hit + secondary signals | Needs individual-level reference; sensitive to COJO collinearity threshold |\n| moloc (Giambartolomei 2018) | Multi-trait extension of coloc.abf (3-5 traits) | Per-trait summary stats | 15 (3-trait) \u002F 31 (4-trait) \u002F 63 (5-trait) hypothesis PPs | First principled multi-omic coloc | Hypothesis count = 2^k - 1 explodes; >= 6 traits computationally infeasible; minimally updated since 2019 |\n| HyPrColoc (Foley 2021) | Many-trait cluster-based; iterative branch-and-bound under single-causal | Beta + SE matrices SNPs x traits | Trait clusters sharing a causal variant | Scales to 50+ traits; identifies cluster substructure | Inherits single-causal assumption from coloc.abf; clusters can fragment under AH |\n| SharePro_coloc (Zhang 2024) | Variational effect-group joint model | Beta + SE; LD per ancestry | Effect-group level PP | Handles multiple causal signals jointly; faster than coloc.susie at scale | Newer (2024); benchmarks evolving; trickier installation |\n| Pullin & Wallace 2025 variant-specific priors | Function-aware p12 (e.g. up-weight coding\u002Fpromoter SNPs) | Same as coloc.abf + per-SNP prior weights | PP.H0-H4 with non-uniform prior | Improves discovery when functional annotation is informative | Annotation choice is a methodological lever; report sensitivity |\n\nMethodology evolves; verify the current Open Targets Genetics, eQTL Catalogue, and FinnGen colocalization pipelines before locking parameters. Open Targets uses coloc.abf at PP.H4 >= 0.75 with p12 = 1e-5; FinnGen uses coloc.susie at PP.H4 >= 0.8 with in-sample LD.\n\n## Decision Tree by Scenario\n\n| Scenario | Recommended method | Why |\n|----------|---------------------|-----|\n| GWAS + single-tissue eQTL, top GWAS variant looks single-signal | coloc.abf + sensitivity() | Fast, no LD needed, well-validated; single-causal assumption typically holds at clean loci |\n| GWAS + eQTL, conditional analysis shows 2+ independent signals | coloc.susie OR PWCoCo | Multi-causal handling; coloc.susie if summary-stats LD available, PWCoCo if individual-level reference accessible |\n| GWAS + multi-tissue eQTL (e.g. all 49 GTEx tissues) | coloc.abf per tissue + HyPrColoc across tissues | Per-tissue PP.H4 gives tissue-specific causality; HyPrColoc identifies tissue clusters sharing the variant |\n| GWAS + eQTL + sQTL + mQTL (3-5 omics) | moloc (k \u003C= 5) OR HyPrColoc | moloc gives explicit hypothesis posterior; HyPrColoc scales but loses hypothesis structure |\n| Many GWAS traits at one locus (pleiotropic hub) | HyPrColoc | Designed for many-trait clustering; coloc.abf pairwise scales as k^2 |\n| Top SNP has only modest GWAS p; is it the same causal as eQTL? | SMR + HEIDI | SMR tests pleiotropy\u002Fcausality; HEIDI rejects shared-causal -> linkage |\n| Want per-SNP credibility under allelic heterogeneity | eCAVIAR (CLPP) | Per-SNP CLPP integrates fine-mapping with coloc |\n| MHC \u002F HLA region (chr6:25-35 Mb) | HLA-coloc (Butler-Laporte 2024) OR exclude MHC | Long-range LD breaks single-causal assumption; standard PP.H4 not interpretable |\n| Trans-eQTL \u002F GWAS pair | coloc.abf with p12 lowered to 5e-6 or 1e-6 | Shared causality is biologically rare; default p12=1e-5 over-favours H4 |\n| Ancestry-mismatched GWAS vs eQTL | ancestry-matched coloc.susie OR coloc_SuSiEx | LD differs across ancestries; using EUR LD on AFR z-scores produces spurious credible sets |\n| Very small eQTL (N \u003C 200) | None reliably; flag locus underpowered | All methods report H0\u002FH1\u002FH2 dominance; report PP transparently and gather larger reference (eQTLGen N~31k, GTEx v8) |\n\n## Per-Method Failure Modes\n\n### coloc.abf -- PP.H3 inflation under multiple causal variants\n\n**Trigger:** Locus has 2+ independent causal signals in moderate LD (r2 ~ 0.3-0.6).\n\n**Mechanism:** The single-causal-variant assumption forces the model to allocate posterior mass to H3 (distinct causal variants) whenever the per-SNP Bayes factors for the two top SNPs do not align.\n\n**Symptom:** Visual co-localization in LocusZoom looks convincing, but `result$summary['PP.H3.abf']` dominates over PP.H4; sensitivity() shows PP.H4 stays low across the entire p12 grid.\n\n**Fix:** Run coloc.susie (or eCAVIAR or PWCoCo) to allow multiple causal variants. If coloc.susie returns multiple credible sets with one pair showing PP.H4 > 0.75, this is real allelic heterogeneity not failure.\n\n### coloc.susie -- LD reference mismatch\n\n**Trigger:** Z-scores from GWAS \u002F eQTL of one ancestry, LD matrix from 1000 Genomes EUR (or any non-matched reference).\n\n**Mechanism:** SuSiE assumes z-scores and the supplied LD are jointly consistent. Ancestry mismatch or sample-size mismatch produces a non-positive-definite implicit covariance; SuSiE responds by returning spurious credible sets that include LD-mismatched SNPs.\n\n**Symptom:** `susieR::estimate_s_rss(z, R, n)` returns lambda > 0.05; `susieR::kriging_rss` flags off-diagonal SNPs with extreme studentized residuals; credible sets are oddly large (50+ SNPs) or include SNPs distant in LD from the lead.\n\n**Fix:** Use in-sample LD when at all possible (per-cohort plink `--r square`). If reference must be external, match ancestry (1KG superpopulation) and superpopulation-stratify. Run `estimate_s_rss` and report lambda; if > 0.05, drop the locus or switch to coloc.abf.\n\n### coloc default p12 too liberal for trans-eQTL\n\n**Trigger:** Applying `p12 = 1e-5` (the default) to a trans-eQTL \u002F GWAS pair.\n\n**Mechanism:** The default p12 was calibrated for cis-eQTL where biological proximity makes shared causality reasonable. For trans-eQTL, prior probability of shared causality is much lower; uniform p12 over-favours H4.\n\n**Symptom:** PP.H4 > 0.8 reported, but sensitivity() reveals PP.H4 falls below 0.5 for p12 \u003C 1e-5; replication in independent data fails.\n\n**Fix:** Operational definition: \"trans\" = >5 Mb from TSS or different chromosome. Default p12=1e-5 over-favors H4 for trans (genome-rare biology). For trans: lower p12 to 5e-6 or 1e-6 AND raise PP.H4 threshold to >= 0.8 (compensate for higher FP risk). Cross-reference Vosa 2021 Nat Genet 53:1300 (eQTLGen trans) for empirical patterns.\n\n### MHC \u002F HLA + chr 8 inversion -- single-causal assumption breaks\n\n**Trigger:** Locus within chr6:25-35 Mb (extended MHC, hg38), or chr8:8.1-11.9 Mb (chr 8 inversion, hg38).\n\n**Mechanism:** The MHC contains classical HLA genes with extreme long-range LD (r2 > 0.5 over many Mb), multiple independent causal haplotypes, and structural variation. The chr 8p23.1 inversion similarly produces long-range LD across megabases of polymorphic inversion alleles. The single-causal-variant assumption is biologically wrong in both regions.\n\n**Symptom:** coloc.abf almost always returns PP.H3 or fragmented PP across H1\u002FH2\u002FH3\u002FH4 even when the underlying biology is well-established (e.g. HLA-DRB1 in autoimmune GWAS).\n\n**Fix (MHC):** Use HLA-imputed classical alleles via SNP2HLA \u002F HIBAG \u002F HLA-TAPAS, then HLA-coloc (Butler-Laporte 2024 medRxiv) -- NOT coloc on SNPs in MHC. OR exclude MHC from genome-wide coloc and report HLA association at the haplotype\u002Fallele level. **Fix (chr 8 inversion):** Exclude chr8:8.1-11.9 Mb or pre-condition on inversion genotype before coloc. Never report a single coloc PP.H4 in either region without this caveat.\n\n### Lead-SNP swap and window bias\n\n**Trigger:** The two traits have different lead SNPs at the same locus; analyst centres each window on the trait-specific lead.\n\n**Mechanism:** coloc PP is sensitive to the SNPs in the window; centring on different leads gives different per-SNP overlap and biases toward H3.\n\n**Symptom:** Re-centring the window on the GWAS lead vs the eQTL lead produces qualitatively different PP.H4.\n\n**Fix:** Use a SINGLE window (typically +\u002F- 500 kb or 1 Mb) centred on the joint top-variant (the SNP with the lowest min-p across both traits), or on the GWAS lead consistently. Report PP under multiple centring choices; flag the locus if PP swings > 0.2 across centrings.\n\n### Underpowered eQTL (N \u003C 200)\n\n**Trigger:** Small eQTL discovery (e.g. tissue-specific bulk study, N \u003C 200; per-cell-type sc-eQTL).\n\n**Mechanism:** With low N, varbeta is large; the eQTL's per-SNP Bayes factors are flat; the joint likelihood concentrates on H0 or H1 (GWAS-only).\n\n**Symptom:** PP.H0 or PP.H1 dominates; the eQTL panel shows visible signal but coloc cannot resolve causal vs noise.\n\n**Fix:** Use eQTLGen (N ~ 31k whole-blood) or GTEx v8 (N ~ 70-700 per tissue) where possible. For rare cell types, accept the limitation and report the locus as underpowered rather than claim absence of colocalization.\n\n| eQTL N | Coloc viability | Notes |\n|--------|-----------------|-------|\n| \u003C 200 | Underpowered | PP.H1 dominant; flag |\n| 200-500 | Cis only, modest | Single-tissue cis |\n| 500-1000 | Good for cis | Most GTEx v8 tissues |\n| >= 1000 | Well-powered | Trans accessible |\n| >= 10000 | Meta (eQTLGen) | Cross-tissue \u002F sc |\n\n### Reference QTL panel choice\n\nGTEx v8 (838 donors, 49 tissues, 2020) is the current PredictDB-supported standard. GTEx v10 (released 2024) has limited harmonisation and is not yet PredictDB-default. eQTLGen blood meta-eQTL (N ~ 31k) wins on sample size for blood cis-eQTL discovery, beating any single tissue on power. Always pin version in methods (e.g. \"GTEx v8 MASHR-EUR, PredictDB release 2022-01\").\n\n## PP.H4 Threshold Framework\n\n| Threshold | Use case | Source |\n|-----------|----------|--------|\n| 0.5 - 0.7 | Suggestive \u002F pilot \u002F hypothesis-generating | Giambartolomei 2014 original |\n| >= 0.7 | Triangulation tier for TWAS \u002F cis-MR \u002F effector-gene cross-evidence | Open Targets Genetics common practice; cross-reference downstream skills |\n| >= 0.75 | Open Targets Platform \u002F eQTL Catalogue \u002F FinnGen default screening threshold | Open Targets Genetics docs; Mountjoy 2021 Nat Genet 53:1527 |\n| >= 0.80 | Most published colocalizations \u002F standard publication tier | Wallace 2020 PLoS Genet 16:e1008720 |\n| >= 0.90 | Stringent clinical \u002F therapeutic-target prioritization | Reserved for high-confidence claims |\n| >= 0.95 | Industry \u002F regulatory drug-target submission grade | Internal pharma default |\n| PP.H3 >= 0.80 | Confident distinct causal variants (negative coloc result) | Standard |\n| PP.H4 \u002F (PP.H3 + PP.H4) >= 0.9 | Conditional probability framing (some pipelines) | Foley 2021 |\n\n**Operational rule:** Three operational tiers map onto the most common downstream uses: (a) **>= 0.7** when PP.H4 is one of several lines of triangulating evidence (TWAS + coloc, cis-MR + coloc, effector-gene multi-evidence) -- this is the threshold downstream skills (causal-genomics\u002Ftranscriptome-wide-association, causal-genomics\u002Fmendelian-randomization cis-MR, causal-genomics\u002Feffector-gene-prioritization, causal-genomics\u002Fproteome-mr-drug-target) require; (b) **>= 0.8** for standard peer-reviewed publication as a stand-alone coloc claim (Wallace 2020); (c) **>= 0.95** for industry \u002F clinical drug-target submission. Open Targets and FinnGen pipelines screen at >= 0.75 but downstream publication-grade coloc claims should clear >= 0.8 and triangulation claims >= 0.7. ALWAYS report PP.H3 alongside PP.H4 -- a locus with PP.H4 = 0.6, PP.H3 = 0.3 is qualitatively different from PP.H4 = 0.6, PP.H3 = 0.05 (the former is real ambiguity over single vs distinct causal; the latter is underpowered evidence). Run `coloc::sensitivity()` and report the p12 range over which PP.H4 stays above the threshold.\n\n## Default Priors and the p12 Sensitivity Question\n\n| Prior | Default | Interpretation | When to change |\n|-------|---------|----------------|----------------|\n| p1 | 1e-4 | Prob a random SNP is associated with trait 1 | Rarely changed |\n| p2 | 1e-4 | Prob a random SNP is associated with trait 2 | Rarely changed |\n| p12 | 1e-5 | Prob a random SNP is associated with both traits | Lower (5e-6 or 1e-6) for trans-eQTL or unrelated trait pairs; raise (5e-5) only with strong prior, e.g. molecular QTL in the same tissue as causal cell type |\n\nThe p12\u002Fp1 ratio (= 0.1 under defaults) is the prior odds of colocalization given a trait-1 association. Wallace 2020 (PLoS Genet 16:e1008720) showed default p12 = 1e-5 is too liberal for many real-world settings and recommended sensitivity analysis as standard practice. Pullin & Wallace 2025 (PLoS Genet 21:e1011697) extended this with variant-specific priors weighted by functional annotation.\n\n### p12 Sensitivity Grid\n\n| p12 grid point | Use case | Reporting rule |\n|----------------|----------|-----------------|\n| 1e-4 | Suggestive only \u002F EUR cis-eQTL relaxed | PP.H4 here cannot support a publication claim |\n| 1e-5 | Default for most cis-eQTL \u003C-> GWAS pairs | Standard |\n| 5e-6 | Conservative cis; default for trans-eQTL coloc | Recommended publication baseline |\n| 1e-6 | Very conservative; trans coloc with weak prior | Required for cross-trait genome-rare coloc |\n\n**Operational rule:** Require PP.H4 to remain above threshold across at least 3 adjacent grid points; report the lowest p12 at which PP.H4 >= 0.75. Use `coloc::sensitivity(result, rule = 'H4 > 0.75')` for the diagnostic plot.\n\nRequired reporting: PP.H4 at default priors + p12 range over which PP.H4 stays above threshold.\n\n## eCAVIAR CLPP Threshold Framework\n\nCLPP (Colocalization Posterior Probability) is the per-SNP product of the two per-trait fine-mapping posteriors. Threshold conventions:\n\n- Hormozdiari 2016 AJHG 99:1245 used CLPP >= 0.01 (validated against null simulations).\n- 2024 GTEx \u002F Open Targets pipelines use CLPP >= 0.05.\n- High-confidence claims require CLPP >= 0.1.\n- Report both sum-CLPP across the credible set AND max-CLPP at any single SNP -- the two answer different questions (locus-level vs lead-SNP-level confidence).\n\n```bash\neCAVIAR -l ld_gwas.ld -l ld_eqtl.ld \\\n        -z gwas.z -z eqtl.z \\\n        -o coloc_out -c 2     # -c = max independent causal variants per trait\n# Output: per-SNP CLPP in coloc_out_col file; report sum and max\n```\n\n## LD Matrix Construction for coloc.susie\n\n**Requirements:**\n\n- Signed Pearson r (not r2). coloc.susie expects directional LD; squared LD silently inverts effect-direction inference.\n- Ancestry-matched to GWAS \u002F eQTL ancestry. EUR LD on AFR z-scores produces spurious credible sets.\n- SNP-order-aligned to the beta vector and named to match (row\u002Fcolumn names = SNP IDs).\n- Positive semi-definite. Numerical-noise negative eigenvalues must be repaired.\n- Effective N sample-size-matched to the trait being fine-mapped (provide via `runsusie(..., n = N)`).\n\n```bash\n# plink2 phased r (signed Pearson); square matrix output\nplink2 --pfile 1KG_EUR \\\n    --extract snps.txt --chr 6 --from-bp X --to-bp Y \\\n    --r-phased square --out locus_ld\n```\n\n```r\n# Alternative: in-sample LD from BED via bigsnpr\nR \u003C- bigsnpr::snp_cor(snp_obj$genotypes, ind.col = locus_snps)\n# PSD repair if negative eigenvalues from numerical noise\nR \u003C- as.matrix(Matrix::nearPD(R)$mat)\ndimnames(R) \u003C- list(snp_ids, snp_ids)\n```\n\n**Critical:** Row and column order of R MUST match SNP order in the beta vector -- silent failure otherwise. The SuSiE objective stays finite under mis-ordering and returns nonsense credible sets. Verify with `stopifnot(rownames(R) == names(beta))` before `runsusie`. Cross-reference causal-genomics\u002Ffine-mapping for the full LD diagnostic block (`estimate_s_rss` lambda \u003C 0.05, `kriging_rss` outlier inspection).\n\n## SMR vs coloc Reconciliation\n\nSMR (Zhu 2016) and coloc test related but non-identical questions:\n\n- **SMR** tests pleiotropy vs linkage: does the top eQTL SNP show a GWAS effect explainable by its eQTL effect (pleiotropic \u002F causal) or does the GWAS effect come from a different SNP in LD (linkage)?\n- **coloc** tests shared vs distinct causal variants over an entire window of SNPs.\n- **HEIDI** is SMR's heterogeneity test; null hypothesis is single shared causal SNP. Zhu 2016 Nat Genet 48:481 specifies **HEIDI p > 0.05** (NOT 0.01) as non-rejection of single shared causal. HEIDI p > 0.05 does NOT prove shared causality -- only that data cannot reject it; pair with SMR p Bonferroni-corrected across probes. When LD between causal SNPs > 0.7, HEIDI loses power same as coloc.\n\nWhen LD between two true causal SNPs is high (r2 > 0.7), both SMR\u002FHEIDI and coloc.abf lose discriminatory power: SMR cannot pick which of the LD-tied SNPs is causal, and coloc.abf cannot reject H4 even if biology is two-distinct-causal. coloc.susie + ancestry-matched LD is the modern resolution.\n\n**Operational rule:** SMR + HEIDI is appropriate when the question is \"does this eQTL gene mediate the GWAS effect at all?\" coloc is appropriate when the question is \"do the two traits share a causal variant in this window?\" Run both; agreement (significant SMR + non-rejected HEIDI + PP.H4 >= 0.75) is high-confidence; disagreement requires inspection (often the multi-causal \u002F LD scenario above).\n\n## moloc Multi-Omic Framework (3-5 Traits)\n\nFor k traits, moloc tests `2^k - 1` hypotheses. 3 traits -> 15 hypotheses (H_a, H_b, H_c, H_ab, H_ac, H_bc, H_abc, plus \"none of the above\"); 4 traits -> 31; 5 traits -> 63. The hypothesis H_{all-share} (all k share a single causal variant) is the multi-omic analog of PP.H4.\n\n```r\n# moloc 3-trait example; install via remotes::install_github('clagiamba\u002Fmoloc')\nlibrary(moloc)\n# Input: list of k dataframes with BETA, SE, N, MAF per SNP and shared SNP IDs\nresult_moloc \u003C- moloc_test(listData=list(gwas=gwas_df, eqtl=eqtl_df, sqtl=sqtl_df),\n                            prior_var=c(0.01, 0.1, 0.5), priors=c(1e-4, 1e-6, 1e-7))\n# PPA: posterior over all 15 hypotheses (3-trait case)\n# Key column: PPA.abc (all-three-share)\n```\n\nmoloc is computationally tractable up to k = 5 but explodes beyond; use HyPrColoc for k >= 6.\n\n## HyPrColoc Cluster-Based Coloc (Many Traits)\n\nHyPrColoc (Foley 2021) extends single-causal coloc to many traits by clustering traits that share a causal variant. Output: per-cluster posterior + per-trait cluster assignment.\n\n```r\nlibrary(hyprcoloc)\n# Inputs: SNPs-by-traits matrices of betas and standard errors\n# Rows = SNPs (must be shared across all traits); Columns = traits\nres \u003C- hyprcoloc(effect.est=betas, effect.se=ses,\n                  trait.names=colnames(betas), snp.id=rownames(betas),\n                  reg.thresh=0.7,     # regional probability of coloc threshold\n                  align.thresh=0.7)   # alignment threshold for traits within a cluster\nres$results  # cluster assignment per trait + posterior\n```\n\nHyPrColoc inherits the single-causal-per-cluster assumption from coloc.abf; clusters can fragment if the true biology is allelic heterogeneity.\n\n## PWCoCo (Conditional Pairwise Coloc)\n\nPWCoCo (Robinson 2022) wraps GCTA-COJO conditional analysis around coloc.abf. For a locus with `k1` independent trait-1 signals and `k2` independent trait-2 signals, PWCoCo runs `k1 * k2` pairwise coloc.abf tests after conditioning each summary statistic on the other independent signals.\n\n**When to use:** When GCTA-COJO has identified >= 2 independent signals in at least one trait and individual-level reference genotypes are available. Particularly suited to bulk eQTL with secondary cis signals.\n\n**Inputs:** Per-trait summary stats (SNP, A1, A2, freq, beta, se, p, N) + plink bfile reference. **Output:** One coloc.abf result per (conditional signal 1, conditional signal 2) pair. Interpret each row as an independent single-signal coloc.\n\n**Caveats:** PWCoCo requires individual-level reference (plink bfile); cannot run on summary stats alone. Collinearity threshold in COJO (default `--cojo-collinear 0.9`) controls how aggressively independent signals are split; lower values fragment, higher values merge. Worked CLI recipe in usage-guide.md.\n\n## Standard coloc.abf Pipeline\n\n**Goal:** Test whether a single GWAS lead variant shares a causal variant with an eQTL gene's top signal at a defined locus.\n\n**Approach:** Extract a 1 Mb window centred on the GWAS lead; harmonise alleles between datasets; format coloc input lists with `type` ('quant' or 'cc'), sample size `N`, and either `sdY` (quant) or `s` (cc); run coloc.abf; run sensitivity() over the p12 grid.\n\n```r\nlibrary(coloc)\n\n# Inputs: harmonised gwas_df and eqtl_df with SNP, BETA, SE, MAF, N, POS columns\n# Both must share the same SNP set and allele coding (verify with harmonise step)\n\ngwas_input \u003C- list(\n    beta=gwas_df$BETA, varbeta=gwas_df$SE^2,\n    snp=gwas_df$SNP, position=gwas_df$POS,\n    type='cc',           # case-control GWAS\n    s=0.30,              # case fraction\n    N=50000)\n\neqtl_input \u003C- list(\n    beta=eqtl_df$BETA, varbeta=eqtl_df$SE^2,\n    snp=eqtl_df$SNP, position=eqtl_df$POS,\n    type='quant',        # quantitative eQTL\n    sdY=1,               # SD(expression); 1 if standardised, else estimate from MAF+varbeta\n    N=500)\n\nres \u003C- coloc.abf(dataset1=gwas_input, dataset2=eqtl_input,\n                  p1=1e-4, p2=1e-4, p12=5e-6)   # conservative p12\n\nprint(res$summary)\nsens \u003C- coloc::sensitivity(res, rule='H4 > 0.75')   # generates plot + table\n```\n\n`sdY` semantics: when omitted, coloc estimates from `MAF` and `varbeta`; supplying `sdY=1` ASSUMES the trait is already standardised (eQTL with inverse-normal-transformed expression). Mismatch produces silently wrong Bayes factors -- the most common silent failure.\n\n- For quantitative trait: leave `sdY=NULL` to estimate via `coloc:::sdY.est(varbeta, MAF, N)`. If CV of estimated sdY across SNPs > 0.5, varbeta\u002FMAF are inconsistent -- coloc will silently miscalibrate Bayes factors.\n- For inverse-normal-transformed expression: use `sdY = 1` (already standardized).\n- Mismatch produces silently wrong PP -- most common silent failure.\n\n`s` parameter for case-control (`type='cc'`):\n\n- `s` = N_cases \u002F N_total (NOT cases-per-control; NOT 0.5 default).\n- For population-cohort case-control: `s` ~ disease prevalence in the cohort (~0.005 for rare disease).\n- Wrong `s` does not error -- silently biases PP at extreme MAF.\n\n## coloc.susie Multi-Causal Pipeline\n\n**Goal:** Test colocalization at a locus with multiple independent signals (allelic heterogeneity).\n\n**Approach:** Run SuSiE on each trait's summary statistics with ancestry-matched LD; verify LD-z-score consistency; coloc-test each pair of credible sets.\n\n```r\nlibrary(coloc); library(susieR)\n\n# Diagnostic: z-score vs LD consistency MUST be checked\nz_gwas \u003C- gwas_df$BETA \u002F gwas_df$SE\nlam_gwas \u003C- susieR::estimate_s_rss(z=z_gwas, R=ld_matrix, n=gwas_n)\nif (lam_gwas > 0.05) stop('LD reference mismatched to z-scores; lambda=', lam_gwas)\n\ns1 \u003C- runsusie(list(beta=gwas_df$BETA, varbeta=gwas_df$SE^2,\n                    snp=gwas_df$SNP, position=gwas_df$POS,\n                    type='cc', s=0.3, N=50000, LD=ld_matrix), L=10)\ns2 \u003C- runsusie(list(beta=eqtl_df$BETA, varbeta=eqtl_df$SE^2,\n                    snp=eqtl_df$SNP, position=eqtl_df$POS,\n                    type='quant', sdY=1, N=500, LD=ld_matrix), L=10)\n\nres_susie \u003C- coloc.susie(s1, s2)   # NULL if no overlapping CS\n# res_susie$summary rows: each (hit1, hit2) pair of credible sets\n```\n\nLD matrix MUST be in the same SNP order as the beta vector; mis-ordering silently produces nonsense.\n\n## SMR + HEIDI Pipeline\n\n```bash\n# SMR is a command-line tool. Pre-format GWAS into .ma (SNP A1 A2 freq beta se p N).\n# eQTL data as BESD (binary eQTL summary data); pre-built BESD available from eQTLGen \u002F GTEx.\n\nsmr --bfile 1KG_EUR_chr6 \\\n    --gwas-summary gwas.ma \\\n    --beqtl-summary eqtl_chr6.besd \\\n    --out smr_result \\\n    --thread-num 4 \\\n    --peqtl-smr 5e-8 \\\n    --heidi-mtd 1\n# Output smr_result.smr: probe (gene) | top SNP | p_SMR | p_HEIDI | nsnp_HEIDI\n```\n\nInterpretation: significant `p_SMR` (Bonferroni-corrected across probes tested, typically \u003C 5e-8 \u002F N_probes) AND non-rejection by HEIDI (`p_HEIDI > 0.05`, per Zhu 2016) indicates pleiotropy \u002F shared causal; `p_HEIDI \u003C= 0.05` rejects shared-causal -> linkage. HEIDI p > 0.05 does NOT prove shared causality, only that data cannot reject it. Require `nsnp_HEIDI >= 10` for HEIDI reliability.\n\n## Allele Harmonisation (Critical Pre-Step)\n\nMismatched effect alleles silently invert signs of betas, collapsing PP.H4 into PP.H3. Required steps before coloc:\n\n1. Merge GWAS and eQTL summary stats by SNP ID (rsID or chr:pos:ref:alt).\n2. Mark SNP-pairs as `same` (A1\u002FA2 match) or `flip` (A1\u002FA2 swap); drop SNPs that match neither.\n3. For `flip` rows, negate the second dataset's beta (and swap A1\u002FA2).\n4. Drop palindromic SNPs (A\u002FT or C\u002FG) at MAF > 0.42; their strand cannot be inferred from coding alone (TwoSampleMR `harmonise_data` standard cutoff).\n5. Verify genome build alignment (hg19 vs hg38 must match; lift over if not).\n\nWorked harmonisation code and build-mismatch pitfalls: see usage-guide.md.\n\n## Anticipated Reviewer Pushback\n\n| Pushback | Standard response |\n|----------|-------------------|\n| \"Sensitivity to p12 prior?\" | `coloc::sensitivity()` reported; PP.H4 robust across 1e-7 to 1e-5 grid |\n| \"Why not coloc.susie? Multi-causal possible?\" | coloc.abf single-causal assumption stated; if PP.H3 dominant or GCTA-COJO identifies >= 2 independent signals, coloc.susie \u002F SuSiE-based run; reported |\n| \"LD reference matched?\" | In-sample preferred; if reference panel used, `estimate_s_rss(z, R, N)` lambda \u003C 0.05; `kriging_rss` diagnostic clean |\n| \"PP.H4 = 0.6 is colocalization?\" | No -- bands stated: 0.5-0.7 suggestive; >= 0.7 triangulation tier; >= 0.8 standard publication; >= 0.95 industry\u002Fclinical |\n| \"MHC region included?\" | chr6:25-35 Mb excluded; HLA-coloc (Butler-Laporte 2024) for classical-allele-level coloc |\n| \"Ancestry mismatch?\" | LD reference ancestry-matched to GWAS; for cross-ancestry use coloc_SuSiEx |\n| \"Sentinel SNP swap?\" | Re-centered window on each trait's lead, joint top, eQTL top; PP.H4 stable within 0.1 |\n\n## Common Errors\n\n| Error \u002F symptom | Cause | Solution |\n|-----------------|-------|----------|\n| `Error in coloc.abf: dataset must have N` | Forgot `N` in list, or `type` not set | Supply both; case-control also needs `s`; quant also needs `sdY` |\n| PP.H3 dominant despite obvious visual overlap | 2+ causal in moderate LD breaks single-causal assumption | Run coloc.susie or eCAVIAR |\n| `estimate_s_rss` lambda > 0.05 | LD reference does not match z-scores (ancestry \u002F sample \u002F build) | Use in-sample LD or ancestry-matched reference; do not proceed |\n| PP.H4 unstable across p12 sensitivity grid | Borderline evidence; default priors not justified | Report the p12 range; lower priors for trans-eQTL; do not over-claim |\n| coloc.susie returns NULL summary | No overlapping credible sets between traits | Genuine result (no shared signal) or both traits underpowered |\n| Per-SNP betas have opposite signs but same magnitude across traits | Effect-allele mismatch | Run harmonisation; flip betas where A1\u002FA2 swap; drop palindromic at high MAF |\n| SMR significant + HEIDI p \u003C= 0.05 | Linkage, not shared causal | Report as linkage; do not call colocalization |\n| moloc all-share PPA collapses to ~0 | Different sample sizes \u002F power across omics | Inspect per-omic effect sizes; consider HyPrColoc for cluster output |\n| HyPrColoc trait cluster fragments | Underlying biology is multi-causal | Switch to coloc.susie at each suspected cluster centre |\n| MHC PP.H4 close to 0 with strong visual signal | Long-range LD breaks single-causal | Use HLA-coloc or exclude MHC; never report standard coloc PP at MHC |\n\n## Tool Install Notes\n\n- **coloc**: CRAN. `install.packages('coloc')`. Bundles susieR dependency for >= 5.1.\n- **susieR**: CRAN. `install.packages('susieR')`. >= 0.12.35 for `estimate_s_rss` and `kriging_rss`.\n- **HyPrColoc**: GitHub only (never CRAN). `remotes::install_github('jrs95\u002Fhyprcoloc')`. Requires R >= 3.5.\n- **SMR**: Pre-compiled binary from cnsgenomics.com\u002Fsoftware\u002Fsmr. Linux\u002FMac\u002FWindows binaries; no R package.\n- **eCAVIAR**: Compile from GitHub fhormoz\u002Fcaviar; C++ source. CLI `eCAVIAR`. PAINTOR is the related multi-trait fine-mapping toolkit.\n- **PWCoCo**: GitHub jwr-git\u002Fpwcoco. Compiled C++ CLI; can also be invoked from R via wrapper scripts.\n- **SharePro_coloc**: GitHub only (no PyPI release). `git clone https:\u002F\u002Fgithub.com\u002Fzhwm\u002FSharePro_coloc` then `pip install -r requirements.txt`.\n- **moloc**: GitHub clagiamba\u002Fmoloc. R package; minimally updated since 2019, no CRAN release. R >= 3.5.\n\n## Reviewer-Grade Reporting Template\n\nFor each colocalization claim, the report should include:\n\n1. **Method and version** (e.g. coloc 5.2.3 coloc.abf, or coloc.susie with SuSiE L=10).\n2. **Window definition** (e.g. +\u002F- 500 kb around the GWAS lead rs12345 at chr6:30450000, hg38), and lead-SNP-swap sensitivity (PP.H4 at GWAS lead vs eQTL lead vs joint top).\n3. **Priors** p1, p2, p12 used; **sensitivity** plot from `coloc::sensitivity()` and the p12 range over which PP.H4 stays above threshold.\n4. **All five posteriors** PP.H0 through PP.H4 (not PP.H4 alone).\n5. **Threshold band** the result clears (>= 0.7 triangulation tier, >= 0.75 Open Targets screening, >= 0.80 published, >= 0.90 stringent, >= 0.95 clinical).\n6. **LD reference** ancestry, source (1000G phase 3 EUR \u002F in-sample \u002F UKBB), and lambda from `estimate_s_rss` if coloc.susie.\n7. **Reference QTL panel** version (e.g. GTEx v8 MASHR-EUR, PredictDB release 2022-01; eQTLGen 2019).\n8. **Conditional analysis** GCTA-COJO results if multi-causal; per-credible-set PP if coloc.susie.\n9. **Failure-mode caveats** explicitly addressed: MHC excluded, chr 8 inversion excluded, ancestry-matched LD, sdY\u002Fs correctly specified, palindromic SNPs handled.\n10. **Methods-section H0-H4 prose** describing what each hypothesis means (see usage-guide.md).\n\n## References\n\n- Giambartolomei C et al 2014 PLoS Genet 10:e1004383 (coloc.abf)\n- Wallace C 2020 PLoS Genet 16:e1008720 (prior elicitation; relaxing the single-causal-variant assumption; default-prior sensitivity)\n- Pullin JM & Wallace C 2025 PLoS Genet 21:e1011697 (variant-specific priors)\n- Wallace C 2021 PLoS Genet 17:e1009440 (coloc.susie; multiple causal variants)\n- Zhu Z et al 2016 Nat Genet 48:481 (SMR + HEIDI)\n- Hormozdiari F et al 2016 AJHG 99:1245 (eCAVIAR \u002F CLPP)\n- Giambartolomei C et al 2018 Bioinformatics 34:2538 (moloc)\n- Foley CN et al 2021 Nat Commun 12:764 (HyPrColoc)\n- Robinson JW et al 2022 bioRxiv 2022.08.08.503158 (PWCoCo)\n- Zhang W et al 2024 Bioinformatics 40:btae295 (SharePro_coloc)\n- Butler-Laporte G et al 2024 medRxiv 2024.11.05.24316783 (hlacoloc)\n- Mountjoy E et al 2021 Nat Genet 53:1527 (Open Targets Genetics colocalization pipeline)\n- Vosa U et al 2021 Nat Genet 53:1300 (eQTLGen, N ~ 31,684 whole blood)\n- GTEx Consortium 2020 Science 369:1318 (GTEx v8 multi-tissue eQTL)\n\n## Related Skills\n\n- causal-genomics\u002Fmendelian-randomization - Causal effect estimation from coloc-validated SNPs\n- causal-genomics\u002Ffine-mapping - SuSiE \u002F FINEMAP \u002F CAVIAR credible sets feeding coloc.susie; LD construction protocol cross-ref\n- causal-genomics\u002Fmediation-analysis - Downstream causal mediation given coloc shared causal variants\n- causal-genomics\u002Fpleiotropy-detection - Distinguishing horizontal pleiotropy from shared causality\n- causal-genomics\u002Ftranscriptome-wide-association - TWAS \u002F PrediXcan \u002F FOCUS gene-level prioritization complementary to coloc\n- causal-genomics\u002Fproteome-mr-drug-target - pQTL coloc + MR for drug-target prioritization\n- causal-genomics\u002Feffector-gene-prioritization - Locus-to-gene with coloc, ABC, V2G integration\n- population-genetics\u002Fassociation-testing - GWAS summary statistic generation and locus extraction\n- population-genetics\u002Flinkage-disequilibrium - LD reference panels for coloc.susie and PWCoCo\n- variant-calling\u002Fvariant-annotation - Functional annotation for variant-specific priors\n- variant-calling\u002Ffiltering-best-practices - Pre-coloc QC for summary stats\n- differential-expression\u002Fdeseq2-basics - Generating eQTL \u002F molecular QTL counts\n- single-cell\u002Fscatac-analysis - Per-cell-type chromatin context for coloc interpretation\n- workflows\u002Fgwas-pipeline - Upstream GWAS analysis producing coloc input\n- data-visualization\u002Fggplot2-fundamentals - Regional and LocusCompare plot construction\n","## Version Compatibility\n\nReference examples tested with: coloc 5.2.3+, susieR 0.12.35+, hyprcoloc 1.0+ (GitHub jrs95\u002Fhyprcoloc), SMR 1.3.1+ (CLI, cnsgenomics.com), eCAVIAR 2.2+ (compiled from caviar\u002FeCAVIAR repo), PWCoCo 1.0+ (jwr-git\u002Fpwcoco), moloc 0.1+ (clagiamba\u002Fmoloc), SharePro_coloc 7.0+ (zhwm\u002FSharePro_coloc), R >= 4.1.\n\nBefore using code patterns, verify installed versions match. If versions differ:\n- R: `packageVersion('coloc')`; check `?coloc.abf`, `?coloc.susie`, `?runsusie`\n- CLI: `smr --version`, `pwcoco --help`, `sharepro_coloc.py --help`\n\nIf code throws AttributeError, NULL list elements, or `Error in coloc.abf: dataset must have...`, introspect the installed package signature and adapt the example rather than retrying.\n\n# Colocalization Analysis\n\n**\"Test whether my GWAS signal and an eQTL share the same causal variant\"** -> Compute Bayesian posterior probabilities over five hypotheses (H0 neither, H1 trait-1-only, H2 trait-2-only, H3 distinct causal variants, H4 shared causal variant) to discriminate true causal overlap from LD-driven coincidence, then run sensitivity analysis over the p12 prior.\n\n- R (single-causal, fastest): `coloc::coloc.abf(dataset1, dataset2, p12=5e-6)` -> `coloc::sensitivity(res, 'H4 > 0.75')`\n- R (multi-causal, needs LD): `runsusie(d1)` -> `runsusie(d2)` -> `coloc.susie(s1, s2)` -> per-credible-set PP\n- R (many traits, single-causal cluster): `hyprcoloc::hyprcoloc(effect.est = betas_mat, effect.se = ses_mat, trait.names = ..., snp.id = ...)` -> trait clusters\n- CLI (causality vs linkage): `smr --bfile ref --gwas-summary g.ma --beqtl-summary eqtl.besd --out smr` -> SMR p + HEIDI p\n- CLI (allelic heterogeneity): eCAVIAR `eCAVIAR -l ld1 -l ld2 -z z1 -z z2 -o out -c 2` -> CLPP per SNP\n- CLI (conditional): PWCoCo conditions on each independent signal via GCTA-COJO then runs pairwise coloc.abf\n\n## Algorithmic Taxonomy\n\n| Method | Model | Inputs | Output | Strength | Fails when |\n|--------|-------|--------|--------|----------|------------|\n| coloc.abf (Giambartolomei 2014) | Single causal variant per locus; Bayesian ABF | beta+varbeta or p+MAF; sample sizes; type\u002Fs\u002FsdY | PP.H0-H4 | Fast (~1s\u002Flocus), no LD required, mature, widely-cited | 2+ causal variants in moderate LD -> PP.H3 inflates spuriously; assumes a single causal per trait |\n| coloc.susie (Wallace 2021) | Multi-causal via SuSiE; per-credible-set pairwise coloc | Summary stats + ancestry-matched LD matrix | PP.H4 per (CS1, CS2) pair | Handles allelic heterogeneity; principled CS framework | Sensitive to LD-mismatch; sample-size-LD mismatch -> spurious credible sets; needs in-sample or matched LD |\n| SMR + HEIDI (Zhu 2016) | Tests pleiotropy (one variant -> both traits) vs linkage (two variants in LD) | GWAS .ma; eQTL .besd; LD reference (plink bfile) | SMR p (significance) + HEIDI p (null = shared causal) | Distinguishes shared-causal from linkage at a top SNP; standard for eQTLGen \u002F GTEx integration | Fails to discriminate when LD between causal SNPs > 0.7 (HEIDI loses power); HEIDI requires >= 10 SNPs near top |\n| eCAVIAR \u002F CLPP (Hormozdiari 2016) | Fine-mapping-aware; computes Colocalization Posterior Probability per SNP | Z-scores; LD matrices per trait | CLPP per SNP; per-locus sum | Handles allelic heterogeneity natively; per-SNP resolution | Computationally heavy at -c > 3 causal variants; CLPP thresholds debated (0.01 vs 0.1) |\n| PWCoCo (Robinson 2022) | Pairwise conditional via GCTA-COJO conditioning | Summary stats + individual-level LD bfile | Per-conditional-signal coloc.abf results | Cleanly handles AH at top GWAS hit + secondary signals | Needs individual-level reference; sensitive to COJO collinearity threshold |\n| moloc (Giambartolomei 2018) | Multi-trait extension of coloc.abf (3-5 traits) | Per-trait summary stats | 15 (3-trait) \u002F 31 (4-trait) \u002F 63 (5-trait) hypothesis PPs | First principled multi-omic coloc | Hypothesis count = 2^k - 1 explodes; >= 6 traits computationally infeasible; minimally updated since 2019 |\n| HyPrColoc (Foley 2021) | Many-trait cluster-based; iterative branch-and-bound under single-causal | Beta + SE matrices SNPs x traits | Trait clusters sharing a causal variant | Scales to 50+ traits; identifies cluster substructure | Inherits single-causal assumption from coloc.abf; clusters can fragment under AH |\n| SharePro_coloc (Zhang 2024) | Variational effect-group joint model | Beta + SE; LD per ancestry | Effect-group level PP | Handles multiple causal signals jointly; faster than coloc.susie at scale | Newer (2024); benchmarks evolving; trickier installation |\n| Pullin & Wallace 2025 variant-specific priors | Function-aware p12 (e.g. up-weight coding\u002Fpromoter SNPs) | Same as coloc.abf + per-SNP prior weights | PP.H0-H4 with non-uniform prior | Improves discovery when functional annotation is informative | Annotation choice is a methodological lever; report sensitivity |\n\nMethodology evolves; verify the current Open Targets Genetics, eQTL Catalogue, and FinnGen colocalization pipelines before locking parameters. Open Targets uses coloc.abf at PP.H4 >= 0.75 with p12 = 1e-5; FinnGen uses coloc.susie at PP.H4 >= 0.8 with in-sample LD.\n\n## Decision Tree by Scenario\n\n| Scenario | Recommended method | Why |\n|----------|---------------------|-----|\n| GWAS + single-tissue eQTL, top GWAS variant looks single-signal | coloc.abf + sensitivity() | Fast, no LD needed, well-validated; single-causal assumption typically holds at clean loci |\n| GWAS + eQTL, conditional analysis shows 2+ independent signals | coloc.susie OR PWCoCo | Multi-causal handling; coloc.susie if summary-stats LD available, PWCoCo if individual-level reference accessible |\n| GWAS + multi-tissue eQTL (e.g. all 49 GTEx tissues) | coloc.abf per tissue + HyPrColoc across tissues | Per-tissue PP.H4 gives tissue-specific causality; HyPrColoc identifies tissue clusters sharing the variant |\n| GWAS + eQTL + sQTL + mQTL (3-5 omics) | moloc (k \u003C= 5) OR HyPrColoc | moloc gives explicit hypothesis posterior; HyPrColoc scales but loses hypothesis structure |\n| Many GWAS traits at one locus (pleiotropic hub) | HyPrColoc | Designed for many-trait clustering; coloc.abf pairwise scales as k^2 |\n| Top SNP has only modest GWAS p; is it the same causal as eQTL? | SMR + HEIDI | SMR tests pleiotropy\u002Fcausality; HEIDI rejects shared-causal -> linkage |\n| Want per-SNP credibility under allelic heterogeneity | eCAVIAR (CLPP) | Per-SNP CLPP integrates fine-mapping with coloc |\n| MHC \u002F HLA region (chr6:25-35 Mb) | HLA-coloc (Butler-Laporte 2024) OR exclude MHC | Long-range LD breaks single-causal assumption; standard PP.H4 not interpretable |\n| Trans-eQTL \u002F GWAS pair | coloc.abf with p12 lowered to 5e-6 or 1e-6 | Shared causality is biologically rare; default p12=1e-5 over-favours H4 |\n| Ancestry-mismatched GWAS vs eQTL | ancestry-matched coloc.susie OR coloc_SuSiEx | LD differs across ancestries; using EUR LD on AFR z-scores produces spurious credible sets |\n| Very small eQTL (N \u003C 200) | None reliably; flag locus underpowered | All methods report H0\u002FH1\u002FH2 dominance; report PP transparently and gather larger reference (eQTLGen N~31k, GTEx v8) |\n\n## Per-Method Failure Modes\n\n### coloc.abf -- PP.H3 inflation under multiple causal variants\n\n**Trigger:** Locus has 2+ independent causal signals in moderate LD (r2 ~ 0.3-0.6).\n\n**Mechanism:** The single-causal-variant assumption forces the model to allocate posterior mass to H3 (distinct causal variants) whenever the per-SNP Bayes factors for the two top SNPs do not align.\n\n**Symptom:** Visual co-localization in LocusZoom looks convincing, but `result$summary['PP.H3.abf']` dominates over PP.H4; sensitivity() shows PP.H4 stays low across the entire p12 grid.\n\n**Fix:** Run coloc.susie (or eCAVIAR or PWCoCo) to allow multiple causal variants. If coloc.susie returns multiple credible sets with one pair showing PP.H4 > 0.75, this is real allelic heterogeneity not failure.\n\n### coloc.susie -- LD reference mismatch\n\n**Trigger:** Z-scores from GWAS \u002F eQTL of one ancestry, LD matrix from 1000 Genomes EUR (or any non-matched reference).\n\n**Mechanism:** SuSiE assumes z-scores and the supplied LD are jointly consistent. Ancestry mismatch or sample-size mismatch produces a non-positive-definite implicit covariance; SuSiE responds by returning spurious credible sets that include LD-mismatched SNPs.\n\n**Symptom:** `susieR::estimate_s_rss(z, R, n)` returns lambda > 0.05; `susieR::kriging_rss` flags off-diagonal SNPs with extreme studentized residuals; credible sets are oddly large (50+ SNPs) or include SNPs distant in LD from the lead.\n\n**Fix:** Use in-sample LD when at all possible (per-cohort plink `--r square`). If reference must be external, match ancestry (1KG superpopulation) and superpopulation-stratify. Run `estimate_s_rss` and report lambda; if > 0.05, drop the locus or switch to coloc.abf.\n\n### coloc default p12 too liberal for trans-eQTL\n\n**Trigger:** Applying `p12 = 1e-5` (the default) to a trans-eQTL \u002F GWAS pair.\n\n**Mechanism:** The default p12 was calibrated for cis-eQTL where biological proximity makes shared causality reasonable. For trans-eQTL, prior probability of shared causality is much lower; uniform p12 over-favours H4.\n\n**Symptom:** PP.H4 > 0.8 reported, but sensitivity() reveals PP.H4 falls below 0.5 for p12 \u003C 1e-5; replication in independent data fails.\n\n**Fix:** Operational definition: \"trans\" = >5 Mb from TSS or different chromosome. Default p12=1e-5 over-favors H4 for trans (genome-rare biology). For trans: lower p12 to 5e-6 or 1e-6 AND raise PP.H4 threshold to >= 0.8 (compensate for higher FP risk). Cross-reference Vosa 2021 Nat Genet 53:1300 (eQTLGen trans) for empirical patterns.\n\n### MHC \u002F HLA + chr 8 inversion -- single-causal assumption breaks\n\n**Trigger:** Locus within chr6:25-35 Mb (extended MHC, hg38), or chr8:8.1-11.9 Mb (chr 8 inversion, hg38).\n\n**Mechanism:** The MHC contains classical HLA genes with extreme long-range LD (r2 > 0.5 over many Mb), multiple independent causal haplotypes, and structural variation. The chr 8p23.1 inversion similarly produces long-range LD across megabases of polymorphic inversion alleles. The single-causal-variant assumption is biologically wrong in both regions.\n\n**Symptom:** coloc.abf almost always returns PP.H3 or fragmented PP across H1\u002FH2\u002FH3\u002FH4 even when the underlying biology is well-established (e.g. HLA-DRB1 in autoimmune GWAS).\n\n**Fix (MHC):** Use HLA-imputed classical alleles via SNP2HLA \u002F HIBAG \u002F HLA-TAPAS, then HLA-coloc (Butler-Laporte 2024 medRxiv) -- NOT coloc on SNPs in MHC. OR exclude MHC from genome-wide coloc and report HLA association at the haplotype\u002Fallele level. **Fix (chr 8 inversion):** Exclude chr8:8.1-11.9 Mb or pre-condition on inversion genotype before coloc. Never report a single coloc PP.H4 in either region without this caveat.\n\n### Lead-SNP swap and window bias\n\n**Trigger:** The two traits have different lead SNPs at the same locus; analyst centres each window on the trait-specific lead.\n\n**Mechanism:** coloc PP is sensitive to the SNPs in the window; centring on different leads gives different per-SNP overlap and biases toward H3.\n\n**Symptom:** Re-centring the window on the GWAS lead vs the eQTL lead produces qualitatively different PP.H4.\n\n**Fix:** Use a SINGLE window (typically +\u002F- 500 kb or 1 Mb) centred on the joint top-variant (the SNP with the lowest min-p across both traits), or on the GWAS lead consistently. Report PP under multiple centring choices; flag the locus if PP swings > 0.2 across centrings.\n\n### Underpowered eQTL (N \u003C 200)\n\n**Trigger:** Small eQTL discovery (e.g. tissue-specific bulk study, N \u003C 200; per-cell-type sc-eQTL).\n\n**Mechanism:** With low N, varbeta is large; the eQTL's per-SNP Bayes factors are flat; the joint likelihood concentrates on H0 or H1 (GWAS-only).\n\n**Symptom:** PP.H0 or PP.H1 dominates; the eQTL panel shows visible signal but coloc cannot resolve causal vs noise.\n\n**Fix:** Use eQTLGen (N ~ 31k whole-blood) or GTEx v8 (N ~ 70-700 per tissue) where possible. For rare cell types, accept the limitation and report the locus as underpowered rather than claim absence of colocalization.\n\n| eQTL N | Coloc viability | Notes |\n|--------|-----------------|-------|\n| \u003C 200 | Underpowered | PP.H1 dominant; flag |\n| 200-500 | Cis only, modest | Single-tissue cis |\n| 500-1000 | Good for cis | Most GTEx v8 tissues |\n| >= 1000 | Well-powered | Trans accessible |\n| >= 10000 | Meta (eQTLGen) | Cross-tissue \u002F sc |\n\n### Reference QTL panel choice\n\nGTEx v8 (838 donors, 49 tissues, 2020) is the current PredictDB-supported standard. GTEx v10 (released 2024) has limited harmonisation and is not yet PredictDB-default. eQTLGen blood meta-eQTL (N ~ 31k) wins on sample size for blood cis-eQTL discovery, beating any single tissue on power. Always pin version in methods (e.g. \"GTEx v8 MASHR-EUR, PredictDB release 2022-01\").\n\n## PP.H4 Threshold Framework\n\n| Threshold | Use case | Source |\n|-----------|----------|--------|\n| 0.5 - 0.7 | Suggestive \u002F pilot \u002F hypothesis-generating | Giambartolomei 2014 original |\n| >= 0.7 | Triangulation tier for TWAS \u002F cis-MR \u002F effector-gene cross-evidence | Open Targets Genetics common practice; cross-reference downstream skills |\n| >= 0.75 | Open Targets Platform \u002F eQTL Catalogue \u002F FinnGen default screening threshold | Open Targets Genetics docs; Mountjoy 2021 Nat Genet 53:1527 |\n| >= 0.80 | Most published colocalizations \u002F standard publication tier | Wallace 2020 PLoS Genet 16:e1008720 |\n| >= 0.90 | Stringent clinical \u002F therapeutic-target prioritization | Reserved for high-confidence claims |\n| >= 0.95 | Industry \u002F regulatory drug-target submission grade | Internal pharma default |\n| PP.H3 >= 0.80 | Confident distinct causal variants (negative coloc result) | Standard |\n| PP.H4 \u002F (PP.H3 + PP.H4) >= 0.9 | Conditional probability framing (some pipelines) | Foley 2021 |\n\n**Operational rule:** Three operational tiers map onto the most common downstream uses: (a) **>= 0.7** when PP.H4 is one of several lines of triangulating evidence (TWAS + coloc, cis-MR + coloc, effector-gene multi-evidence) -- this is the threshold downstream skills (causal-genomics\u002Ftranscriptome-wide-association, causal-genomics\u002Fmendelian-randomization cis-MR, causal-genomics\u002Feffector-gene-prioritization, causal-genomics\u002Fproteome-mr-drug-target) require; (b) **>= 0.8** for standard peer-reviewed publication as a stand-alone coloc claim (Wallace 2020); (c) **>= 0.95** for industry \u002F clinical drug-target submission. Open Targets and FinnGen pipelines screen at >= 0.75 but downstream publication-grade coloc claims should clear >= 0.8 and triangulation claims >= 0.7. ALWAYS report PP.H3 alongside PP.H4 -- a locus with PP.H4 = 0.6, PP.H3 = 0.3 is qualitatively different from PP.H4 = 0.6, PP.H3 = 0.05 (the former is real ambiguity over single vs distinct causal; the latter is underpowered evidence). Run `coloc::sensitivity()` and report the p12 range over which PP.H4 stays above the threshold.\n\n## Default Priors and the p12 Sensitivity Question\n\n| Prior | Default | Interpretation | When to change |\n|-------|---------|----------------|----------------|\n| p1 | 1e-4 | Prob a random SNP is associated with trait 1 | Rarely changed |\n| p2 | 1e-4 | Prob a random SNP is associated with trait 2 | Rarely changed |\n| p12 | 1e-5 | Prob a random SNP is associated with both traits | Lower (5e-6 or 1e-6) for trans-eQTL or unrelated trait pairs; raise (5e-5) only with strong prior, e.g. molecular QTL in the same tissue as causal cell type |\n\nThe p12\u002Fp1 ratio (= 0.1 under defaults) is the prior odds of colocalization given a trait-1 association. Wallace 2020 (PLoS Genet 16:e1008720) showed default p12 = 1e-5 is too liberal for many real-world settings and recommended sensitivity analysis as standard practice. Pullin & Wallace 2025 (PLoS Genet 21:e1011697) extended this with variant-specific priors weighted by functional annotation.\n\n### p12 Sensitivity Grid\n\n| p12 grid point | Use case | Reporting rule |\n|----------------|----------|-----------------|\n| 1e-4 | Suggestive only \u002F EUR cis-eQTL relaxed | PP.H4 here cannot support a publication claim |\n| 1e-5 | Default for most cis-eQTL \u003C-> GWAS pairs | Standard |\n| 5e-6 | Conservative cis; default for trans-eQTL coloc | Recommended publication baseline |\n| 1e-6 | Very conservative; trans coloc with weak prior | Required for cross-trait genome-rare coloc |\n\n**Operational rule:** Require PP.H4 to remain above threshold across at least 3 adjacent grid points; report the lowest p12 at which PP.H4 >= 0.75. Use `coloc::sensitivity(result, rule = 'H4 > 0.75')` for the diagnostic plot.\n\nRequired reporting: PP.H4 at default priors + p12 range over which PP.H4 stays above threshold.\n\n## eCAVIAR CLPP Threshold Framework\n\nCLPP (Colocalization Posterior Probability) is the per-SNP product of the two per-trait fine-mapping posteriors. Threshold conventions:\n\n- Hormozdiari 2016 AJHG 99:1245 used CLPP >= 0.01 (validated against null simulations).\n- 2024 GTEx \u002F Open Targets pipelines use CLPP >= 0.05.\n- High-confidence claims require CLPP >= 0.1.\n- Report both sum-CLPP across the credible set AND max-CLPP at any single SNP -- the two answer different questions (locus-level vs lead-SNP-level confidence).\n\n```bash\neCAVIAR -l ld_gwas.ld -l ld_eqtl.ld \\\n        -z gwas.z -z eqtl.z \\\n        -o coloc_out -c 2     # -c = max independent causal variants per trait\n# Output: per-SNP CLPP in coloc_out_col file; report sum and max\n```\n\n## LD Matrix Construction for coloc.susie\n\n**Requirements:**\n\n- Signed Pearson r (not r2). coloc.susie expects directional LD; squared LD silently inverts effect-direction inference.\n- Ancestry-matched to GWAS \u002F eQTL ancestry. EUR LD on AFR z-scores produces spurious credible sets.\n- SNP-order-aligned to the beta vector and named to match (row\u002Fcolumn names = SNP IDs).\n- Positive semi-definite. Numerical-noise negative eigenvalues must be repaired.\n- Effective N sample-size-matched to the trait being fine-mapped (provide via `runsusie(..., n = N)`).\n\n```bash\n# plink2 phased r (signed Pearson); square matrix output\nplink2 --pfile 1KG_EUR \\\n    --extract snps.txt --chr 6 --from-bp X --to-bp Y \\\n    --r-phased square --out locus_ld\n```\n\n```r\n# Alternative: in-sample LD from BED via bigsnpr\nR \u003C- bigsnpr::snp_cor(snp_obj$genotypes, ind.col = locus_snps)\n# PSD repair if negative eigenvalues from numerical noise\nR \u003C- as.matrix(Matrix::nearPD(R)$mat)\ndimnames(R) \u003C- list(snp_ids, snp_ids)\n```\n\n**Critical:** Row and column order of R MUST match SNP order in the beta vector -- silent failure otherwise. The SuSiE objective stays finite under mis-ordering and returns nonsense credible sets. Verify with `stopifnot(rownames(R) == names(beta))` before `runsusie`. Cross-reference causal-genomics\u002Ffine-mapping for the full LD diagnostic block (`estimate_s_rss` lambda \u003C 0.05, `kriging_rss` outlier inspection).\n\n## SMR vs coloc Reconciliation\n\nSMR (Zhu 2016) and coloc test related but non-identical questions:\n\n- **SMR** tests pleiotropy vs linkage: does the top eQTL SNP show a GWAS effect explainable by its eQTL effect (pleiotropic \u002F causal) or does the GWAS effect come from a different SNP in LD (linkage)?\n- **coloc** tests shared vs distinct causal variants over an entire window of SNPs.\n- **HEIDI** is SMR's heterogeneity test; null hypothesis is single shared causal SNP. Zhu 2016 Nat Genet 48:481 specifies **HEIDI p > 0.05** (NOT 0.01) as non-rejection of single shared causal. HEIDI p > 0.05 does NOT prove shared causality -- only that data cannot reject it; pair with SMR p Bonferroni-corrected across probes. When LD between causal SNPs > 0.7, HEIDI loses power same as coloc.\n\nWhen LD between two true causal SNPs is high (r2 > 0.7), both SMR\u002FHEIDI and coloc.abf lose discriminatory power: SMR cannot pick which of the LD-tied SNPs is causal, and coloc.abf cannot reject H4 even if biology is two-distinct-causal. coloc.susie + ancestry-matched LD is the modern resolution.\n\n**Operational rule:** SMR + HEIDI is appropriate when the question is \"does this eQTL gene mediate the GWAS effect at all?\" coloc is appropriate when the question is \"do the two traits share a causal variant in this window?\" Run both; agreement (significant SMR + non-rejected HEIDI + PP.H4 >= 0.75) is high-confidence; disagreement requires inspection (often the multi-causal \u002F LD scenario above).\n\n## moloc Multi-Omic Framework (3-5 Traits)\n\nFor k traits, moloc tests `2^k - 1` hypotheses. 3 traits -> 15 hypotheses (H_a, H_b, H_c, H_ab, H_ac, H_bc, H_abc, plus \"none of the above\"); 4 traits -> 31; 5 traits -> 63. The hypothesis H_{all-share} (all k share a single causal variant) is the multi-omic analog of PP.H4.\n\n```r\n# moloc 3-trait example; install via remotes::install_github('clagiamba\u002Fmoloc')\nlibrary(moloc)\n# Input: list of k dataframes with BETA, SE, N, MAF per SNP and shared SNP IDs\nresult_moloc \u003C- moloc_test(listData=list(gwas=gwas_df, eqtl=eqtl_df, sqtl=sqtl_df),\n                            prior_var=c(0.01, 0.1, 0.5), priors=c(1e-4, 1e-6, 1e-7))\n# PPA: posterior over all 15 hypotheses (3-trait case)\n# Key column: PPA.abc (all-three-share)\n```\n\nmoloc is computationally tractable up to k = 5 but explodes beyond; use HyPrColoc for k >= 6.\n\n## HyPrColoc Cluster-Based Coloc (Many Traits)\n\nHyPrColoc (Foley 2021) extends single-causal coloc to many traits by clustering traits that share a causal variant. Output: per-cluster posterior + per-trait cluster assignment.\n\n```r\nlibrary(hyprcoloc)\n# Inputs: SNPs-by-traits matrices of betas and standard errors\n# Rows = SNPs (must be shared across all traits); Columns = traits\nres \u003C- hyprcoloc(effect.est=betas, effect.se=ses,\n                  trait.names=colnames(betas), snp.id=rownames(betas),\n                  reg.thresh=0.7,     # regional probability of coloc threshold\n                  align.thresh=0.7)   # alignment threshold for traits within a cluster\nres$results  # cluster assignment per trait + posterior\n```\n\nHyPrColoc inherits the single-causal-per-cluster assumption from coloc.abf; clusters can fragment if the true biology is allelic heterogeneity.\n\n## PWCoCo (Conditional Pairwise Coloc)\n\nPWCoCo (Robinson 2022) wraps GCTA-COJO conditional analysis around coloc.abf. For a locus with `k1` independent trait-1 signals and `k2` independent trait-2 signals, PWCoCo runs `k1 * k2` pairwise coloc.abf tests after conditioning each summary statistic on the other independent signals.\n\n**When to use:** When GCTA-COJO has identified >= 2 independent signals in at least one trait and individual-level reference genotypes are available. Particularly suited to bulk eQTL with secondary cis signals.\n\n**Inputs:** Per-trait summary stats (SNP, A1, A2, freq, beta, se, p, N) + plink bfile reference. **Output:** One coloc.abf result per (conditional signal 1, conditional signal 2) pair. Interpret each row as an independent single-signal coloc.\n\n**Caveats:** PWCoCo requires individual-level reference (plink bfile); cannot run on summary stats alone. Collinearity threshold in COJO (default `--cojo-collinear 0.9`) controls how aggressively independent signals are split; lower values fragment, higher values merge. Worked CLI recipe in usage-guide.md.\n\n## Standard coloc.abf Pipeline\n\n**Goal:** Test whether a single GWAS lead variant shares a causal variant with an eQTL gene's top signal at a defined locus.\n\n**Approach:** Extract a 1 Mb window centred on the GWAS lead; harmonise alleles between datasets; format coloc input lists with `type` ('quant' or 'cc'), sample size `N`, and either `sdY` (quant) or `s` (cc); run coloc.abf; run sensitivity() over the p12 grid.\n\n```r\nlibrary(coloc)\n\n# Inputs: harmonised gwas_df and eqtl_df with SNP, BETA, SE, MAF, N, POS columns\n# Both must share the same SNP set and allele coding (verify with harmonise step)\n\ngwas_input \u003C- list(\n    beta=gwas_df$BETA, varbeta=gwas_df$SE^2,\n    snp=gwas_df$SNP, position=gwas_df$POS,\n    type='cc',           # case-control GWAS\n    s=0.30,              # case fraction\n    N=50000)\n\neqtl_input \u003C- list(\n    beta=eqtl_df$BETA, varbeta=eqtl_df$SE^2,\n    snp=eqtl_df$SNP, position=eqtl_df$POS,\n    type='quant',        # quantitative eQTL\n    sdY=1,               # SD(expression); 1 if standardised, else estimate from MAF+varbeta\n    N=500)\n\nres \u003C- coloc.abf(dataset1=gwas_input, dataset2=eqtl_input,\n                  p1=1e-4, p2=1e-4, p12=5e-6)   # conservative p12\n\nprint(res$summary)\nsens \u003C- coloc::sensitivity(res, rule='H4 > 0.75')   # generates plot + table\n```\n\n`sdY` semantics: when omitted, coloc estimates from `MAF` and `varbeta`; supplying `sdY=1` ASSUMES the trait is already standardised (eQTL with inverse-normal-transformed expression). Mismatch produces silently wrong Bayes factors -- the most common silent failure.\n\n- For quantitative trait: leave `sdY=NULL` to estimate via `coloc:::sdY.est(varbeta, MAF, N)`. If CV of estimated sdY across SNPs > 0.5, varbeta\u002FMAF are inconsistent -- coloc will silently miscalibrate Bayes factors.\n- For inverse-normal-transformed expression: use `sdY = 1` (already standardized).\n- Mismatch produces silently wrong PP -- most common silent failure.\n\n`s` parameter for case-control (`type='cc'`):\n\n- `s` = N_cases \u002F N_total (NOT cases-per-control; NOT 0.5 default).\n- For population-cohort case-control: `s` ~ disease prevalence in the cohort (~0.005 for rare disease).\n- Wrong `s` does not error -- silently biases PP at extreme MAF.\n\n## coloc.susie Multi-Causal Pipeline\n\n**Goal:** Test colocalization at a locus with multiple independent signals (allelic heterogeneity).\n\n**Approach:** Run SuSiE on each trait's summary statistics with ancestry-matched LD; verify LD-z-score consistency; coloc-test each pair of credible sets.\n\n```r\nlibrary(coloc); library(susieR)\n\n# Diagnostic: z-score vs LD consistency MUST be checked\nz_gwas \u003C- gwas_df$BETA \u002F gwas_df$SE\nlam_gwas \u003C- susieR::estimate_s_rss(z=z_gwas, R=ld_matrix, n=gwas_n)\nif (lam_gwas > 0.05) stop('LD reference mismatched to z-scores; lambda=', lam_gwas)\n\ns1 \u003C- runsusie(list(beta=gwas_df$BETA, varbeta=gwas_df$SE^2,\n                    snp=gwas_df$SNP, position=gwas_df$POS,\n                    type='cc', s=0.3, N=50000, LD=ld_matrix), L=10)\ns2 \u003C- runsusie(list(beta=eqtl_df$BETA, varbeta=eqtl_df$SE^2,\n                    snp=eqtl_df$SNP, position=eqtl_df$POS,\n                    type='quant', sdY=1, N=500, LD=ld_matrix), L=10)\n\nres_susie \u003C- coloc.susie(s1, s2)   # NULL if no overlapping CS\n# res_susie$summary rows: each (hit1, hit2) pair of credible sets\n```\n\nLD matrix MUST be in the same SNP order as the beta vector; mis-ordering silently produces nonsense.\n\n## SMR + HEIDI Pipeline\n\n```bash\n# SMR is a command-line tool. Pre-format GWAS into .ma (SNP A1 A2 freq beta se p N).\n# eQTL data as BESD (binary eQTL summary data); pre-built BESD available from eQTLGen \u002F GTEx.\n\nsmr --bfile 1KG_EUR_chr6 \\\n    --gwas-summary gwas.ma \\\n    --beqtl-summary eqtl_chr6.besd \\\n    --out smr_result \\\n    --thread-num 4 \\\n    --peqtl-smr 5e-8 \\\n    --heidi-mtd 1\n# Output smr_result.smr: probe (gene) | top SNP | p_SMR | p_HEIDI | nsnp_HEIDI\n```\n\nInterpretation: significant `p_SMR` (Bonferroni-corrected across probes tested, typically \u003C 5e-8 \u002F N_probes) AND non-rejection by HEIDI (`p_HEIDI > 0.05`, per Zhu 2016) indicates pleiotropy \u002F shared causal; `p_HEIDI \u003C= 0.05` rejects shared-causal -> linkage. HEIDI p > 0.05 does NOT prove shared causality, only that data cannot reject it. Require `nsnp_HEIDI >= 10` for HEIDI reliability.\n\n## Allele Harmonisation (Critical Pre-Step)\n\nMismatched effect alleles silently invert signs of betas, collapsing PP.H4 into PP.H3. Required steps before coloc:\n\n1. Merge GWAS and eQTL summary stats by SNP ID (rsID or chr:pos:ref:alt).\n2. Mark SNP-pairs as `same` (A1\u002FA2 match) or `flip` (A1\u002FA2 swap); drop SNPs that match neither.\n3. For `flip` rows, negate the second dataset's beta (and swap A1\u002FA2).\n4. Drop palindromic SNPs (A\u002FT or C\u002FG) at MAF > 0.42; their strand cannot be inferred from coding alone (TwoSampleMR `harmonise_data` standard cutoff).\n5. Verify genome build alignment (hg19 vs hg38 must match; lift over if not).\n\nWorked harmonisation code and build-mismatch pitfalls: see usage-guide.md.\n\n## Anticipated Reviewer Pushback\n\n| Pushback | Standard response |\n|----------|-------------------|\n| \"Sensitivity to p12 prior?\" | `coloc::sensitivity()` reported; PP.H4 robust across 1e-7 to 1e-5 grid |\n| \"Why not coloc.susie? Multi-causal possible?\" | coloc.abf single-causal assumption stated; if PP.H3 dominant or GCTA-COJO identifies >= 2 independent signals, coloc.susie \u002F SuSiE-based run; reported |\n| \"LD reference matched?\" | In-sample preferred; if reference panel used, `estimate_s_rss(z, R, N)` lambda \u003C 0.05; `kriging_rss` diagnostic clean |\n| \"PP.H4 = 0.6 is colocalization?\" | No -- bands stated: 0.5-0.7 suggestive; >= 0.7 triangulation tier; >= 0.8 standard publication; >= 0.95 industry\u002Fclinical |\n| \"MHC region included?\" | chr6:25-35 Mb excluded; HLA-coloc (Butler-Laporte 2024) for classical-allele-level coloc |\n| \"Ancestry mismatch?\" | LD reference ancestry-matched to GWAS; for cross-ancestry use coloc_SuSiEx |\n| \"Sentinel SNP swap?\" | Re-centered window on each trait's lead, joint top, eQTL top; PP.H4 stable within 0.1 |\n\n## Common Errors\n\n| Error \u002F symptom | Cause | Solution |\n|-----------------|-------|----------|\n| `Error in coloc.abf: dataset must have N` | Forgot `N` in list, or `type` not set | Supply both; case-control also needs `s`; quant also needs `sdY` |\n| PP.H3 dominant despite obvious visual overlap | 2+ causal in moderate LD breaks single-causal assumption | Run coloc.susie or eCAVIAR |\n| `estimate_s_rss` lambda > 0.05 | LD reference does not match z-scores (ancestry \u002F sample \u002F build) | Use in-sample LD or ancestry-matched reference; do not proceed |\n| PP.H4 unstable across p12 sensitivity grid | Borderline evidence; default priors not justified | Report the p12 range; lower priors for trans-eQTL; do not over-claim |\n| coloc.susie returns NULL summary | No overlapping credible sets between traits | Genuine result (no shared signal) or both traits underpowered |\n| Per-SNP betas have opposite signs but same magnitude across traits | Effect-allele mismatch | Run harmonisation; flip betas where A1\u002FA2 swap; drop palindromic at high MAF |\n| SMR significant + HEIDI p \u003C= 0.05 | Linkage, not shared causal | Report as linkage; do not call colocalization |\n| moloc all-share PPA collapses to ~0 | Different sample sizes \u002F power across omics | Inspect per-omic effect sizes; consider HyPrColoc for cluster output |\n| HyPrColoc trait cluster fragments | Underlying biology is multi-causal | Switch to coloc.susie at each suspected cluster centre |\n| MHC PP.H4 close to 0 with strong visual signal | Long-range LD breaks single-causal | Use HLA-coloc or exclude MHC; never report standard coloc PP at MHC |\n\n## Tool Install Notes\n\n- **coloc**: CRAN. `install.packages('coloc')`. Bundles susieR dependency for >= 5.1.\n- **susieR**: CRAN. `install.packages('susieR')`. >= 0.12.35 for `estimate_s_rss` and `kriging_rss`.\n- **HyPrColoc**: GitHub only (never CRAN). `remotes::install_github('jrs95\u002Fhyprcoloc')`. Requires R >= 3.5.\n- **SMR**: Pre-compiled binary from cnsgenomics.com\u002Fsoftware\u002Fsmr. Linux\u002FMac\u002FWindows binaries; no R package.\n- **eCAVIAR**: Compile from GitHub fhormoz\u002Fcaviar; C++ source. CLI `eCAVIAR`. PAINTOR is the related multi-trait fine-mapping toolkit.\n- **PWCoCo**: GitHub jwr-git\u002Fpwcoco. Compiled C++ CLI; can also be invoked from R via wrapper scripts.\n- **SharePro_coloc**: GitHub only (no PyPI release). `git clone https:\u002F\u002Fgithub.com\u002Fzhwm\u002FSharePro_coloc` then `pip install -r requirements.txt`.\n- **moloc**: GitHub clagiamba\u002Fmoloc. R package; minimally updated since 2019, no CRAN release. R >= 3.5.\n\n## Reviewer-Grade Reporting Template\n\nFor each colocalization claim, the report should include:\n\n1. **Method and version** (e.g. coloc 5.2.3 coloc.abf, or coloc.susie with SuSiE L=10).\n2. **Window definition** (e.g. +\u002F- 500 kb around the GWAS lead rs12345 at chr6:30450000, hg38), and lead-SNP-swap sensitivity (PP.H4 at GWAS lead vs eQTL lead vs joint top).\n3. **Priors** p1, p2, p12 used; **sensitivity** plot from `coloc::sensitivity()` and the p12 range over which PP.H4 stays above threshold.\n4. **All five posteriors** PP.H0 through PP.H4 (not PP.H4 alone).\n5. **Threshold band** the result clears (>= 0.7 triangulation tier, >= 0.75 Open Targets screening, >= 0.80 published, >= 0.90 stringent, >= 0.95 clinical).\n6. **LD reference** ancestry, source (1000G phase 3 EUR \u002F in-sample \u002F UKBB), and lambda from `estimate_s_rss` if coloc.susie.\n7. **Reference QTL panel** version (e.g. GTEx v8 MASHR-EUR, PredictDB release 2022-01; eQTLGen 2019).\n8. **Conditional analysis** GCTA-COJO results if multi-causal; per-credible-set PP if coloc.susie.\n9. **Failure-mode caveats** explicitly addressed: MHC excluded, chr 8 inversion excluded, ancestry-matched LD, sdY\u002Fs correctly specified, palindromic SNPs handled.\n10. **Methods-section H0-H4 prose** describing what each hypothesis means (see usage-guide.md).\n\n## References\n\n- Giambartolomei C et al 2014 PLoS Genet 10:e1004383 (coloc.abf)\n- Wallace C 2020 PLoS Genet 16:e1008720 (prior elicitation; relaxing the single-causal-variant assumption; default-prior sensitivity)\n- Pullin JM & Wallace C 2025 PLoS Genet 21:e1011697 (variant-specific priors)\n- Wallace C 2021 PLoS Genet 17:e1009440 (coloc.susie; multiple causal variants)\n- Zhu Z et al 2016 Nat Genet 48:481 (SMR + HEIDI)\n- Hormozdiari F et al 2016 AJHG 99:1245 (eCAVIAR \u002F CLPP)\n- Giambartolomei C et al 2018 Bioinformatics 34:2538 (moloc)\n- Foley CN et al 2021 Nat Commun 12:764 (HyPrColoc)\n- Robinson JW et al 2022 bioRxiv 2022.08.08.503158 (PWCoCo)\n- Zhang W et al 2024 Bioinformatics 40:btae295 (SharePro_coloc)\n- Butler-Laporte G et al 2024 medRxiv 2024.11.05.24316783 (hlacoloc)\n- Mountjoy E et al 2021 Nat Genet 53:1527 (Open Targets Genetics colocalization pipeline)\n- Vosa U et al 2021 Nat Genet 53:1300 (eQTLGen, N ~ 31,684 whole blood)\n- GTEx Consortium 2020 Science 369:1318 (GTEx v8 multi-tissue eQTL)\n\n## Related Skills\n\n- causal-genomics\u002Fmendelian-randomization - Causal effect estimation from coloc-validated SNPs\n- causal-genomics\u002Ffine-mapping - SuSiE \u002F FINEMAP \u002F CAVIAR credible sets feeding coloc.susie; LD construction protocol cross-ref\n- causal-genomics\u002Fmediation-analysis - Downstream causal mediation given coloc shared causal variants\n- causal-genomics\u002Fpleiotropy-detection - Distinguishing horizontal pleiotropy from shared causality\n- causal-genomics\u002Ftranscriptome-wide-association - TWAS \u002F PrediXcan \u002F FOCUS gene-level prioritization complementary to coloc\n- causal-genomics\u002Fproteome-mr-drug-target - pQTL coloc + MR for drug-target prioritization\n- causal-genomics\u002Feffector-gene-prioritization - Locus-to-gene with coloc, ABC, V2G integration\n- population-genetics\u002Fassociation-testing - GWAS summary statistic generation and locus extraction\n- population-genetics\u002Flinkage-disequilibrium - LD reference panels for coloc.susie and PWCoCo\n- variant-calling\u002Fvariant-annotation - Functional annotation for variant-specific priors\n- variant-calling\u002Ffiltering-best-practices - Pre-coloc QC for summary stats\n- differential-expression\u002Fdeseq2-basics - Generating eQTL \u002F molecular QTL counts\n- single-cell\u002Fscatac-analysis - Per-cell-type chromatin context for coloc interpretation\n- workflows\u002Fgwas-pipeline - Upstream GWAS analysis producing coloc input\n- data-visualization\u002Fggplot2-fundamentals - Regional and LocusCompare plot construction\n",{"name":5,"source":24,"license":15,"tool_type":25,"description":7,"imported_at":26,"source_path":27,"primary_tool":28,"source_repository":29},"https:\u002F\u002Fgithub.com\u002FGPTomics\u002FbioSkills","r","2026-09-20","causal-genomics\u002Fcolocalization-analysis\u002FSKILL.md","coloc","GPTomics\u002FbioSkills","main","2d1750717747097b602acf30bd09a7cbd4b4c6ea","awesome_skills\u002Fbiology\u002Fbio-causal-genomics-colocalization-analysis","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous","2026-11-09 11:45:36",{"source":8,"skillName":5,"commands":37,"prompt":47,"zipAvailable":48},[38,41,44],{"tool":39,"command":40},"npx","npx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-causal-genomics-colocalization-analysis",{"tool":42,"command":43},"bunx","bunx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-causal-genomics-colocalization-analysis",{"tool":45,"command":46},"pnpm","pnpm dlx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-causal-genomics-colocalization-analysis","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-causal-genomics-colocalization-analysis\u002FSKILL.md",true,[50,56,60,64,68,72],{"path":51,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":54,"sourceHtmlUrl":55},"examples\u002Fcoloc_abf_pipeline.R","OTHER","其他",3557,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-causal-genomics-colocalization-analysis\u002Fexamples\u002Fcoloc_abf_pipeline.R",{"path":57,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":58,"sourceHtmlUrl":59},"examples\u002Fcoloc_analysis.R",2251,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-causal-genomics-colocalization-analysis\u002Fexamples\u002Fcoloc_analysis.R",{"path":61,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":62,"sourceHtmlUrl":63},"examples\u002Fcoloc_susie_multicausal.R",3349,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-causal-genomics-colocalization-analysis\u002Fexamples\u002Fcoloc_susie_multicausal.R",{"path":65,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":66,"sourceHtmlUrl":67},"examples\u002Fcoloc_susie.R",2513,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-causal-genomics-colocalization-analysis\u002Fexamples\u002Fcoloc_susie.R",{"path":69,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":70,"sourceHtmlUrl":71},"examples\u002Fregional_plots.R",2570,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-causal-genomics-colocalization-analysis\u002Fexamples\u002Fregional_plots.R",{"path":73,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":76,"sourceHtmlUrl":77},"usage-guide.md","REFERENCE","参考文档",12240,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-causal-genomics-colocalization-analysis\u002Fusage-guide.md",[79,87,94,101,108,115],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":86},"01M7FFFZPC2025JQQHPHDX154J","dei-assessment","Assess diversity, equity, and inclusion with metrics. TRIGGERS - Use when user needs help with dei-assessment related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fdei-assessment\u002FSKILL.md",[],[],"2026-11-16 10:05:34",{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":86},"01M7FFFWN8H4WA7A6Y398QKB6J","dei-action-plan","Create DEI action plans with goals and initiatives. TRIGGERS - Use when user needs help with dei-action-plan related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fdei-action-plan\u002FSKILL.md",[],[],{"skillNo":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":86},"01M7FFFSHTM0QZRVZ2NRJTJ0PY","culture-fit-assessment","Design culture add assessment processes. TRIGGERS - Use when user needs help with culture-fit-assessment related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fculture-fit-assessment\u002FSKILL.md",[],[],{"skillNo":102,"name":103,"nameZh":6,"description":104,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":105,"categories":106,"keywords":107,"publishedAt":86},"01M7FFFMA12RKEQA38KHJSXXPS","cowork-to-code-bridge","Use an already-installed, independently verified cowork-to-code bridge to run narrowly approved actions on the user's own macOS, Linux, or WSL2 machine through a local file queue.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcowork-to-code-bridge\u002FSKILL.md",[],[],{"skillNo":109,"name":110,"nameZh":6,"description":111,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":112,"categories":113,"keywords":114,"publishedAt":86},"01M7FFFH1F6M8YRGW5V487GH1K","counter-offer-response","Draft counter-offer responses for retention. TRIGGERS - Use when user needs help with counter-offer-response related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcounter-offer-response\u002FSKILL.md",[],[],{"skillNo":116,"name":117,"nameZh":6,"description":118,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":119,"categories":120,"keywords":121,"publishedAt":86},"01M7FFFDGEHV8Y7J9N40HZXW52","continuous-feedback-system","Design continuous feedback systems. TRIGGERS - Use when user needs help with continuous-feedback-system related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcontinuous-feedback-system\u002FSKILL.md",[],[]]