DEseq2和edgeR安装问题记录
DEseq2和edgeR 是常用的差异分析的R包,不过在安装时往往会碰到一些依赖包装不上。
 安装命令:
#在R 的交互命令行运行
if (!require("BiocManager", quietly = TRUE))
    install.packages("BiocManager")
BiocManager::install("DESeq2")
BiocManager::install("edgeR")
出现报错如下:
checking for xml2-config... no
Cannot find xml2-config
ERROR: configuration failed for package ‘XML’
* removing ‘/usr/local/lib/R/site-library/XML’
ERROR: dependency ‘RCurl’ is not available for package ‘GenomeInfoDb’
* removing ‘/usr/local/lib/R/site-library/GenomeInfoDb’
ERROR: dependencies ‘XML’, ‘RCurl’ are not available for package ‘annotate’
* removing ‘/usr/local/lib/R/site-library/annotate’
ERROR: dependency ‘GenomeInfoDb’ is not available for package ‘GenomicRanges’
* removing ‘/usr/local/lib/R/site-library/GenomicRanges’
ERROR: dependency ‘annotate’ is not available for package ‘genefilter’
* removing ‘/usr/local/lib/R/site-library/genefilter’
ERROR: dependency ‘annotate’ is not available for package ‘geneplotter’
* removing ‘/usr/local/lib/R/site-library/geneplotter’
ERROR: dependencies ‘GenomicRanges’, ‘GenomeInfoDb’ are not available for package ‘SummarizedExperiment’
* removing ‘/usr/local/lib/R/site-library/SummarizedExperiment’
ERROR: dependencies ‘GenomicRanges’, ‘SummarizedExperiment’, ‘genefilter’, ‘locfit’, ‘geneplotter’ are not available for pac                            kage ‘DESeq2’
* removing ‘/usr/local/lib/R/site-library/DESeq2’

 此时,只能一个个解决了:
 首先,针对Cannot find xml2-config ERROR: configuration failed for package ‘XML’  , 这里显示不存在xml的库,可以通过以下命令安装:
#ubuntu系统命令, 如果是centos系统使用yum安装,不过包的名字可能略有区别。
apt-get install -y libxml2-dev  
然后是解决ERROR: dependency ‘RCurl’ is not available for package ‘GenomeInfoDb’, 后面的一堆报错其实也都是由RCurl导致的连环报错,因此手动安装。
#ubuntu系统命令, 如果是centos系统使用yum安装,不过包的名字可能略有区别。
apt install libcurl4-openssl-dev
上面两个安装完后,可以看到大部分依赖包就都可以安装好了,可能还会出现ERROR: dependency ‘locfit’ is not available for package ‘DESeq2’ 的报错。此时往往是由于默认安装的locfit版本的问题导致的,所以通过指定低一点的版本(例如1.5-9.2)即可安装。
#注意:这是在R 的交互命令行上运行的哦
install.packages('https://cran.r-project.org/src/contrib/Archive/locfit/locfit_1.5-9.2.tar.gz',repos = NULL)
至此,DEseq2和edgeR的安装问题就基本上不大了。
当然,可以看到此处前两个问题的安装是需要sudo 权限的,如果没有权限的话建议还是老老实实用conda 安装这两个包吧,简单粗暴。
conda install -c bioconda bioconductor-deseq2
conda install -c bioconda bioconductor-edger










