【问题标题】:Can't Load R DESeq2 Library, Installed All Missing Packages and Still Have Problems无法加载 R DESeq2 库,安装了所有缺少的包,仍然有问题
【发布时间】:2016-09-12 09:28:32
【问题描述】:

我在安装和使用 R 的 DESeq2 包时遇到了一些糟糕的问题。

我在 Win7 上新安装了 R 3.3.1 和 Rstudio 0.99.903。 我尝试使用以下方法安装 DESeq2:

source("https://bioconductor.org/biocLite.R")
biocLite("DESeq2")

但它遇到了很多错误(一些依赖包的一些丢失包等......)然后我尝试通过从 CREN 下载并从 .zip 文件安装丢失的包来手动安装所有丢失的包。

然后我尝试运行一些命令,我​​希望它们的信息将有助于找到所有错误的原因: 首先是 biocLite(所有相关软件包的安装程序,在之前安装 DESeq2 软件包时一切顺利......但它是在 Linux 上)

> source("https://bioconductor.org/biocLite.R")
Bioconductor version 3.3 (BiocInstaller 1.22.3), ?biocLite for help
> biocLite()
BioC_mirror: https://bioconductor.org
Using Bioconductor 3.3 (BiocInstaller 1.22.3), R 3.3.1 (2016-06-21).
Old packages: 'GenomicRanges', 'lattice', 'mgcv', 'survival'
Update all/some/none? [a/s/n]: 
a

  There is a binary version available but the source version is later:
              binary source needs_compilation
GenomicRanges 1.24.2 1.24.3              TRUE

  Binaries will be installed
Packages which are only available in source form, and may need compilation of C/C++/Fortran:
  ‘lattice’ ‘mgcv’ ‘survival’
  These will not be installed
trying URL 'https://bioconductor.org/packages/3.3/bioc/bin/windows/contrib/3.3/GenomicRanges_1.24.2.zip'
Content type 'application/zip' length 2723057 bytes (2.6 MB)
downloaded 2.6 MB

package ‘GenomicRanges’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
    C:\Users\user\AppData\Local\Temp\Rtmp0wyDJC\downloaded_packages
> biocLite()
BioC_mirror: https://bioconductor.org
Using Bioconductor 3.3 (BiocInstaller 1.22.3), R 3.3.1 (2016-06-21).
Old packages: 'GenomicRanges', 'lattice', 'mgcv', 'survival'
Update all/some/none? [a/s/n]: 
n
> biocLite("DESeq2")
BioC_mirror: https://bioconductor.org
Using Bioconductor 3.3 (BiocInstaller 1.22.3), R 3.3.1 (2016-06-21).
Installing package(s) ‘DESeq2’
also installing the dependency ‘Rcpp’


  There is a binary version available but the source version is later:
       binary source needs_compilation
Rcpp 0.12.4.5 0.12.7              TRUE

  Binaries will be installed
trying URL 'https://bioconductor.org/packages/3.3/extra/bin/windows/contrib/3.3/Rcpp_0.12.4.5.zip'
Content type 'application/zip' length 6458713 bytes (6.2 MB)
downloaded 6.2 MB

trying URL 'https://bioconductor.org/packages/3.3/bioc/bin/windows/contrib/3.3/DESeq2_1.12.4.zip'
Content type 'application/zip' length 3937521 bytes (3.8 MB)
downloaded 3.8 MB

package ‘Rcpp’ successfully unpacked and MD5 sums checked
package ‘DESeq2’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
    C:\Users\user\AppData\Local\Temp\Rtmp0wyDJC\downloaded_packages
Old packages: 'GenomicRanges', 'lattice', 'mgcv', 'Rcpp', 'survival'
Update all/some/none? [a/s/n]: 
a

  There are binary versions available but the source versions are later:
                binary source needs_compilation
GenomicRanges   1.24.2 1.24.3              TRUE
Rcpp          0.12.4.5 0.12.7              TRUE

  Binaries will be installed
Packages which are only available in source form, and may need compilation of C/C++/Fortran:
  ‘lattice’ ‘mgcv’ ‘survival’
  These will not be installed
trying URL 'https://bioconductor.org/packages/3.3/bioc/bin/windows/contrib/3.3/GenomicRanges_1.24.2.zip'
Content type 'application/zip' length 2723057 bytes (2.6 MB)
downloaded 2.6 MB

