R语言孟德尔随机化研究工具包(1)---friendly2MR

friendly2MR是孟德尔岁随机化研究中的一个重要补充工具,可以批量探索因素间的因果关系,以及快速填补缺失eaf的数据,但是存在细微差异需要注意。

复制代码
remotes::install_github("xiechengyong123/friendly2MR")
library(friendly2MR)

library(friendly2MR)
#Based on TwosampleMR, to investigate the causal relationship between multiexposure and outcome
a<-find_multiexposure_outcome(
  exposure =c("ieu-b-6","ieu-b-8","ieu-b-9"),
  outcome ="ieu-b-4965",
  write = T,
  p1 = 5e-08,
  clump = TRUE,
  p2 = 5e-08,
  r2 = 0.001,
  kb = 10000,
  LD = 0.8
)
#It can used to investigate the causal relationship between exposure and multioutcome: find_exposure_multioutcome
#It can also used to investigate the causal relationship between multiexposure and multioutcome:
memo<-find_multiexposure_multioutcome_epigraphdb(
  exposure =c("ukb-a-7"),
  outcome = c("ieu-a-7"),
  pval_threshold = 1e-05,
  write = T,
  save_path = "multi.csv"
)


#Fill in the missing effect allele
library(TwoSampleMR)
aaa<-extract_instruments(outcomes='ukb-b-8755',
                               clump=TRUE, 
                               r2=0.001,kb=10000,access_token=NULL)
eaf<-aaa$eaf.exposure
aaa$eaf.exposure<-NA
abc<-find_snp_add_eaf(exposure=aaa)
identical(eaf,abc$eaf.exposure)
#Please pay attention to differences
cb<-cbind(eaf,abc$eaf.exposure)

#To find confounders
ee1<-de("ieu-a-7")
confound<-c("body mass index","Coronary heart disease")
expo_dat_nocon<-deletion_confounding_snp(
  confound = confound,
  exposure_dat = aaa,
  query_gene = NULL,
  query_region = NULL,
  catalogue = "GWAS",
  pvalue = 5e-08,
  proxies = "None",
  r2 = 0.8,
  build = 37,
  write = TRUE,
  save_path = "MR_ivs.csv"
)
相关推荐
Tiger Z13 小时前
《R for Data Science (2e)》免费中文翻译 (第17章) --- Dates and times(2)
r语言·编程·数据科学
青春不败 177-3266-052014 小时前
基于R语言lavaan结构方程模型(SEM)实践技术应用
python·r语言·贝叶斯·生态学·结构方程·sem
itwangyang52015 小时前
人工智能药物设计和生信常用 R 包一键全自动安装脚本
开发语言·人工智能·r语言
xiao5kou4chang6kai416 小时前
R语言的贝叶斯网络模型的实践
r语言·贝叶斯网络·统计学
JicasdC123asd18 小时前
农田杂草识别与分类:基于Faster R-CNN的优化模型实践与性能分析
分类·r语言·cnn
探序基因2 天前
R语言-使用pheatmap函数画热图
开发语言·r语言
WJSKad12352 天前
Mask R-CNN托盘完整性检测与分类实战指南_3
分类·r语言·cnn
wyw00002 天前
目标检测之Fast R-CNN
目标检测·r语言·cnn
kisshuan123964 天前
【深度学习】【目标检测】基于Mask R-CNN的鱼类尾巴检测与识别
深度学习·目标检测·r语言
开开心心就好5 天前
系统管理工具,多功能隐私清理文件粉碎工具
java·网络·windows·r语言·电脑·excel·symfony