无法根据 rtracklayer R3.4.0 安装 R 包

unable to install R packages depending on rtracklayer R3.4.0

我已将 mac 上的 R 更新为 R3.4.0。不幸的是,现在我无法安装任何依赖于 rtracklayer.

的生物导体包

我有 Bioc version 3.5R version 3.4.0 我已经安装了最新版本的 BiocInstaller (v. 1.26.0)。 从 bioc 安装包没有问题,例如 affy、limma 或类似的。但是只要需要 rtracklayer(所有注释包),我就会收到以下错误消息:

> biocLite("BSgenome.Rnorvegicus.UCSC.rn5")
BioC_mirror: https://bioconductor.org
Using Bioconductor 3.5 (BiocInstaller 1.26.0), R 3.4.0 (2017-04-21).
Installing package(s) ‘BSgenome.Rnorvegicus.UCSC.rn5’
installing the source package ‘BSgenome.Rnorvegicus.UCSC.rn5’

trying URL 'https://bioconductor.org/packages/3.5/data/annotation/src/contrib/BSgenome.Rnorvegicus.UCSC.rn5_1.4.0.tar.gz'
Content type 'application/x-gzip' length 614635033 bytes (586.2 MB)
==================================================
downloaded 586.2 MB

* installing *source* package ‘BSgenome.Rnorvegicus.UCSC.rn5’ ...
** R
** inst
** preparing package for lazy loading
Error: package or namespace load failed for ‘rtracklayer’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/Library/Frameworks/R.framework/Versions/3.4/Resources/library/rtracklayer/libs/rtracklayer.so':
  dlopen(/Library/Frameworks/R.framework/Versions/3.4/Resources/library/rtracklayer/libs/rtracklayer.so, 6): Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
  Referenced from: /Library/Frameworks/R.framework/Versions/3.4/Resources/library/rtracklayer/libs/rtracklayer.so
  Reason: image not found
Error : package ‘rtracklayer’ could not be loaded
ERROR: lazy loading failed for package ‘BSgenome.Rnorvegicus.UCSC.rn5’
* removing ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library/BSgenome.Rnorvegicus.UCSC.rn5’

The downloaded source packages are in
    ‘/private/var/folders/sh/kwc66sqn4x36cjf9vncy99xm0000gp/T/RtmpX7Ltad/downloaded_packages’
Warning message:
In install.packages(pkgs = doing, lib = lib, ...) :
  installation of package ‘BSgenome.Rnorvegicus.UCSC.rn5’ had non-zero exit status

我在另一个 post 中发现可以使用 R CMD otool -L path/to/rtrackalyer.so 设置 rtracklayer.so 的路径。我也试过了

R CMD otool -L /Library/Frameworks/R.framework/Versions/3.4/Resources/library/rtracklayer/libs/rtracklayer.so
/Library/Frameworks/R.framework/Versions/3.4/Resources/library/rtracklayer/libs/rtracklayer.so:
    rtracklayer.so (compatibility version 0.0.0, current version 0.0.0)
    /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5)
    /usr/local/opt/openssl/lib/libssl.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
    /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
    /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libR.dylib (compatibility version 3.4.0, current version 3.4.0)
    /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1259.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)

但是并没有解决问题。

对于解决问题的任何帮助,我将不胜感激。

谢谢

阿萨

> R.version
               _                           
platform       x86_64-apple-darwin15.6.0   
arch           x86_64                      
os             darwin15.6.0                
system         x86_64, darwin15.6.0        
status                                     
major          3                           
minor          4.0                         
year           2017                        
month          04                          
day            21                          
svn rev        72570                       
language       R                           
version.string R version 3.4.0 (2017-04-21)
nickname       You Stupid Darkness  

> sessionInfo()
R version 3.4.0 (2017-04-21)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: OS X El Capitan 10.11.6

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

other attached packages:
[1] biomaRt_2.32.0

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.10         IRanges_2.10.0       XML_3.98-1.7         digest_0.6.12       
 [5] bitops_1.0-6         DBI_0.6-1            stats4_3.4.0         RSQLite_1.1-2       
 [9] S4Vectors_0.14.0     tools_3.4.0          Biobase_2.36.0       RCurl_1.95-4.8      
