XMR (Cross-Population Mendelian Randomization) is a probabilistic method for estimating causal effects between an exposure and an outcome using genome-wide summary statistics from multiple populations.
XMR improves the power and robustness of causal inference in underrepresented (small-sample) populations by leveraging information from a large-sample auxiliary population. Specifically, XMR decomposes the observed SNP–trait effects into true causal effects and confounding factors (e.g., pleiotropy, population structure) hidden in summary statistics. By explicitly modelling the genetic correlation between two populations, XMR effectively borrows strength from the large-sample group. XMR further corrects bias introduced by IV selection and LD clumping to reduce false positive rates.
Overview of the XMR method. XMR estimates the causal effect
# install.packages("devtools")
devtools::install_github("YangLabHKUST/XMR")Typical installation time: < 5 minutes. Required time on a standard desktop computer should be comparable.
We illustrate how to perform cross-population MR analysis using XMR with a real-data example: LDL cholesterol (LDLC, exposure) and myocardial infarction (MI, outcome), with Europeans (EUR) as the auxiliary population and East Asians (EAS) as the target population.
The XMR analysis comprises two main steps:
- Step 1: Prepare data, estimate background parameters (the C and Omega matrices via cross-population LD score regression), and select and LD-clump candidate IVs.
- Step 2: Fit XMR for causal inference.
For a step-by-step walkthrough, see the XMR tutorial: causal effect of LDLC on MI (download link).
For a quick start, you can skip Step 1 and proceed directly to Step 2 using the example data we have prepared.
library(XMR)
exposure <- "LDLC"
outcome <- "MI"
# Auxiliary-exposure P-value threshold for IV selection
threshold <- 5e-05
# Load example data
data(C)
data(Omega)
data(clumped_data) # after IV selection and LD clumping
# Fit XMR
XMR_res <- fit_XMR(
data = clumped_data,
exposure = exposure,
outcome = outcome,
C = C,
Omega0 = Omega,
Threshold = threshold,
tol1 = 1e-07,
tol2 = 1e-07,
min_thres = 1e-2
)The input data should be a data.frame containing the following columns:
| Column | Description |
|---|---|
b.exp.pop1 |
SNP–exposure effect in the auxiliary population (pop1) |
b.exp.pop2 |
SNP–exposure effect in the target population (pop2) |
b.out.pop2 |
SNP–outcome effect in the target population (pop2) |
se.exp.pop1 |
Standard error of b.exp.pop1 |
se.exp.pop2 |
Standard error of b.exp.pop2 |
se.out.pop2 |
Standard error of b.out.pop2 |
L2.pop1 |
LD score in the auxiliary population; defaults to all ones if not provided |
L2.pop2 |
LD score in the target population; defaults to all ones if not provided |
L12 |
Cross-population LD score between pop1 and pop2; defaults to all ones if not provided |
- C matrix: A 3×3 matrix capturing the effects of sample structure (population stratification, cryptic relatedness, sample overlap, etc.).
- Omega matrix: A 3×3 variance–covariance matrix of polygenic effects.
Both can be estimated using bivariate LD score regression.
XMR_res is a list containing:
exposure: name of the exposureoutcome: name of the outcomebeta: estimated causal effect of the exposure on the outcomebeta.se: standard error of the causal effect estimatebeta.pvalue: p-value for the causal effecttau.sq: estimated variance of uncorrelated pleiotropic effectsSigmaX: estimated covariance matrix of exposure effects in the foreground componentpost: posterior quantities, includingpost$Pi, the posterior foreground-membership probabilities providing model-based support for each candidate IV's contribution to causal estimationnIV: number of candidate IVs usednvalid: model-estimated effective IV counts (pi0 * nIV)pi0: estimated foreground proportion among selected candidate IVsThreshold: auxiliary-exposure P-value threshold used for IV selectionfit1_elbos,fit2_elbos: evidence lower bounds in the two fitting stagesfit1_likelis,fit2_likelis: likelihoods in the two fitting stages
For the LDLC → MI example, the expected output is approximately:
beta= 0.1830,beta.se= 0.0449,beta.pvalue= 4.5902e-05,nIV= 289,nvalid= 168.9770
Expected run time: ~1 minute on an Intel® Xeon® Gold 6152 CPU @ 2.10 GHz. Run time on a standard desktop computer should be comparable.
We evaluated XMR and comparison methods across five experimental settings:
- Simulations: evaluating method performance under baseline and reduced-confounding scenarios.
- Negative-control studies: testing the causal effects of 35 traits on 2 negative-control outcomes (skin tanning ability and natural hair color) in Africans (AFR) and Central/South Asians (CSA).
- Auxiliary-dataset sensitivity: comparing FinnGen and Pan-UKB as auxiliary datasets for analyses in BioBank Japan (BBJ).
- SHBG–T2D analysis: estimating the effect of sex hormone-binding globulin on type 2 diabetes across populations.
- BBJ–TPMI analysis: comparing causal estimates across BBJ, the Taiwan Precision Medicine Initiative (TPMI), and UK Biobank (UKBB).
Source code for the main-figure analyses is available at YangLabHKUST/XMR_reproduce. Experiment scripts and visualization scripts are provided separately.
Simulations:
Baseline experiments | Reduced-confounding experiments | Workflow | Visualization
Negative-control studies:
Experiments | Workflow | Visualization
Auxiliary-dataset sensitivity:
Experiments | Workflow | Visualization
SHBG–T2D analysis:
Experiments | Workflow | Visualization
BBJ–TPMI analysis:
Experiments | Workflow | Visualization
Follow the steps below to prepare the inputs and run the analyses.
git clone https://github.com/YangLabHKUST/XMR_reproduce.git
cd XMR_reproduceDirectory structure:
XMR_reproduce/
├── simulations/ # Baseline and reduced-confounding simulations
├── negative_controls/ # Negative-control analysis in AFR and CSA
├── auxiliary_sensitivity/ # FinnGen and Pan-UKB auxiliary datasets
├── SHBG_T2D/ # SHBG–T2D analysis across populations
├── BBJ_TPMI/ # BBJ–TPMI–UKBB comparison
├── environment/ # Software dependencies and versions
└── DATA.md # Input formats and file locations
Each experiment directory contains separate code/ and plot/ folders.
Download the raw GWAS summary statistics from the sources listed in GWAS_data_sources.csv. The table groups the download links by experiment, trait, cohort and population, with references to the corresponding Supplementary tables.
Prepare the GWAS tables using MRAPSS::format_data() as described in FORMATTING.md, and save them at the locations specified in DATA.md. The trait lists and manifests are included in the reproduction repository. The real-data analysis scripts start from the formatted inputs and estimate the background parameters needed for method fitting.
- PLINK software: download PLINK 1.9. The real-data scripts expect the executable at
negative_controls/plink_Linux. - Real-data LD scores and reference panels: obtain the resources below and place them at the locations shown.
- Simulation LD matrices: download the white British and East Asian HapMap3 matrices from ViLMA. Follow the simulation workflow to prepare the chromosome-specific inputs.
| Resource | Location in XMR_reproduce | Download |
|---|---|---|
| EUR/EAS/AFR and EUR/CSA LD scores | negative_controls/LDscore_eas_brit_afr.txt; negative_controls/LDscore_SAS_EUR.csv |
Zenodo |
| EUR, EAS, AFR and SAS PLINK reference panels | negative_controls/1kg_pops/ |
Public source and preparation |
| Trait lists and analysis manifests | Experiment-specific locations in DATA.md |
Included files |
The real-data PLINK panels use GRCh38 coordinates; the simulation LD matrices use GRCh37 coordinates. CSA analyses use the SAS panel, and BBJ and TPMI analyses use the EAS panel.
To run XMR and the comparison methods, install the required R packages:
# In R
# install.packages("devtools")
devtools::install_github("YangLabHKUST/XMAP")
devtools::install_github("YangLabHKUST/XMR")
devtools::install_github("hhoulei/TEMR")
devtools::install_github("YangLabHKUST/MR-APSS")
devtools::install_github("yoonsucho/CAMERA")
devtools::install_github("noahlorinczcomi/MRBEE")
devtools::install_github("harryyiheyang/MRBEEX")
install.packages(c(
"data.table", "Matrix", "mvtnorm", "expm", "digest",
"ieugwasr", "tibble", "R.utils",
"ggplot2", "cowplot", "ggrepel", "scales"
))
if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install(c("GenomicRanges", "IRanges"))The simulation utilities also require NumPy and pandas:
python3 -m pip install numpy pandasPackage versions recorded for the analyses are listed in R_packages.tsv.
- Software dependencies: R (>= 4.2.0); R packages: Matrix, expm, stats, mvtnorm, dplyr, reshape2, glmnet, MASS, data.table, readr, magrittr, doParallel, XMAP, MRAPSS
- Tested on: Intel® Xeon® CPU E5-2699 v4 @ 2.20 GHz, R 4.2.2
- Hardware: No non-standard hardware required. A standard desktop computer is sufficient.
Xinrui Huang, Zitong Chao, Zhiwei Wang, Xianghong Hu, and Can Yang. XMR: A cross-population Mendelian randomization method for causal inference using genome-wide summary statistics. medRxiv, 2026. DOI: 10.64898/2026.03.10.26348003
Please feel free to contact Xinrui Huang (xhuangcn@connect.ust.hk), Prof. Xianghong Hu (huxh@szu.edu.cn), or Prof. Can Yang (macyang@ust.hk) if you have any questions.