trying URL 'https://bioconductor.org/packages/3.3/extra/bin/windows/contrib/3.3/Rcpp_0.12.4.5.zip'
Content type 'application/zip' length 6458713 bytes (6.2 MB)
downloaded 6.2 MB

package ‘GenomicRanges’ successfully unpacked and MD5 sums checked
package ‘Rcpp’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
    C:\Users\user\AppData\Local\Temp\Rtmp0wyDJC\downloaded_packages

然后尝试使用 biocLite 安装 DESeq2 包(看起来一切都很好)

> biocLite("DESeq2")
BioC_mirror: https://bioconductor.org
Using Bioconductor 3.3 (BiocInstaller 1.22.3), R 3.3.1 (2016-06-21).
Installing package(s) ‘DESeq2’
also installing the dependency ‘Rcpp’


  There is a binary version available but the source version is later:
       binary source needs_compilation
Rcpp 0.12.4.5 0.12.7              TRUE

  Binaries will be installed
trying URL 'https://bioconductor.org/packages/3.3/extra/bin/windows/contrib/3.3/Rcpp_0.12.4.5.zip'
Content type 'application/zip' length 6458713 bytes (6.2 MB)
downloaded 6.2 MB

trying URL 'https://bioconductor.org/packages/3.3/bioc/bin/windows/contrib/3.3/DESeq2_1.12.4.zip'
Content type 'application/zip' length 3937521 bytes (3.8 MB)
downloaded 3.8 MB

package ‘Rcpp’ successfully unpacked and MD5 sums checked
package ‘DESeq2’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
    C:\Users\user\AppData\Local\Temp\Rtmp0wyDJC\downloaded_packages
Old packages: 'GenomicRanges', 'lattice', 'mgcv', 'Rcpp', 'survival'
Update all/some/none? [a/s/n]: 
a

  There are binary versions available but the source versions are later:
                binary source needs_compilation
GenomicRanges   1.24.2 1.24.3              TRUE
Rcpp          0.12.4.5 0.12.7              TRUE

  Binaries will be installed
Packages which are only available in source form, and may need compilation of C/C++/Fortran:
  ‘lattice’ ‘mgcv’ ‘survival’
  These will not be installed
trying URL 'https://bioconductor.org/packages/3.3/bioc/bin/windows/contrib/3.3/GenomicRanges_1.24.2.zip'
Content type 'application/zip' length 2723057 bytes (2.6 MB)
downloaded 2.6 MB

trying URL 'https://bioconductor.org/packages/3.3/extra/bin/windows/contrib/3.3/Rcpp_0.12.4.5.zip'
Content type 'application/zip' length 6458713 bytes (6.2 MB)
downloaded 6.2 MB

package ‘GenomicRanges’ successfully unpacked and MD5 sums checked
package ‘Rcpp’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
    C:\Users\user\AppData\Local\Temp\Rtmp0wyDJC\downloaded_packages 

现在加载 DESeq2 库(错误...):

> library("DESeq2")
Loading required package: S4Vectors
Loading required package: stats4
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: ‘BiocGenerics’

The following objects are masked from ‘package:parallel’:

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ, clusterExport, clusterMap,
    parApply, parCapply, parLapply, parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from ‘package:stats’:

    IQR, mad, xtabs

The following objects are masked from ‘package:base’:

    anyDuplicated, append, as.data.frame, cbind, colnames, do.call, duplicated, eval, evalq,
    Filter, Find, get, grep, grepl, intersect, is.unsorted, lapply, lengths, Map, mapply, match,
    mget, order, paste, pmax, pmax.int, pmin, pmin.int, Position, rank, rbind, Reduce, rownames,
    sapply, setdiff, sort, table, tapply, union, unique, unsplit


Attaching package: ‘S4Vectors’

The following objects are masked from ‘package:base’:

    colMeans, colSums, expand.grid, rowMeans, rowSums

Loading required package: IRanges
Loading required package: GenomicRanges
Loading required package: GenomeInfoDb
Loading required package: SummarizedExperiment
Loading required package: Biobase
Welcome to Bioconductor

    Vignettes contain introductory material; view with 'browseVignettes()'. To cite
    Bioconductor, see 'citation("Biobase")', and for packages 'citation("pkgname")'.

Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : 
  there is no package called ‘data.table’
Error: package or namespace load failed for ‘DESeq2’

尝试安装缺少的包:

