当前位置:   article > 正文

【R包安装】TwoSampleMR 两样本孟德尔随机化_twosample mr r包安装

twosample mr r包安装

在Linux中安装R包TwoSampleMR

用devtools直接安装报错

library(devtools)
devtools::install_github("MRCIEU/TwoSampleMR")

#configure: error: Header file gmp.h not found; maybe use --with-gmp-include=INCLUDE_PATH
#ERROR: configuration failed for package ‘gmp’
#* removing ‘/public/home/wx2022/miniconda3/envs/MR_r4.1.2/lib/R/library/gmp’
#ERROR: dependency ‘gmp’ is not available for package ‘arrangements’
#* removing ‘/public/home/wx2022/miniconda3/envs/MR_r4.1.2/lib/R/library/arrangements’
#ERROR: dependency ‘nloptr’ is not available for package ‘lme4’
#* removing ‘/public/home/wx2022/miniconda3/envs/MR_r4.1.2/lib/R/library/lme4’
#ERROR: dependencies ‘gmp’, ‘arrangements’ are not available for package ‘iterpc’
#* removing ‘/public/home/wx2022/miniconda3/envs/MR_r4.1.2/lib/R/library/iterpc’
#ERROR: dependency ‘lme4’ is not available for package ‘meta’
#* removing ‘/public/home/wx2022/miniconda3/envs/MR_r4.1.2/lib/R/library/meta’
#ERROR: dependency ‘iterpc’ is not available for package ‘MendelianRandomization’
#* removing ‘/public/home/wx2022/miniconda3/envs/MR_r4.1.2/lib/R/library/MendelianRandomization’
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16

解决办法

根据报错,依次安装依赖包,不能直接在R中安装的包(可能是因为版本不对)可以用conda安装

conda install -c conda-forge r-gmp
conda install -c conda-forge r-nloptr
  • 1
  • 2
install.packages("arrangements")
install.packages("lme4")
install.packages("iterpc")
install.packages("meta")
install.packages("MendelianRandomization")
  • 1
  • 2
  • 3
  • 4
  • 5

安装好依赖包以后就能成功安装TwoSampleMR包了

devtools::install_github("MRCIEU/TwoSampleMR")

library(TwoSampleMR)
#TwoSampleMR version 0.5.6
#[>] New: Option to use non-European LD reference panels for clumping etc
#[>] Some studies temporarily quarantined to verify effect allele
#[>] See news(package='TwoSampleMR') and https://gwas.mrcieu.ac.uk for further details
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

library以后显示上面的信息就说明安装成功了

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/IT小白/article/detail/574226
推荐阅读
相关标签
  

闽ICP备14008679号