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
| Input | Source |
|---|---|
| Abdomen and liver aging variants | Le Goallec et al. Supplementary Data 1 |
| Glycated haemoglobin | Neale Lab field 30750 raw GWAS |
| Body mass index | Neale Lab field 21001 raw GWAS |
| Glucose | Neale Lab field 30740 raw GWAS |
| Waist circumference | Neale Lab field 48 raw GWAS |
Outputs
| File | Contents |
|---|---|
mr_results.tsv | Current results for every method and exposure-outcome pair. |
ivw_comparison.tsv | Published 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.
| Predictor | Outcome | Published beta | Published SE | Published p | Current p | Current SE |
|---|---|---|---|---|---|---|
| Abdomen | HbA1C | 0.0265 | 0.0204 | 0.194 | 0.666 | 0.0614 |
| Abdomen | BMI | 0.0061 | 0.1158 | 0.958 | 0.957 | 0.1158 |
| Abdomen | Glucose | -0.0151 | 0.0132 | 0.254 | 0.254 | 0.0132 |
| Abdomen | Waist circumference | 0.3556 | 0.1086 | 0.0011 | 0.0015 | 0.1121 |
| Liver | HbA1C | 0.0153 | 0.0441 | 0.729 | 0.730 | 0.0441 |
| Liver | BMI | -0.0122 | 0.1231 | 0.921 | 0.921 | 0.1229 |
| Liver | Glucose | 0.0066 | 0.0072 | 0.358 | 0.380 | 0.0075 |
| Liver | Waist circumference | 0.2509 | 0.1570 | 0.110 | 0.110 | 0.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.