双向MR分析

2024-03-16  本文已影响0人  wo_monic

双向MR:
「目的」:探究两个变量之间的双向因果关系。
「[如何工作」:分别评估两个变量作为暴露和结果的因果关系。
「应用场景」:当我们怀疑两个变量之间可能存在相互作用的时候。
[例子」:探究抑郁症是否会导致睡眠障碍,以及睡眠障碍是否会导致抑郁症。首先,使用与抑郁症关联的SNP来评估其对睡眠障碍的影响;然后,反过来评估。

下面的例子是用BMI作为暴露因素,冠心病作为结果因素。
最终的结论是BMI是导致冠心病的原因。

## 双向MR分析
rm(list = ls())
library("TwoSampleMR")
library(phenoscanner)
library(MRInstruments) ##该软件包包含许多 data.frames,其中每个都是 SNP 与性状关联的存储库。
library(ieugwasr) #一定要有这句话,否则会报错Error in r$status_code : $ operator is invalid for atomic vectors
library(tidyverse)
#remotes::install_github('MRCIEU/ieugwasr')

#exposure <- "ieu-a-2" #BMI
#outcome <- "ieu-a-7" #冠心病
#读取暴露因素数据BMI 一共79个SNP
exp_dat <- extract_instruments(outcomes = "ieu-a-2") 
#ieugwasr::tophits(id = "ieu-a-2")

#读取结局因素 冠心病
dis_dat <- extract_outcome_data(snps = exp_dat$SNP,outcomes = "ieu-a-7")

#对齐变异位点
dat <- harmonise_data(
  exposure_dat = exp_dat, 
  outcome_dat = dis_dat
)

res <- mr(dat)
res
# id.exposure id.outcome                              outcome                      exposure                    method nsnp         b         se         pval
# 1     ieu-a-2    ieu-a-7 Coronary heart disease || id:ieu-a-7 Body mass index || id:ieu-a-2                  MR Egger   79 0.5024935 0.14396056 8.012590e-04
# 2     ieu-a-2    ieu-a-7 Coronary heart disease || id:ieu-a-7 Body mass index || id:ieu-a-2           Weighted median   79 0.3870065 0.07407034 1.742956e-07
# 3     ieu-a-2    ieu-a-7 Coronary heart disease || id:ieu-a-7 Body mass index || id:ieu-a-2 Inverse variance weighted   79 0.4459091 0.05898302 4.032020e-14
# 4     ieu-a-2    ieu-a-7 Coronary heart disease || id:ieu-a-7 Body mass index || id:ieu-a-2               Simple mode   79 0.3401554 0.14934877 2.548988e-02
# 5     ieu-a-2    ieu-a-7 Coronary heart disease || id:ieu-a-7 Body mass index || id:ieu-a-2             Weighted mode   79 0.3888249 0.09824565 1.657786e-04

#可以看到b值是正值,pval都是显著的,说明BMI是导致冠心病的原因。

# mr_steiger(
#   p_exp = dat$pval.exposure, 
#   p_out = dat$pval.outcome, 
#   n_exp = dat$samplesize.exposure, 
#   n_out = dat$samplesize.outcome, 
#   r_xxo = 1, 
#   r_yyo = 1,
#   r_exp=0,
#   r_out=0
# )

out <- directionality_test(dat)
#> r.exposure and/or r.outcome not present.
#> Calculating approximate SNP-exposure and/or SNP-outcome correlations, assuming all are quantitative traits. Please pre-calculate r.exposure and/or r.outcome using get_r_from_lor() for any binary traits
knitr::kable(out)
#|id.exposure |id.outcome |exposure                                |outcome                                        | snp_r2.exposure| snp_r2.outcome|correct_causal_direction | steiger_pval|
#|:-----------|:----------|:---------------------------------------|:----------------------------------------------|---------------:|--------------:|:------------------------|------------:|
#|ieu-a-2     |ieu-a-7    |Body mass index &#124;&#124; id:ieu-a-2 |Coronary heart disease &#124;&#124; id:ieu-a-7 |       0.0158082|      0.0013505|TRUE                     |            0|

结果中结果的方差<暴露的方差,最后的correct_causal_direction 为TRUE,说明现在的暴露因素是结局变量的原因,即BMI是导致冠心病的原因。现在的方向是正确的。如果是FALSE,则是搞反了(exposure)原因和结果。

上一篇下一篇

猜你喜欢

热点阅读