CHD PheWAS follow-up: exact hits and shared comparators

MR
PheWAS
Author

Gibran Hemani

Published

October 9, 2026

This report supersedes the regional-target, per-target-complement and proxy follow-up results in chd_example.ipynb. That notebook is retained as historical acquisition context; none of its acquisition, metadata, LD, proxy or gene calls execute here. Every result below is recomputed from the existing local inputs.

Code
source("offline/R/offline-pipeline.R")
disable_remote_access()
source("offline/R/chd-inputs.R")
inputs <- reconstruct_chd_inputs(".")
analysis <- run_offline_analysis(inputs)
stopifnot(nrow(analysis$tables$lead_inventory) == 41L,
          nrow(analysis$comparisons) == 23L,
          length(unique(analysis$comparisons$target_snp)) == 18L,
          nrow(analysis$pooled) == 5L)
show_table <- function(x, digits = 4) knitr::kable(x, digits = digits, row.names = FALSE)

Inputs and analysis policy

The 41 discovery leads come from saved ieu-a-7 CHD results. Follow-up uses the separate ukb-d-I9_IHD outcome GWAS. Its VCF declares StudyType=Continuous; the saved effect scale is unavailable. The figures therefore report saved outcome GWAS units, with no log-odds interpretation. Mediator transformations are also explicitly unknown unless documented in the local source metadata. VCF LP is converted from −log10(P) using 10^-LP; missing P values remain missing.

The selected input is exactly chd_phewas_result.Rdata (singular). chd_phewas_results.Rdata has different contents and is not used. The selected file supplies the full lead coordinates, saved instrument identities, and the retained SNP–mediator pair inventory; its int_chd contains identities rather than association statistics. Indexed local mediator and outcome VCFs supply fresh beta, SE, alleles and coordinates. The compact association CSVs below are traceable derived inputs, not cached result tables.

Code
show_table(analysis$tables$extraction_counts)
source queried found
saved_pair_identities 23 23
exact_mediator_associations 23 23
saved_instrument_identities 1002 1002
instrument_vcf_associations 1002 1008
lead_inventory 41 41
outcome_query_loci 1032 1032
outcome_vcf_associations 1032 1027
outcome_leads_found 41 40
outcome_instruments_found 992 984
outcome_target_snps_found 18 18

“Queried” counts saved requested identities; “found” counts association records or matched SNP identities as indicated by the row. The 1,002 saved instrument rows yield 1,008 VCF association records because duplicate records are retained for explicit validation. These are not 1,008 independent instruments. Outcome coverage is 40/41 leads, 984/992 distinct instrument SNPs and 18/18 retained target SNPs. Harmonisation and conflict checks determine the usable instrument counts shown below.

All 41 leads and their inclusive ±1 Mb regions are excluded directly from each mediator’s instruments before outcome matching and harmonisation. rs17678683 remains in this exclusion inventory even though its outcome row is absent. Missing or conflicting exclusion coordinates cannot certify a comparator. Coordinate/build checks use the local saved coordinate system; there is no liftover or independent validation against an LD reference. Geographic windows do not establish LD independence.

Each mediator has one shared comparator, reused exactly across all of its targets, pooled MR, heterogeneity tests and decomposition. Each exact-hit estimate uses only its named SNP. Conservative harmonisation discards every A/T or C/G palindrome and rejects conflicting associations and proxy substitutions. A one-SNP comparator uses a Wald ratio; a multiple-SNP comparator uses IVW with multiplicative random effects.

Complete discovery inventory

The 41-lead discovery inventory is distinct from the 18 retained target SNPs, 23 unique SNP–mediator pairs and five mediators. A lead without a retained mediator pair is still excluded from every comparator.

