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"
)
相关推荐
请你喝好果汁6411 小时前
## 学习笔记:R 语言中比例字符串的数值转换,如GeneRatio中5/100的处理
笔记·学习·r语言
怦怦蓝1 小时前
DB2深度解析:从架构原理到与R语言的集成实践
开发语言·架构·r语言·db2
新新学长搞科研2 小时前
【CCF主办 | 高认可度会议】第六届人工智能、大数据与算法国际学术会议(CAIBDA 2026)
大数据·开发语言·网络·人工智能·算法·r语言·中国计算机学会
Piar1231sdafa20 小时前
战斗车辆状态识别与分类 --- 基于Mask R-CNN和RegNet的模型实现
r语言·cnn
陳土21 小时前
R语言Offier包源码—1:read_docx()
r语言
善木科研喵21 小时前
IF5.9分,α-硫辛酸如何缓解化疗神经毒性?网络毒理学结合网络药理学双重锁定关键通路!
数据库·数据分析·r语言·sci·生信分析·医学科研
Piar1231sdafa2 天前
椅子目标检测新突破:Cascade R-CNN模型详解与性能优化_1
目标检测·r语言·cnn
Loacnasfhia92 天前
基于Mask R-CNN与RegNetX的钢水罐及未定义物体目标检测系统研究_1
目标检测·r语言·cnn
Dingdangcat862 天前
汽车表面损伤检测实战:基于Faster R-CNN与PISA优化的R50_FPN模型详解
r语言·cnn·汽车
地球资源数据云3 天前
从 DEM 到 3D 渲染:R 语言 rayshader 地形可视化全指南
3d·数据分析·r语言