Interactive Mendelian Randomization Analysis Platform

A comprehensive and user-friendly web-based platform providing the first integrated and standardized MR analysis workflow

🎯 Platform Overview

Mendelian randomization (MR) has emerged as a powerful epidemiological method for inferring causal relationships between exposures and outcomes using genome-wide association study (GWAS) summary data. By leveraging instrumental variables (IVs), such as single nucleotide polymorphisms (SNPs), MR can revolutionize our understanding of disease etiology, inform public health strategies, and accelerate drug discovery.

🎯 Why MRanalysis?

The widespread adoption of MR is hindered by several challenges, including inconsistent GWAS data formats, lack of standardized workflows, the need for extensive programming expertise, and limitations in data visualization and interpretability. MRanalysis addresses these challenges by providing an intuitive, no-code interface that makes sophisticated causal inference methods accessible to researchers across disciplines.

Built using the R Shiny framework, MRanalysis enables users to conduct common MR methods, including univariable, multivariable, and mediation MR analyses through an intuitive, no-code interface. The platform includes GWAS data quality assessment, power/sample size estimation, MR analysis, SNP-to-gene enrichment analysis, and comprehensive data visualization.

📋 Latest Updates & Changelog

🚀 Version 2.0.0 - August 15, 2025
Major Enhancements:
• 🐳 Docker image & one-click deployment: Released official Docker image for easy local deployment
• 🔐 OpenGWAS JWT validation & update: Added token validity check and manual update module
• ⚙️ Flexible IV significance threshold: Users can now set custom P-value thresholds
• 🔬 Colocalization analysis: Integrated COLOC.ABF, COLOC.SUSIE, COLOC.PWCoCo, and COLOC.eCAVIAR
• 🧬 Gene annotation enhanced: Gene symbols and functional/disease annotations
• 🐳 Large-scale GWAS support: Docker image for handling large datasets locally
• 📊 Sample size & power calculation: Upgraded calculators with demonstration cases
• ⚡ Performance improvements: Multivariable MR computation speed increased ~10x
• 🛡️ Security & accessibility: Upgraded SSL certificate and open-sourced platform
• 📚 Limitation & interpretation guidance: Added comprehensive documentation

📥 Download MRanalysis

Choose the installation method that best suits your needs and start your Mendelian randomization analysis journey

🐳 Docker Image (Recommended) 📦 Source Code (GitHub) 🌐 Online Platform

⚙️ Installation Guide

🐳 Docker Deployment (Recommended)

MRanalysis is delivered as Docker images for consistent installations and executions to minimize any potential issues from user environment. A Docker running environment is required.

Upload Software Repositories

As usual, it is a good idea to update the local database of software to make sure you've got access to the latest revisions. Therefore, open a terminal window and type::

sudo apt-get update
Uninstall Old Versions of Docker

Next, it's recommended to uninstall any old Docker software before proceeding. Use the command:

sudo apt-get remove docker docker-engine docker.io
Install Docker

To install Docker on Ubuntu, in the terminal window enter the command:

sudo apt install docker.io

For other systems, visit Docker Installation Guide

Start and Automate Docker

The Docker service needs to be set up to run at startup. To do this, type in each command followed by enter:

sudo systemctl start docker
sudo systemctl enable docker
Running Docker as a non-root user

If you don't want to preface the docker command with sudo, create a Unix group called docker and add user to it::

sudo groupadd docker
sudo usermod -aG docker $USER
Download or pull MRanalysis Docker Image

Download the MRanalysis Docker image package:

# Download the Docker image
wget https://mranalysis.cn/mranalysis.tar

# Load the downloaded Docker image
docker load -i mranalysis.tar
# Or use docker pull command pull image from docker Hub directly
docker pull xingabao/mranalysis:latest
Run MRanalysis Container

Mount your reference data directory to the container. Ensure you have downloaded the required reference datasets (see Reference Data tab).

docker run -itd --rm -p 8001:8001 --name mranalysis \
 -v /path/to/your/references:/references \
 -v /path/to/your/.Renviron:/home/shiny/.Renviron \
 xingabao/mranalysis:latest

Access the platform at http://127.0.0.1:8001

🔧 Step-by-Step Manual Installation

Follow these steps to manually install all required system dependencies, R packages, and third-party tools. Tested on Ubuntu 24.04.

Install R Environment

Install R and development tools:

sudo apt-get update
sudo apt-get install -y r-base r-base-dev

For the latest R version, add the CRAN repository before installing.

Set Up Shiny Server on Ubuntu 24.04
sudo apt-get install -y gdebi-core
wget https://download3.rstudio.org/ubuntu-18.04/x86_64/shiny-server-1.5.20.1002-amd64.deb
sudo gdebi shiny-server-1.5.20.1002-amd64.deb
# Start, stop, or restart Shiny Server.
sudo systemctl start shiny-server
sudo systemctl stop shiny-server
sudo systemctl restart shiny-server

See details in https://posit.co/download/shiny-server/

Install System Dependencies

Install required system libraries and compilers:

sudo apt-get install -y \
 cmake libxml2-dev libssl-dev libgmp-dev libharfbuzz-dev \
 libfribidi-dev libfreetype6-dev libpng-dev libtiff5-dev libjpeg-dev \
 git bzip2 libgsl-dev libglpk-dev libigraph-dev gcc-9 g++-9
Install R Packages

Install required CRAN and Bioconductor packages:

# Install CRAN packages
Rscript -e 'install.packages(c(
 "purrr", "tibble", "reactable", "ggplot2", "ggthemes", "ggdag",
 "ggpubr", "ggtext", "venn", "shinymeta", "esquisse", "openxlsx",
 "bs4Dash", "shinyalert", "shinyjs", "stringr", "spsComps",
 "colourpicker", "shinyvalidate", "shinyjqui", "MendelianRandomization",
 "DT", "devtools", "BiocManager", "coloc", "gdata", "logger"
 ))'

# Install Bioconductor packages
Rscript -e 'BiocManager::install(c(
 "clusterProfiler", "org.Hs.eg.db", "ComplexHeatmap",
 "VariantAnnotation", "MungeSumstats"
 ), update = FALSE, ask = FALSE)'
Install GitHub Packages

Install specialized packages from GitHub repositories:

# Install GitHub packages
Rscript -e 'devtools::install_github("MRCIEU/CheckSumStats")'
Rscript -e 'devtools::install_github("qingyuanzhao/mr.raps")'
Rscript -e 'devtools::install_github("mrcieu/gwasglue")'
Rscript -e 'devtools::install_github("WSpiller/MVMR", build_opts = c("--no-resave-data", "--no-manual"), build_vignettes = FALSE)'
Rscript -e 'devtools::install_github("jrs95/geni.plots", build_vignettes = FALSE)'
Rscript -e 'devtools::install_github("boxiangliu/locuscomparer")'
Rscript -e 'remotes::install_version("RcppEigen", version = "0.3.3.9.3")'
Rscript -e 'remotes::install_github("jrs95/hyprcoloc", build_vignettes = FALSE)'
Rscript -e 'remotes::install_github("xingabao/MRanalysisBase")'
Rscript -e 'remotes::install_github("xingabao/GWASkitR")'
Install Third-Party Tools

Compile and install additional analysis tools:

# Install PWCoCo
mkdir -p /tools
cd /tools
git clone https://github.com/jwr-git/pwcoco.git
cd pwcoco
mkdir build && cd build
cmake ..
make

# Install CAVIAR
cd /tools
git git clone https://github.com/fhormoz/caviar.git
cd caviar/CAVIAR-C++
sudo update-alternatives --set gcc /usr/bin/gcc-9
make

# Install bcftools
wget -O /tmp/bcftools-1.22.tar.bz2 https://github.com/samtools/bcftools/releases/download/1.22/bcftools-1.22.tar.bz2
tar -xvjf /tmp/bcftools-1.22.tar.bz2 -C /tools
cd /tools/bcftools-1.22
./configure --prefix=/tools/bcftools-1.22
sudo update-alternatives --set gcc /usr/bin/gcc-13
make -j
make install

# Install PLINK
wget -O /tmp/plink_linux_x86_64.zip https://s3.amazonaws.com/plink1-assets/dev/plink_linux_x86_64.zip
mkdir -p /tools/plink
unzip /tmp/plink_linux_x86_64.zip -d /tools/plink

# Install MAGMA
wget -O /tmp/magma_v1.10.zip https://vu.data.surfsara.nl/index.php/s/zkKbNeNOZAhFXZB/download
mkdir -p /tools/magma_v1.10
unzip /tmp/magma_v1.10.zip -d /tools/magma_v1.10

Most commands require root or sudo privileges.

For additional configuration or troubleshooting, please refer to the documentation of each individual tool.

Install and Run MRanalysis
# 1. Change permissions for the Shiny Server directory
chmod 777 /srv/shiny-server/

# 2. Move into the Shiny Server web directory
cd /srv/shiny-server/

# 3. Clone the MRanalysis repository
git clone https://github.com/xingabao/MRanalysis.git

# 4. Move all contents (including .git) to /srv/shiny-server root
mv MRanalysis/* .
mv MRanalysis/.git .

# 5. Copy required extdata files for MRanalysisBase
cp -r /usr/local/lib/R/site-library/MRanalysisBase/extdata /srv/shiny-server/XINGABAO

# 6. Restart Shiny Server to apply changes
sudo systemctl restart shiny-server

Access the platform at http://127.0.0.1:8001

📚 Reference Data Requirements

The following reference datasets and files are required for the correct functioning of MRanalysis tools. Please download them manually from their official sources.

🧬

PLINK Reference Panel

1000 Genomes Phase 3 reference panel in PLINK binary format (.bed, .bim, .fam)

📥 Download 1kg.v3.tgz

Extract to: /references/plink/1kg.v3/

🔬

MAGMA Binary Files

Binary reference panel files for MAGMA gene and gene-set analysis

📥 Download from MAGMA

Extract to: /references/MAGMA/bfile/

📋

MAGMA Reference Files

Gene annotation and location files for SNP-to-gene mapping

📥 Download from MAGMA

Extract to: /references/MAGMA/reference/

🗂️

MSigDB Gene Sets

Molecular Signatures Database gene sets for enrichment analysis

📥 Download from MSigDB

Extract to: /references/MAGMA/msigdb/

📁 Directory Structure

Ensure your reference directory is organized as follows:

/references/
├── plink/
  └── 1kg.v3/
    ├── EUR.bed, EUR.bim, EUR.fam
    ├── AFR.bed, AFR.bim, AFR.fam
    └── ... (other populations)
└── MAGMA/
  ├── bfile/
  │  └── g1000_eur/
  │  ├── g1000_afr/
  │  └── ... (other populations)
  ├── reference/
  │  └── NCBI37.3/
  │  ├── NCBI38/
  │  ├── NCBI36.3/
  │  └── dbsnp151.synonyms/
  └── msigdb/
    └── c2.all.v2023.2.Hs.entrez.gmt
    ├── msigdb.v2024.1.Hs.entrez.gmt
    └── ... (other msigdb references)