MRZhou 简化孟德尔随机化分析

MRZhou 简化孟德尔随机化分析

MRZhou 是一款专为医学研究者打造的 R 包,旨在进一步简化孟德尔随机化(MR)分析。它集成了 TwoSampleMR、MRpresso 及 coloc 等主流包,支持 IEU GWAS 和 FinnGen 等本地数据的快速分析。

MRZhou

This R package is designed for the convenience of medical professionals, aiming to further simplify the analysis methods of Mendelian randomization (MR). It is integrated based on the TwosampleMR, MRpresso, and coloc packages. Therefore, whether it is the online data of the IEU GWAS database or local GWAS data (such as FinnGen database), this package can be conveniently executed. This package also includes: GSMR analysis, SMR analysis methods, etc. TWAS/Fusion analysis function method is under development.

When using this MRZhou package, it is recommended to first learn the basic syntax of TwosampleMR.

Installation

You can install the development version of MRZhou from GitHub with:

# install.packages("devtools")
devtools::install_github("fangzhoufan/MRZhou")

Example

This is a basic example which shows you how to solve a common problem:

1.Exposure and Outcome

Let’s identify the instrumental variables (IVs) for BMI and extract the BMI-associated SNPs from the CAD (coronary artery disease) outcome GWAS data.

library(MRZhou)
exp <- extract_instruments(outcomes = "ieu-a-2")
out <- extract_instruments(outcomes = "ieu-a-7")

The above two functions are based on the TwosampleMR package, and detailed information can be found in the tutorial.

If you would like to use the FinnGen database, you can follow: exposure:

library(MRZhou)
data("finngenR9")
data("finngenR10")
# exp<-read_finngen_exposure('BMI','finngen_R10_BMI_IRN.gz', 290820, p_threshold = 5e-08)
# out<-read_finngen_outcome(exp, 'CAD', 'finngen_R10_I9_IHD.gz', 412181)

2. IVW analysis (main analysis method)

dat <- harmonise_data(exp, out)
result <- IVW_fix_random(dat)
test <- mr_test(dat)
presso <- MRpresso(dat)
resall <- combine_results(result, test, presso)

The resall dataframe is all of the MR methods results (including: MRpresso), Heterogeneity statistics and Horizontal pleiotropy results

3.Plot

## Not include MRpresso method results
forest_plot <- forest_plot(result)

## Include MRpresso method results
result2 <- combine_results(result, NULL, presso)
forest_plot <- forest_plot(result2)

4.Other Visualization

  • Volcano plot
volcano_plot <- volcano_plot(result)
  • Circle plot
circle_plot <- circle_plot(result)

Comments

No comments yet. Why don’t you start the discussion?

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注