PYPE

Reproduce the PYPE paper

Reproduction scope

The MR analyses use public summary statistics and can be reproduced automatically. The participant-level PheWAS requires the original authorized study data.

Public reproduction

Abdomen and liver aging variants, four outcome GWAS, all implemented MR methods, and Table 1 IVW comparisons.

Study-data reproduction

The full PheWAS, 15,082 tests, Table S20, and the main PheWAS figures require the study cohort.

Run the public analysis

Run these commands from a GitHub source checkout of the repository:

python -m pip install pype-mr openpyxl
python reproducibility/reproduce_paper.py \
  --output paper_reproduction \
  --bootstrap-iterations 1000 \
  --simulation-count 1000 \
  --seed 0

The first run streams about 2 GB of compressed public GWAS files and saves only the selected rows. Later runs reuse the extracted inputs.

Public sources

Public data sources used by the reproduction script.
InputSource
Abdomen and liver aging variantsLe Goallec et al. Supplementary Data 1
Glycated haemoglobinNeale Lab field 30750 raw GWAS
Body mass indexNeale Lab field 21001 raw GWAS
GlucoseNeale Lab field 30740 raw GWAS
Waist circumferenceNeale Lab field 48 raw GWAS

Outputs

Files created by reproducibility/reproduce_paper.py.
FileContents
mr_results.tsvCurrent results for every method and exposure-outcome pair.
ivw_comparison.tsvPublished Table 1 values, legacy PYPE IVW values, and corrected current values.
inputs/Small extracted public summary-statistic subsets.

Table 1 comparison

All eight legacy calculations match the published values within the displayed precision. The current IVW standard error follows the TwoSampleMR under-dispersion correction.

Published IVW values and results from the corrected current implementation.
PredictorOutcomePublished betaPublished SEPublished pCurrent pCurrent SE
AbdomenHbA1C0.02650.02040.1940.6660.0614
AbdomenBMI0.00610.11580.9580.9570.1158
AbdomenGlucose-0.01510.01320.2540.2540.0132
AbdomenWaist circumference0.35560.10860.00110.00150.1121
LiverHbA1C0.01530.04410.7290.7300.0441
LiverBMI-0.01220.12310.9210.9210.1229
LiverGlucose0.00660.00720.3580.3800.0075
LiverWaist circumference0.25090.15700.1100.1100.1570

Why some current p-values differ

The original IVW implementation used the raw statsmodels residual-scaled standard error. TwoSampleMR prevents under-dispersion from making an IVW standard error smaller than the fixed-effect value. The current PYPE implementation applies that correction.

Effect estimates remain the same. Differences appear in standard errors and p-values only when the fitted residual scale is below one.

Bootstrap methods

Median, mode, and MR-PRESSO uncertainty estimates use random sampling. Fix the seed and number of bootstrap or empirical distributions when comparing runs. The original paper did not record a common seed for every table, so point estimates are the stable comparison target.