[13] parallel_3.4.0       compiler_3.4.0       BiocGenerics_0.22.0  AnnotationDbi_1.38.0
[17] memoise_1.1.0   

我基本上和你在同一个系统上。我最终得到 rtracklayer 加载,但这需要毅力和阅读大量错误消息并等待。挂断是让 Rsamtools 加载,为此我删除了旧的库副本,安装 XCode 命令行工具(因为 XML 出错)并在重新启动后重新加载 source("https://bioconductor.org/biocLite.R")。我还按照 https://cran.r-project.org/bin/macosx/tools/ 安装了 clang4。不确定其中哪一个是解决方案,可能需要其中几个。

我在尝试加载 MetaboSignal Bioconductor 包时遇到了与@AssaYeroslaviz 完全相同的问题,并且还尝试了 post,其中建议更改 CMD otool -L path/to/rtrackalyer.so。但是它没有用,@42-的解决方案也没有用。安装 clang4gfortran 后,正如@42- 在 https://cran.r-project.org/bin/macosx/tools/ 中所建议的那样,我从源代码中安装了 rtrackalyer,而不是在 RStudio 中,而是直接在 RConsole 中。在 RConsole 中加载 rtracklayer 和我需要的包后,重新安装 RStudio 效果很好。我使用的代码:

     library("BiocInstaller")
     biocLite("rtracklayer", type="source")
     library("rtracklayer")

sessionInfo()

     R version 3.4.0 (2017-04-21)
     Platform: x86_64-apple-darwin15.6.0 (64-bit)
     Running under: macOS Sierra 10.12.4

     Matrix products: default
              BLAS:/Frameworks/R.framework/Versions/3.4/Resources/lib/libRblas.0.dylib
     LAPACK:/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib

     locale:
     [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

     other attached packages:
     [1] rtracklayer_1.36.0   GenomicRanges_1.28.1 GenomeInfoDb_1.12.0           IRanges_2.10.0       S4Vectors_0.14.0     BiocGenerics_0.22.0           BiocInstaller_1.26.0

     loaded via a namespace (and not attached):
      [1] XVector_0.16.0             zlibbioc_1.22.0                     GenomicAlignments_1.12.0   BiocParallel_1.10.1        lattice_0.20-35                     tools_3.4.0               
      [7] SummarizedExperiment_1.6.1 grid_3.4.0                          Biobase_2.36.2             matrixStats_0.52.2         Matrix_1.2-10                       GenomeInfoDbData_0.99.0   
     [13] bitops_1.0-6               RCurl_1.95-4.8                      DelayedArray_0.2.0         compiler_3.4.0             Biostrings_2.44.0                   Rsamtools_1.28.0          
     [19] XML_3.98-1.7

可能会有用,traceback()

     6: stop(msg, call. = FALSE, domain = NA)
     5: value[[3L]](cond)
     4: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     3: tryCatchList(expr, classes, parentenv, handlers)
     2: tryCatch({
            attr(package, "LibPath") <- which.lib.loc
            ns <- loadNamespace(package, lib.loc)
            env <- attachNamespace(ns, pos = pos, deps)
        }, error = function(e) {
            P <- if (!is.null(cc <- conditionCall(e))) 
                paste(" in", deparse(cc)[1L])
            else ""
            msg <- gettextf("package or namespace load failed for %s%s:\n %s", 
                sQuote(package), P, conditionMessage(e))
            if (logical.return) 
                message(paste("Error:", msg), domain = NA)
            else stop(msg, call. = FALSE, domain = NA)
        })
     1: library("rtracklayer")

所以我终于设法解决了我自己的问题。我仍然不确定问题出在哪里。我已经重新安装了最新版本的 R (3.4.0) / bioC (3.5) 和 RStudio (1.0.143)。 之后我下载了 rtracklayer 包并从本地 tar.gz 文件安装它。

现在它再次运行。真的不知道为什么。

R.version _
platform x86_64-apple-darwin15.6.0
arch x86_64
os darwin15.6.0
system x86_64, darwin15.6.0
status
major 3
minor 4.0
year 2017
month 04
day 21
svn rev 72570
language R
version.string R version 3.4.0 (2017-04-21) nickname You Stupid Darkness