Code
show_table(analysis$tables$lead_inventory)
target_snp target_chr target_pos build retained_pairs outcome_available followup_status
rs10080815 6 160687412 GRCh37 1 TRUE Retained exact follow-up pair(s)
rs10139550 14 100145710 GRCh37 1 TRUE Retained exact follow-up pair(s)
rs10840293 11 9751196 GRCh37 1 TRUE Retained exact follow-up pair(s)
rs11065979 12 112059557 GRCh37 2 TRUE Retained exact follow-up pair(s)
rs11191416 10 104604916 GRCh37 2 TRUE Retained exact follow-up pair(s)
rs11556924 7 129663496 GRCh37 0 TRUE No retained saved mediator association; still excluded from every comparator
rs115654617 2 203893999 GRCh37 1 TRUE Retained exact follow-up pair(s)
rs11838776 13 111040681 GRCh37 0 TRUE No retained saved mediator association; still excluded from every comparator
rs1199338 3 138087467 GRCh37 0 TRUE No retained saved mediator association; still excluded from every comparator
rs12202017 6 134173151 GRCh37 0 TRUE No retained saved mediator association; still excluded from every comparator
rs1412444 10 91002927 GRCh37 0 TRUE No retained saved mediator association; still excluded from every comparator
rs16986953 2 19942473 GRCh37 0 TRUE No retained saved mediator association; still excluded from every comparator
rs17087335 4 57838583 GRCh37 0 TRUE No retained saved mediator association; still excluded from every comparator
rs17678683 2 145286559 GRCh37 0 FALSE No retained saved mediator association; still excluded from every comparator
rs180803 22 24658858 GRCh37 0 TRUE No retained saved mediator association; still excluded from every comparator
rs1870634 10 44480811 GRCh37 0 TRUE No retained saved mediator association; still excluded from every comparator
rs2107595 7 19049388 GRCh37 1 TRUE Retained exact follow-up pair(s)
rs2128739 11 103673277 GRCh37 0 TRUE No retained saved mediator association; still excluded from every comparator
rs2487928 10 30323892 GRCh37 0 TRUE No retained saved mediator association; still excluded from every comparator
rs2519093 9 136141870 GRCh37 1 TRUE Retained exact follow-up pair(s)
rs2681472 12 90008959 GRCh37 1 TRUE Retained exact follow-up pair(s)
rs28451064 21 35593827 GRCh37 0 TRUE No retained saved mediator association; still excluded from every comparator
rs2891168 9 22098619 GRCh37 1 TRUE Retained exact follow-up pair(s)
rs3918226 7 150690176 GRCh37 0 TRUE No retained saved mediator association; still excluded from every comparator
rs4420638 19 45422946 GRCh37 2 TRUE Retained exact follow-up pair(s)
rs4468572 15 79124475 GRCh37 1 TRUE Retained exact follow-up pair(s)
rs4593108 4 148281001 GRCh37 0 TRUE No retained saved mediator association; still excluded from every comparator
rs515135 2 21286057 GRCh37 1 TRUE Retained exact follow-up pair(s)
rs55730499 6 161005610 GRCh37 1 TRUE Retained exact follow-up pair(s)
rs56062135 15 67455630 GRCh37 0 TRUE No retained saved mediator association; still excluded from every comparator
rs56289821 19 11188247 GRCh37 1 TRUE Retained exact follow-up pair(s)
rs56336142 6 39134099 GRCh37 0 TRUE No retained saved mediator association; still excluded from every comparator
rs663129 18 57838401 GRCh37 2 TRUE Retained exact follow-up pair(s)
rs6689306 1 154395946 GRCh37 0 TRUE No retained saved mediator association; still excluded from every comparator
rs67180937 1 222823743 GRCh37 0 TRUE No retained saved mediator association; still excluded from every comparator
rs7212798 17 59013488 GRCh37 0 TRUE No retained saved mediator association; still excluded from every comparator
rs7528419 1 109817192 GRCh37 1 TRUE Retained exact follow-up pair(s)
rs7568458 2 85788175 GRCh37 0 TRUE No retained saved mediator association; still excluded from every comparator
rs8042271 15 89574218 GRCh37 0 TRUE No retained saved mediator association; still excluded from every comparator
rs9349379 6 12903957 GRCh37 2 TRUE Retained exact follow-up pair(s)
rs9970807 1 56965664 GRCh37 0 TRUE No retained saved mediator association; still excluded from every comparator

Pooled mediator MR

These are the same estimates shown as “Other SNPs” in the comparison panels. Units are outcome GWAS units per the corresponding mediator GWAS unit; different mediator panels need not share an x-axis scale. Instrument F diagnostics describe the retained harmonised instruments and do not by themselves establish instrument validity.

Code
show_table(analysis$pooled[, c("mediator_id", "nsnp", "n_saved_before_exclusions",
  "n_excluded_target", "n_excluded_region", "n_retained_before_outcome_matching",
  "n_harmonised", "F_min", "F_mean", "n_weak_F", "b", "se", "pval_bh", "status")])
mediator_id nsnp n_saved_before_exclusions n_excluded_target n_excluded_region n_retained_before_outcome_matching n_harmonised F_min F_mean n_weak_F b se pval_bh status
ieu-b-5138 224 288 1 19 262 224 29.7657 54.7044 0 0.0020 0.0002 0.0000 available
ukb-b-10831 7 11 0 2 9 7 31.5758 43.4594 0 0.0437 0.0139 0.0021 available
ukb-b-2303 362 448 0 18 428 362 29.7628 64.4443 0 0.0264 0.0021 0.0000 available
ukb-b-5779 86 100 1 2 95 86 29.7434 54.8531 0 0.0076 0.0036 0.0350 available
ukb-d-30780_raw 120 161 0 26 133 120 29.8525 96.3044 0 0.0278 0.0041 0.0000 available

Download pooled PDF · Pooled source CSV

Exact-hit comparisons

One panel per mediator contains every retained exact-hit row and exactly one shared comparator. Heterogeneity uses Q=(b̂target−b̂other)2/(SEtarget2+SEother2)Q=(\hat b_{\mathrm{target}}-\hat b_{\mathrm{other}})^2/(SE_{\mathrm{target}}^2+SE_{\mathrm{other}}^2), under a zero-covariance working assumption. BH adjustment uses available unique-pair tests. A significant Q indicates incompatibility with a common effect under the model assumptions; it does not uniquely identify a direct pathway. Nonsignificance does not establish mediation or equivalence.