> install.packages('data.table', dependencies = TRUE)
also installing the dependencies ‘minqa’, ‘nloptr’, ‘RcppEigen’, ‘lme4’, ‘SparseM’, ‘pbkrtest’, ‘quantreg’, ‘mime’, ‘bit’, ‘gtools’, ‘car’, ‘markdown’, ‘yaml’, ‘bdsmatrix’, ‘sandwich’, ‘lmtest’, ‘chron’, ‘testthat’, ‘hexbin’, ‘fastmatch’, ‘xts’, ‘bit64’, ‘gdata’, ‘caret’, ‘knitr’, ‘curl’, ‘zoo’, ‘plm’

Packages which are only available in source form, and may need compilation of C/C++/Fortran:
  ‘minqa’ ‘nloptr’ ‘RcppEigen’ ‘lme4’ ‘SparseM’ ‘quantreg’ ‘mime’ ‘bit’ ‘gtools’ ‘markdown’
  ‘yaml’ ‘bdsmatrix’ ‘lmtest’ ‘chron’ ‘testthat’ ‘hexbin’ ‘fastmatch’ ‘xts’ ‘bit64’ ‘caret’
  ‘curl’ ‘zoo’ ‘data.table’
  These will not be installed
installing the source packages ‘pbkrtest’, ‘car’, ‘sandwich’, ‘gdata’, ‘knitr’, ‘plm’

trying URL 'https://cran.rstudio.com/src/contrib/pbkrtest_0.4-6.tar.gz'
Content type 'application/x-gzip' length 165269 bytes (161 KB)
downloaded 161 KB

trying URL 'https://cran.rstudio.com/src/contrib/car_2.1-3.tar.gz'
Content type 'application/x-gzip' length 622922 bytes (608 KB)
downloaded 608 KB

trying URL 'https://cran.rstudio.com/src/contrib/sandwich_2.3-4.tar.gz'
Content type 'application/x-gzip' length 466729 bytes (455 KB)
downloaded 455 KB

trying URL 'https://cran.rstudio.com/src/contrib/gdata_2.17.0.tar.gz'
Content type 'application/x-gzip' length 1041264 bytes (1016 KB)
downloaded 1016 KB

trying URL 'https://cran.rstudio.com/src/contrib/knitr_1.14.tar.gz'
Content type 'application/x-gzip' length 1017858 bytes (994 KB)
downloaded 994 KB

trying URL 'https://cran.rstudio.com/src/contrib/plm_1.5-12.tar.gz'
Content type 'application/x-gzip' length 1246790 bytes (1.2 MB)
downloaded 1.2 MB

ERROR: dependency 'lme4' is not available for package 'pbkrtest'
* removing 'C:/Program Files/R/R-3.3.1/library/pbkrtest'
Warning in install.packages :
  running command '"C:/PROGRA~1/R/R-33~1.1/bin/x64/R" CMD INSTALL -l "C:\Program Files\R\R-3.3.1\library" C:\Users\user\AppData\Local\Temp\Rtmp0wyDJC/downloaded_packages/pbkrtest_0.4-6.tar.gz' had status 1
Warning in install.packages :
  installation of package ‘pbkrtest’ had non-zero exit status
ERROR: dependency 'zoo' is not available for package 'sandwich'
* removing 'C:/Program Files/R/R-3.3.1/library/sandwich'
Warning in install.packages :
  running command '"C:/PROGRA~1/R/R-33~1.1/bin/x64/R" CMD INSTALL -l "C:\Program Files\R\R-3.3.1\library" C:\Users\user\AppData\Local\Temp\Rtmp0wyDJC/downloaded_packages/sandwich_2.3-4.tar.gz' had status 1
Warning in install.packages :
  installation of package ‘sandwich’ had non-zero exit status
ERROR: dependency 'gtools' is not available for package 'gdata'
* removing 'C:/Program Files/R/R-3.3.1/library/gdata'
Warning in install.packages :
  running command '"C:/PROGRA~1/R/R-33~1.1/bin/x64/R" CMD INSTALL -l "C:\Program Files\R\R-3.3.1\library" C:\Users\user\AppData\Local\Temp\Rtmp0wyDJC/downloaded_packages/gdata_2.17.0.tar.gz' had status 1
Warning in install.packages :
  installation of package ‘gdata’ had non-zero exit status
ERROR: dependencies 'markdown', 'yaml' are not available for package 'knitr'
* removing 'C:/Program Files/R/R-3.3.1/library/knitr'
Warning in install.packages :
  running command '"C:/PROGRA~1/R/R-33~1.1/bin/x64/R" CMD INSTALL -l "C:\Program Files\R\R-3.3.1\library" C:\Users\user\AppData\Local\Temp\Rtmp0wyDJC/downloaded_packages/knitr_1.14.tar.gz' had status 1
