clump的时候,报错:The query to MR-Base exceeded 300 seconds ,尝试做本地clump

clump的时候,报错:The query to MR-Base exceeded 300 seconds ,尝试做本地clump

参考了一下前人的经验,这里是参考的原文的链接

TwoSampleMR:local clump(MR-Base exceeded 300 seconds) 包括Windows和Linux R解决办法_Bioinfoer的博客-CSDN博客

下面是我自己跑的代码,在原文的基础上加了一些我的修改和解读

先安装包

devtools::install_github("mrcieu/ieugwasr",force = TRUE)

更新所有的包

library(ieugwasr)

devtools::install_github("explodecomputer/plinkbinr")

library(plinkbinr)

get_plink_exe()

下载bfile,我的GWAS是欧洲人种所以用EUR*,存到本地G盘的EUR_ref/EUR文件夹里

#http://fileserve.mrcieu.ac.uk/ld/1kg.v3.tgz

#解压该文件夹

b <- ld_clump(

dplyr::tibble(rsid=a$rsid, pval=a$p, id=a$id),

#get_plink_exe()

plink_bin = "C:/Users/Thinkpad/Documents/R/win-library/4.0/plinkbinr/bin/plink_Windows.exe",

#欧洲人群参考基因组位置

bfile = "D:/EUR_ref/EUR"

)

上面这一段代码在运行的时候又遇到了下面的报错

按照路径打开了该文件,应该就是clump没有成功,导致生成临时文件失败,在clump成功的文件里面找相应的文件也是没有的,因为这个只是一个临时生成的中间文件,只不过在这一步临时文件生成没有成功。

后面看到上文作者改了源代码

这个是源代码的网址

GitHub - MRCIEU/ieugwasr: R interface to the IEU GWAS database API

把源代码的zip下载到G盘,下载下来之后本地解压命名为ieugwasr

作者改的就是ld_matrix这个文件

用R打开,在相应的位置加上 " --threads 1 ",

然后保存,然后再本地重新安装ieugwasr

setwd("G:/ieugwasr")

devtools::install_local() 安装完成之后

library(ieugwasr)

library(plinkbinr)

get_plink_exe()

trait1.exposure_data_clumped <- ld_clump(

dplyr::tibble(rsid=trait1.exposure_data_1$SNP,

pval=trait1.exposure_data_1$pval.exposure,

id=trait1.exposure_data_1$exposure,

beta_col = trait1.exposure_data_1$beta.exposure,

se_col = trait1.exposure_data_1$se.exposure,

eaf_col = trait1.exposure_data_1$eaf.exposure),

#get_plink_exe()

plink_bin = "C:/Users/Thinkpad/Documents/R/win-library/4.0/plinkbinr/bin/plink_Windows.exe",

#欧洲人群参考基因组位置

bfile = "G:/EUR_ref/EUR"

)

运行之后,还是出现了上述的问题。

后来跟在线数据库的clump比对了一下

在线clump

编辑切换为居中

本地clump

本地clump的数据,自己在 dplyr::tibble列哪些数据才展现哪些数据,比在线的clump的数据要少一些。

然后出现前面:The query to MR-Base exceeded 300 seconds的问题,主要是我把很多exposure的snp放在一个txt文档里面,想一起做clump,后来觉得把exposure 逐个拆开,用for循环来逐个文件做clump。

  • 0
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 11
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 11
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值