TwoSampleMR
Summary¶
TwoSampleMR is an R bioinformatics package designed for executing two-sample Mendelian Randomization (MR) analyses. Developed and maintained by Gibran Hemani at the MRC Integrative Epidemiology Unit, it provides functions to query GWAS summary data via the OpenGWAS database, harmonize effect alleles across datasets, estimate causal effects, and run sensitivity diagnostics.
Features¶
- Automated Data Retrieval: Directly integrates with the OpenGWAS database via API to fetch genetic association data.
- Data Harmonization: Standardizes exposure and outcome datasets, ensuring alleles and effect directions match.
- Causal Estimation: Implements multiple MR estimators including inverse-variance weighted (IVW), MR-Egger, weighted median, and weighted mode.
- Diagnostics and Sensitivity Tests: Offers tools for heterogeneity testing (Cochran's Q), horizontal pleiotropy evaluation (MR-Egger intercept), leave-one-out validation, and Steiger directionality filtering.
Citations¶
- Hemani, G. et al. (2018). The MR-Base platform supports systematic causal inference across the human phenome. eLife, 7, e34408. DOI: 10.7554/eLife.34408
- Sanderson, E. et al. (2026). Challenges and future directions for Mendelian randomization. Nature Genetics, 58(5), 984–994. DOI: 10.1038/s41588-026-02546-6. Source paper: s41588-026-02546-6.pdf