Warning in install.packages :
  installation of package ‘knitr’ had non-zero exit status
ERROR: dependencies 'pbkrtest', 'quantreg' are not available for package 'car'
* removing 'C:/Program Files/R/R-3.3.1/library/car'
Warning in install.packages :
  running command '"C:/PROGRA~1/R/R-33~1.1/bin/x64/R" CMD INSTALL -l "C:\Program Files\R\R-3.3.1\library" C:\Users\user\AppData\Local\Temp\Rtmp0wyDJC/downloaded_packages/car_2.1-3.tar.gz' had status 1
Warning in install.packages :
  installation of package ‘car’ had non-zero exit status
ERROR: dependencies 'bdsmatrix', 'zoo', 'sandwich', 'car', 'lmtest' are not available for package 'plm'
* removing 'C:/Program Files/R/R-3.3.1/library/plm'
Warning in install.packages :
  running command '"C:/PROGRA~1/R/R-33~1.1/bin/x64/R" CMD INSTALL -l "C:\Program Files\R\R-3.3.1\library" C:\Users\user\AppData\Local\Temp\Rtmp0wyDJC/downloaded_packages/plm_1.5-12.tar.gz' had status 1
Warning in install.packages :
  installation of package ‘plm’ had non-zero exit status

The downloaded source packages are in
    ‘C:\Users\user\AppData\Local\Temp\Rtmp0wyDJC\downloaded_packages’

还有会话信息:

> sessionInfo()
R version 3.3.1 (2016-06-21)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

locale:
[1] LC_COLLATE=Hebrew_Israel.1255  LC_CTYPE=Hebrew_Israel.1255    LC_MONETARY=Hebrew_Israel.1255
[4] LC_NUMERIC=C                   LC_TIME=Hebrew_Israel.1255    

attached base packages:
[1] parallel  stats4    stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] SummarizedExperiment_1.2.3 Biobase_2.32.0             GenomicRanges_1.24.2      
[4] GenomeInfoDb_1.8.7         IRanges_2.6.1              S4Vectors_0.10.3          
[7] BiocGenerics_0.18.0        BiocInstaller_1.22.3      

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.4.5       Formula_1.2-1       cluster_2.0.4       XVector_0.12.1      splines_3.3.1      
 [6] zlibbioc_1.18.0     munsell_0.4.3       BiocParallel_1.6.6  colorspace_1.2-6    lattice_0.20-33    
[11] plyr_1.8.4          tools_3.3.1         nnet_7.3-12         grid_3.3.1          gtable_0.2.0       
[16] latticeExtra_0.6-28 survival_2.39-4     Matrix_1.2-7.1      gridExtra_2.2.1     RColorBrewer_1.1-2 
[21] ggplot2_2.1.0       acepack_1.3-3.3     rpart_4.1-10        scales_0.4.0        foreign_0.8-66     
> 

因为我已经手动安装了 10 个以上的软件包,所以我认为解决方案不是继续安装丢失的软件包,因为这些软件包会丢失越来越多的软件包,而且我不会摆脱这个循环。

我也尝试了一些我在谷歌上找到的东西:

remove.packages(c("ggplot2", "data.table"))
install.packages('Rcpp', dependencies = TRUE)
install.packages('ggplot2', dependencies = TRUE)

但是安装也有错误,如果需要我可以在这里写出来。

我希望你能看到我看不到的东西并帮助我解决这个问题。

谢谢。

【问题讨论】:

  • 很抱歉,如果我错过了这个问题,这个问题很长,所以我略略略过,但我注意到早期一些软件包被报告为需要从源代码手动编译。是你做的吗? Packages which are only available in source form, and may need compilation of C/C++/Fortran: ‘lattice’ ‘mgcv’ ‘survival’ 顺便说一下,对于那些不通过 bioconductor 的人来说,可能有一个二进制安装可用。 Packages which are only available in source form, and may need compilation ...: ‘minqa’ .... These will not be installed。尝试使用pacman 安装所有这些。
  • ERROR: dependency 'lme4' is not available for package 'pbkrtest'来看你是不是先安装lme4再安装data.table?

标签: r bioinformatics bioconductor install.packages


【解决方案1】:

似乎很多包,最重要的是data.tablelme4,没有正确编译。

