← Về thư mục
📄 / / profiles / r-and-d / raw_evidence / OpenAI4S / skills / bioskills / bio-causal-genomics-colocalization-analysis / references / usage-guide.md

Colocalization Analysis - Usage Guide

Overview

Colocalization tests whether two or more association signals at a genomic locus are driven by the same causal variant. It is the standard tool for integrating GWAS hits with molecular QTLs (eQTL, sQTL, pQTL, mQTL), prioritising candidate genes, and distinguishing shared causality from coincidental overlap due to linkage disequilibrium. Methods range from the fast single-causal coloc.abf (Giambartolomei 2014) to the multi-causal coloc.susie (Wallace 2021), the multi-trait HyPrColoc (Foley 2021), and the pleiotropy-vs-linkage SMR/HEIDI (Zhu 2016).

The agent will pick the appropriate method based on the experimental scenario: number of traits, expected number of causal variants per locus, availability of LD reference, ancestry composition, and whether the question is causal-mediation (SMR) or shared-variant (coloc). It will harmonise allele coding across summary statistics, format inputs correctly (type, sdY, s, N), run colocalization, and ALWAYS report sensitivity over the p12 prior alongside the headline PP.H4.

Prerequisites

install.packages(c('coloc', 'susieR', 'ggplot2', 'patchwork', 'data.table'))
install.packages('remotes')
remotes::install_github('jrs95/hyprcoloc')          # GitHub-only, never CRAN

# Optional, for multi-omic
remotes::install_github('clagiamba/moloc')           # 3-5 traits

# CLI tools (outside R)
# SMR: download binary from https://yanglab.westlake.edu.cn/software/smr/
# eCAVIAR: compile from https://github.com/fhormoz/caviar
# PWCoCo: compile from https://github.com/jwr-git/pwcoco
# SharePro_coloc: git clone https://github.com/zhwm/SharePro_coloc then pip install -r requirements.txt

# LD reference panel (e.g. 1000 Genomes phase 3) via plink2
# plink2 --pfile 1KG_EUR_chr6 --chr 6 --from-bp 30000000 --to-bp 31000000 --r-phased square --out ld

Quick Start

Tell the AI agent what is needed: - "Test if my GWAS lead SNP at chr6:30500000 colocalizes with the IL2 eQTL in whole blood" - "Run coloc.susie at this locus; I have two independent GWAS signals after conditional analysis" - "Check colocalization between my GWAS and all 49 GTEx tissues using HyPrColoc" - "I have a GWAS + eQTL + sQTL + mQTL at the same locus; run moloc" - "Harmonise these summary stats and run coloc with sensitivity over p12" - "Run SMR + HEIDI between my GWAS and eQTLGen blood eQTL" - "The locus is in the MHC -- what method should be used" - "My GWAS is in East Asian ancestry but the eQTL is GTEx EUR -- can coloc be trusted"

Example Prompts

Single-Tissue GWAS-eQTL

"Take this 1 Mb window centred on the GWAS lead SNP and run coloc.abf against the eQTL for the nearest gene. Report PP.H4 with p12 sensitivity."

"I have summary stats with p-values and MAF but no betas -- run coloc using p-value / MAF input format."

Multi-Causal / Allelic Heterogeneity

"GCTA-COJO conditional analysis identified two independent GWAS signals at this locus. Run coloc.susie with the LD matrix and report all credible-set pair PPs."

"PP.H3 is dominating coloc.abf despite obvious overlap in LocusZoom. Switch to coloc.susie or eCAVIAR and re-test."

Multi-Tissue

"Run coloc.abf between this GWAS locus and the same gene across all 49 GTEx v8 tissues; rank tissues by PP.H4 to identify causal cell type."

"Use HyPrColoc across GTEx tissues to cluster tissues that share the causal variant."

Multi-Trait / Multi-Omic

"Integrate GWAS + eQTL + sQTL + pQTL at this locus with moloc and report the PPA for the all-share hypothesis."

"Cluster 12 cardiovascular GWAS traits at the LDLR locus with HyPrColoc."

SMR / HEIDI

"Run SMR + HEIDI between my disease GWAS .ma file and eQTLGen .besd. Report SMR p, HEIDI p, and number of HEIDI SNPs."

MHC / HLA

"This locus is in the MHC. Flag the long-range-LD problem and recommend HLA-coloc (Butler-Laporte 2024) or exclude-and-report-HLA-association strategy."

Ancestry-Mismatched

"GWAS is FinnGen (FIN) and eQTL is GTEx (EUR). Compute z-score vs LD diagnostics with estimate_s_rss; if lambda > 0.05, switch to coloc.abf or SharePro_coloc."

