Linux安装R包TwoSampleMR遇见的报错

          最近一位老友在倒腾GWAS的研究,发现R包TwoSampleMR用于pQTL的分析,让我在Linux系统上帮忙安装下,根据网页的安装提示进行操作(https://github.com/MRCIEU/epigraphdb-pqtl/),在操作过程中遇见了一些报错和实践的解决方案,在此文特此记录:

library(devtools)

install_github("MRCIEU/TwoSampleMR")

运行后出现报错信息如下:

ERROR: dependencies ‘MendelianRandomization’, ‘Cairo’ are not available for package ‘TwoSampleMR’

* removing ‘~/Bin/miniconda3/lib/R/library/TwoSampleMR’

Warning messages:

1: In i.p(...) : installation of package ‘glue’ had non-zero exit status

2: In i.p(...) : installation of package ‘gmp’ had non-zero exit status

3: In i.p(...) : installation of package ‘Cairo’ had non-zero exit status

4: In i.p(...) :

  installation of package ‘arrangements’ had non-zero exit status

5: In i.p(...) : installation of package ‘iterpc’ had non-zero exit status

6: In i.p(...) :

  installation of package ‘MendelianRandomization’ had non-zero exit status

7: In i.p(...) :

  installation of package ‘~/temp/RtmpwR6Uxt/filea00734c4661c/TwoSampleMR_0.5.6.tar.gz’ had non-zero exit status

解决步骤1:

        重新安装gmp,最初开始用BiocManager::install("gmp"),出现报错信息“configure: error: GNU MP not found, or not 4.1.4 or up, see http://gmplib.org”,查阅资料过后解决方案用conda安装gmp,操作命令如下

conda install -c conda-forge r-gmp

解决步骤2:

      接下来重新安装iterpc,用BiocManager::install("iterpc")成功安装

解决步骤3:

     接下来重新安装Cairo,用BiocManager::install("Cairo"),出现报错信息“configure: error: Cannot use cairo-ft backend, although cairo claims it is working. Please check your caito installation and/or update cairo if necessary or set CAIRO_CFLAGS/CAIRO_LIBS accordingly.”,查阅资料后改用conda安装,操作命令如下

conda install -c r r-cairo

解决步骤4:

      最后重新运行install_github("MRCIEU/TwoSampleMR")安装TwoSampleMR,成功安装,library导入后,出现如下信息。

> 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

你可能感兴趣的:(Linux安装R包TwoSampleMR遇见的报错)