Code
unavailable <- analysis$comparisons[analysis$comparisons$status != "available", ]
show_table(unavailable[, c("mediator_id", "target_snp", "target_status", "comparator_status", "reason")])
mediator_id target_snp target_status comparator_status reason
ieu-b-5138 rs10139550 unavailable available Target: No usable harmonised variants; n_duplicate_conflicts_outcome, n_palindromic
Code
cat("\nAvailable comparisons:", sum(analysis$comparisons$status == "available"), "of", nrow(analysis$comparisons), ".\n")

Available comparisons: 22 of 23 .

The feasibility baseline was 22 usable pairs, with SBP/rs10139550 unavailable under conservative palindrome/conflicting-association checks. The table above reports the recomputed status without forcing that count or rescuing ambiguous alleles. All 23 identities remain in the CSV and figures.

Download all comparison pages as PDF · Comparison source CSV

Total, indirect and model-based residual components

For each pair, aligned aa is SNP→mediator, tt is SNP→outcome, and bb is the shared mediator→outcome comparator. The indirect component is i=abi=ab and the model-based residual is d=t−id=t-i. All components use outcome GWAS units per the recorded target effect allele. Signed opposing pathways are preserved; indirect effects across mediators are not summed and mediation percentages are not calculated. These residuals are not identified natural direct effects.

The primary delta method assumes zero Cov(a,b), Cov(a,t) and Cov(b,t): Var⁡(i)=b2Var⁡(a)+a2Var⁡(b)\operatorname{Var}(i)=b^2\operatorname{Var}(a)+a^2\operatorname{Var}(b) and Var⁡(d)=Var⁡(t)+Var⁡(i)\operatorname{Var}(d)=\operatorname{Var}(t)+\operatorname{Var}(i). Normal 95% intervals and nominal tests are approximate. Unusable components remain unavailable; an independently available total association remains visible. Instrument validity, nonlinearity, population differences and the unknown outcome scale limit causal interpretation.

Download all decomposition pages as PDF · Decomposition source CSV

Multiplicity and sensitivities

Primary Q, pooled MR, indirect-component and residual-component tests form four separate BH families. Unavailable tests do not enter a family’s tested denominator. There is no claim of joint error control across families. Each geographic and hypothetical covariance scenario has its own family.

Code
show_table(analysis$summary$families)
family inventory tested unavailable nominal_below_005 bh_below_005
unique_pair_heterogeneity 23 22 1 15 15
pooled_mediator_mr 5 5 0 5 5
unique_pair_indirect_component 23 22 1 22 22
unique_pair_residual_component 23 22 1 15 15
sensitivity_pair_heterogeneity_2mb 23 22 1 15 15
sensitivity_pair_heterogeneity_2mb_mhc 23 22 1 15 15
unique_pair_indirect_component_hypothetical_rho_-0.3 23 22 1 21 21
unique_pair_indirect_component_hypothetical_rho_0 23 22 1 22 22
unique_pair_indirect_component_hypothetical_rho_0.3 23 22 1 21 21
unique_pair_residual_component_hypothetical_rho_-0.3 23 22 1 15 15
unique_pair_residual_component_hypothetical_rho_0 23 22 1 15 15
unique_pair_residual_component_hypothetical_rho_0.3 23 22 1 16 15

The geographic sensitivity repeats the comparisons with ±2 Mb exclusions, then ±2 Mb plus extended MHC (chr6:25–34 Mb). It uses the same complete lead inventory and conservative allele policy. These are saved-coordinate sensitivities rather than verified LD/build independence checks.

The covariance sensitivity uses hypothetical equicorrelation matrices for (a,b,t), with rho = −0.3, 0 and +0.3. Each matrix is positive definite (eigenvalues 1−rho, 1−rho and 1+2rho). The propagated component SEs include the relevant covariance terms. These are illustrative assumptions, not empirical sample-overlap or covariance estimates.

Geographic sensitivity CSV · Hypothetical covariance sensitivity CSV · Family denominators CSV

Reproduction and downloads

From the repository root, run:

cd posts/2026-05-22-phewas-example
Rscript offline/run-tests.R
Rscript offline/run-analysis.R
sh offline/render-report.sh

The render wrapper stages this document outside the website project, performs a fresh report-only render, and writes chd_followup.html beside this source. It blocks scientific remote API/download/install functions and sets loopback proxies. Local VCFs, indices and the selected Rdata must already exist; no packages or data are downloaded or installed. The shared runner also accepts normalized inputs with explicit lead inventory and outcome metadata through run_offline_analysis(inputs, output_dir, figures_dir).

The repo-local statistical implementation derives from MRCIEU/gbc-mr commit 3bbac89, with adaptations documented in offline/README.md. Statistical formulas live in shared modules rather than document cells. Large VCFs stay outside Git.

Code
show_table(analysis$tables$package_versions)
package version
R 4.6.1
TwoSampleMR 0.7.6
ieugwasr 1.1.0.9000
gwasvcf 0.1.6
GenomicRanges 1.64.0
Rsamtools 2.28.0
VariantAnnotation 1.58.0
knitr 1.51
rmarkdown 2.31
testthat 3.3.2