Visualization

"Make a LocusCompare plot and a stacked regional Manhattan for this colocalization."

What the Agent Will Do

  1. Identify the question type (single-causal, multi-causal, multi-trait, pleiotropy vs linkage) and select method from the decision tree.
  2. Extract a +/- 500 kb to 1 Mb window centred on the GWAS lead SNP (or joint top-variant when both traits available).
  3. Harmonise allele coding between summary statistics; flip betas where A1/A2 swap; drop palindromic SNPs at high MAF.
  4. Format the per-trait coloc input lists (beta, varbeta, snp, position, N, type, sdY for quant, s for cc).
  5. Run the chosen colocalization method (coloc.abf, coloc.susie, HyPrColoc, moloc, SMR, eCAVIAR, PWCoCo, or SharePro_coloc).
  6. For coloc.susie: run susieR::estimate_s_rss to verify z-score vs LD consistency; abort if lambda > 0.05.
  7. ALWAYS run coloc::sensitivity(res, 'H4 > 0.75') and report the p12 range over which PP.H4 stays above threshold.
  8. Interpret PP.H0-H4 against the appropriate threshold (>= 0.75 screening, >= 0.80 published, >= 0.90 stringent).
  9. Generate regional association and LocusCompare plots colored by LD to lead.
  10. For multi-causal results, report per-(CS1, CS2) PP and lead SNP per credible set.
  11. For multi-omic results, report the all-share PPA and per-pair PPs.
  12. Flag known failure modes (MHC, ancestry mismatch, low-N eQTL, lead-SNP-swap window bias) explicitly in the report.

Plain-Language H0-H4 (for Methods Section)

For a methods or supplementary description in plain prose:

A high PP.H4 (>= 0.75) supports a shared-causal-variant interpretation. A high PP.H3 supports distinct causal variants in linkage. PP.H0 / PP.H1 / PP.H2 indicate the locus is underpowered for at least one trait. Always report all five posteriors, not PP.H4 alone.

GWAS Summary-Stats Harmonisation (Worked Example)

harmonise <- function(df1, df2) {
    m <- merge(df1, df2, by='SNP', suffixes=c('.1','.2'))
    same <- m$A1.1 == m$A1.2 & m$A2.1 == m$A2.2
    flip <- m$A1.1 == m$A2.2 & m$A2.1 == m$A1.2
    palindromic <- (m$A1.1 %in% c('A','T') & m$A2.1 %in% c('A','T')) |
                   (m$A1.1 %in% c('C','G') & m$A2.1 %in% c('C','G'))
    m$BETA.2[flip] <- -m$BETA.2[flip]
    m$MAF.2[flip] <- 1 - m$MAF.2[flip]
    keep <- (same | flip) & !(palindromic & m$MAF.1 > 0.42)
    m[keep, ]
}

Harmonisation pitfalls to watch for:

Worked PWCoCo Conditional Recipe

# Step 1: GCTA-COJO identifies independent signals at the locus
gcta64 --bfile 1KG_EUR --chr 6 --extract locus.snplist \
       --cojo-file gwas.ma --cojo-slct --out gwas_cojo

# gwas_cojo.jma.cojo lists independent signals (per --cojo-p 5e-8 default)

# Step 2: PWCoCo runs pairwise conditional coloc.abf per signal pair
pwcoco --bfile 1KG_EUR --sum_stats1 gwas.txt --sum_stats2 eqtl.txt \
       --p_cutoff1 5e-8 --p_cutoff2 5e-5 \
       --chr 6 \
       --out pwcoco_result

Output: one coloc.abf result per (conditional signal in trait 1, conditional signal in trait 2) pair. Interpret each row as a separate single-signal coloc test. If COJO finds 2 GWAS + 1 eQTL signals, expect 2 result rows. PWCoCo requires individual-level reference (plink bfile); cannot run on summary stats alone.

Lead-SNP-Swap Operational Steps

To diagnose window-centring bias, re-run coloc.abf three times with different window centres:

  1. GWAS-centred window: +/- 500 kb around the GWAS lead SNP.
  2. eQTL-centred window: +/- 500 kb around the eQTL top SNP for the gene.
  3. Joint top-variant window: +/- 500 kb around the SNP with the lowest min-p across both traits.

Report all three PP.H4 values. If they agree within 0.1, the result is stable. If they swing > 0.2, the locus is borderline and the report must list all three centrings. For multi-causal loci (allelic heterogeneity), the joint top-variant window typically gives the most-defensible result for coloc.abf; coloc.susie removes the centring sensitivity by construction.

Tips