我建议安装data.tablelme4 以及Packages which are only available in source form, and may need compilation of C/C++/Fortran:pacman 的两条语句中表示的所有包,然后重新运行目标包的 Bioconductor 安装。

install.packages("pacman")
pacman::p_load(data.table, lme4, lattice, mgcv, survival, zoo, markdown,... <etc>)
source("https://bioconductor.org/biocLite.R")
biocLite("DESeq2")

我刚刚确认这适用于 Windows。

不过,还请注意,您在过去因镜像中断而收到 has been associated 错误。 因此,如果您仍然遇到此错误,请尝试更改您的 CRAN 镜像。 install.packages('&lt;package_name&gt;', repo='http://nbcgib.uesc.br/mirrors/cran/')

还要确保您已安装并运行 RTools.exe。

【讨论】:

  • 嘿,我尝试了你的建议,但它没有按原样工作,但我可能在你的建议的帮助下弄明白了。我所做的是 - 卸载所有内容(R、Rstudio、RTools 并删除 R 目录)以消除任何损坏的可能性。然后我重新安装了 R,然后是 Rstudio,然后是 RTools。我再次尝试使用 biocLite 进行安装,但遇到了错误,因此我更改了 CRAN 镜像。我一次又一次地遇到了丢失的包裹但是!!!现在,当我尝试安装缺少的软件包时,他们确实安装了。 3-4 次手动安装后一切正常。
  • @artembus 听起来工作量很大!很高兴现在一切都正常了。
  • 根据文档,packman::p_load 也只是执行install.packages。那么为什么它应该在这里工作呢?
  • @KonradRudolph 这是 pacman(不是 packman),你说得对,它基本上只是 install.packageslibrary 的包装器。作为包作者之一,我从不介意看到 pacman 获得一些广告,但在这里似乎没有必要,而且对于解决问题绝对不是至关重要的。作为一个不完美的软件包,使用 pacman 完全有可能以某种方式使问题变得更加复杂和难以调试,所以我建议让 OP 在问题解决之前不要使用 pacman,否则他们可能会怀疑 pacman 是否导致任何问题。
【解决方案2】:

biocLite()install.packages()(和 devtools 等价物?)检查是否安装了直接依赖项,但不检查是否安装了这些依赖项等。可能发生的事情是您设法安装了一个依赖项,但随后通过删除其中一个依赖项(手动通过remove.packages(),或更改.libPaths(),或...?了解这可能是如何发生的)。

一种解决方案是找到所有可用的包

avail = available.packages(repos=BiocInstaller::biocinstallRepos())

然后是所有依赖项

deps0 = tools::package_depenencies("DESeq2", avail)
deps = unique(unlist(deps0, use.names=FALSE))

和不满足的依赖关系

need = setdiff(deps, rownames(installed.packages()))

我会看看need,看看是否有任何见解,以便您可以纠正根本问题,而不必对其他软件包执行此过程。最后,安装问题包,也许还有 DESeq2。

biocLite(c(need, "DESeq2"))

在 Bioconductor 领域,我会检查软件包版本是否与使用中的 Bioconductor 版本一致

BiocInstaller::biocValid()

并且会在 Bioconductor 上提出更多与 Bioconductor 相关的问题support site

【讨论】:

  • 感谢您的建议,我尝试按照您所说的逐步执行此操作,但 biocLite 命令仍然会因缺少包而引发错误。幸运的是,我能够通过几个建议的解决方案来解决它。无论如何,谢谢
【解决方案3】:

这与我在 Hack-R 的评论中写的答案相同,我只是想发布一个单独的答案:

我所做的是 - 卸载所有东西(RTools 然后 RStudio 然后R,我还删除了 R 目录,因为它仍然有所有以前的库)我这样做是为了消除任何损坏的可能性。

(我强调重点):

然后我重新安装了 R,然后是 Rstudio,然后是 RTools。我再次尝试使用 biocLite 进行安装,但 遇到了缺少软件包的错误(或者安装正常,当我尝试加载 DESeq2 库时遇到了缺少软件包的错误)所以 我更改了 RStudio 中的 CRAN 镜像。我再次尝试使用 biocLite 安装并再次遇到缺少包(或者安装正常,当我尝试加载 DESeq2 库时遇到缺少包错误,我不记得了)但是!!!现在,当我尝试手动安装丢失的软件包时(使用 install.packages("missingPackage"))它们确实安装正确。最后在手动安装了 3-4 次丢失的软件包后,一切正常。

对平庸的英语感到抱歉。

我希望我帮助了某人。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-02-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多