MR.RGM: An R Package for Fitting Bayesian Multivariate Bidirectional Mendelian Randomization Networks

Bitan Sarkar, Yang Ni

TL;DR

MR.RGM is a new R package that evolves Mendelian Randomization (MR) from simple pair-wise analysis into complex network modeling. By leveraging a Bayesian reciprocal graphical model, it allows researchers to construct holistic causal networks that account for multiple variables and feedback loops simultaneously, all while maintaining high computational efficiency.

What Problem Does This Paper Address?

Mendelian Randomization (MR) is a powerful tool in epidemiology that uses genetic variants as "natural experiments" (instrumental variables) to determine if one factor actually causes another, rather than just being correlated with it. However, traditional MR is often "atomistic"—it looks at one exposure and one outcome at a time.

Real biological systems are rarely that simple. They are "molecular hairballs" where multiple proteins, genes, and metabolites interact in complex, interconnected webs. Crucially, these systems often feature feedback loops (reciprocal causation), where variable A affects B, and B in turn affects A. Existing MR tools often struggle to model these networks as a whole, fail to provide robust uncertainty quantification, or are computationally too slow to handle the complexity of modern "omics" datasets.

Methods

The authors introduce MR.RGM (Mendelian Randomization via Reciprocal Graphical Model). The core engine is a Bayesian framework that treats the entire system as a directed graph where edges represent causal effects.

Key technical highlights include:

  • Reciprocal Modeling: Unlike standard Directed Acyclic Graphs (DAGs), this model allows for cycles, capturing the feedback loops inherent in biology.
  • Bayesian Inference: It uses Markov Chain Monte Carlo (MCMC) sampling to estimate the "posterior probability" of causal links. This means instead of just getting a "yes/no" on a causal link, you get a measure of how certain the model is.
  • Prior Flexibility: Users can choose between "Spike and Slab" priors (good for identifying clear, sparse signals) or "Threshold" priors.
  • Computational Speed: To prevent the MCMC from crawling, the authors implemented the backend in C++ and utilized the Woodbury matrix identity. This mathematical shortcut allows the algorithm to update complex matrix determinants and inverses much faster than standard methods.
  • Data Versatility: The package supports both raw individual-level data and summary-level data (like GWAS results), making it highly accessible for researchers who may not have access to primary patient samples.

Datasets

The authors validated the package using two main approaches:

  1. Extensive Simulations: They generated synthetic datasets with varying sample sizes (10k to 50k), network sizes (5 to 10 nodes), and noise levels to benchmark accuracy against existing tools.
  2. GTEx V7 Database: They applied the tool to real-world gene expression data from the Genotype-Tissue Expression (GTEx) project. Specifically, they analyzed muscle skeletal tissues from 332 donors to map a causal network among 15 specific genes.

Key Insights and Ideas

  • Holistic over Atomistic: The "aha moment" here is that by modeling the network simultaneously, you reduce the biases that come from ignoring "pleiotropy" (when one gene affects multiple traits).
  • Summary Data is Sufficient: A major insight is that the model yields nearly identical results whether using individual-level data or summary-level statistics. This is a huge win for collaborative research where sharing raw data is often restricted by privacy laws.
  • Robustness to Non-Normality: Bayesian models are sometimes criticized for being sensitive to assumptions about "normal" noise. The authors showed that MR.RGM remains accurate even when the data follows "heavier-tailed" distributions like the t-distribution or Laplace distribution.

Key Results

  • Superior Accuracy: In simulations, MR.RGM consistently outperformed the state-of-the-art OneSampleMR package, showing higher True Positive Rates (TPR) and better Area Under the Curve (AUC) scores across almost all scenarios.
  • Efficiency: On a standard laptop (Apple M2 Pro), the package could process a 15-gene network with 50,000 iterations in just about 32 seconds.
  • Real-World Utility: In the GTEx analysis, the tool successfully identified a sparse, interpretable network of gene-to-gene causal interactions, with the ability to "tune" the network's complexity by adjusting the probability threshold (e.g., only showing links with >75% certainty).

Limitations and Future Work

  • Identifiability Requirements: For the model to work, each "outcome" variable must have at least one unique genetic instrument that affects only that variable. If variables share all their genetic predictors, the model cannot distinguish between them.
  • Dimensionality: While fast, the current implementation is demonstrated on networks of ~15-20 variables. Scaling this to "whole-genome" networks (thousands of variables) would likely require further algorithmic optimizations or dimensionality reduction (like the PCA approach the authors touched upon in their expanded simulations).
  • Instrument Validity: Like all MR methods, MR.RGM relies on the assumption that the genetic variants used are valid instruments. If the underlying genetics are messy (e.g., high horizontal pleiotropy), the causal inferences could still be biased.

Summary updated

Abstract

Motivation: Mendelian randomization (MR) infers causal relationships between exposures and outcomes using genetic variants as instrumental variables. Typically, MR considers only a pair of exposure and outcome at a time, limiting its capability of capturing the entire causal network. We overcome this limitation by developing 'MR.RGM' (Mendelian randomization via reciprocal graphical model), a fast R-package that implements the Bayesian reciprocal graphical model and enables practitioners to construct holistic causal networks with possibly cyclic/reciprocal causation and proper uncertainty quantifications, offering a comprehensive understanding of complex biological systems and their interconnections. We developed 'MR.RGM', an open-source R package that applies bidirectional MR using a network-based strategy, enabling the exploration of causal relationships among multiple variables in complex biological systems. 'MR.RGM' holds the promise of unveiling intricate interactions and advancing our understanding of genetic networks, disease risks, and phenotypic complexities.
BibTeX
@article{sarkar2025mr,
  author = {Bitan Sarkar and Yang Ni},
  title = {{MR.RGM: An R Package for Fitting Bayesian Multivariate Bidirectional Mendelian Randomization Networks}},
  journal = {Bioinformatics},
  year = {2025},
  doi = {10.1093/bioinformatics/btaf130},
}
Figure