R道话实操:使用TwoSampleMR包进行孟德尔迅速化分析

众人好,我是邓飞。

前几天一直学习孟德尔迅速化的表面学问,写了几篇博客,迷暧昧糊嗅觉初学了,今天跑代码试了试,看着效果和图表,嗅觉意会更久了了。果真,看书百遍,不如一练,今天共享一下实操代码。

前几天的博客:

孟德尔迅速化的术语意会

孟德尔迅速化:器用变量三大假定

从一篇孟德尔迅速化著作看MR常收效果方式

示例数据使用官网的数据,进行了小数补充,对效果进行了可视化。(https://mrcieu.github.io/TwoSampleMR/articles/introduction.html)

通盘这个词动作:

图片

动作1:提真金不怕火暴露数据的GWAS

图片

> ## 1, 安设TwoSampleMR,若是已安设,不错忽略> > # library(remotes)> # install_github("MRCIEU/TwoSampleMR")> > ## 2, 载入TwoSampleMR包> library(TwoSampleMR)> > ## 3,从数据库中提真金不怕火暴露的GWAS summary数据> exposure_dat = extract_instruments("ieu-a-2")> dim(exposure_dat)[1] 79 15

共有79行15列的暴露数据效果。

动作2:提真金不怕火结局数据的GWAS

图片

> ## 4,从数据库中提真金不怕火结局变量的的GWAS summary数据,SNP用暴露数据的效果> # Get effects of instruments on outcome> outcome_dat = extract_outcome_data(snps=exposure_dat$SNP, outcomes = "ieu-a-7")Extracting data for 79 SNP(s) from 1 GWAS(s)> dim(outcome_dat)[1] 79 16

共79行15列的结局数据,注意,这里径直使用暴露数据质控后的SNP,提真金不怕火结局数据获得的效果,是以位点数是相似的。

动作3:团结暴露数据和结局数据

图片

> ## 5,将暴露数据和结局数据团结> # Harmonise the exposure and outcome data> dat = harmonise_data(exposure_dat, outcome_dat)Harmonising Body mass index 
                                

http://langshan520.com/guanyuwomen/7966.html

QQ咨询

QQ: