美文网首页生信问
下载bioconductor的包掉坑总结

下载bioconductor的包掉坑总结

作者: 看远方的星 | 来源:发表于2019-03-01 17:14 被阅读36次
  • 下载bioconductor的包一直用的是三部曲策略,但是最近问题不断,才知道人家已经更新换代了,现在只需要两步就可以了,而且在这个出坑的同时也发现在bioconductor的官网提问的便捷性。
  • 以前的三部曲:
source("http://bioconductor.org/biocLite.R") ##安装BiocInstaller
options(BioC_mirror=”[http://mirrors.ustc.edu.cn/bioc/](http://mirrors.ustc.edu.cn/bioc/)“)  #如果需要切换镜像
biocLite("org.Hs.eg.db")  # 下载相应的bioconductor的包
  • 现在的两部曲:
options(BioC_mirror=”[http://mirrors.ustc.edu.cn/bioc/](http://mirrors.ustc.edu.cn/bioc/)“)  #如果需要切换镜像
BiocManager::install('org.Hs.eg.db')  #下载相应的包

下载bioconductor的org.Hs.eg.db中掉的坑:

第一步,发现下载方式更新换代了,需要使用BiocManager::install来下载包。

> source("http://bioconductor.org/biocLite.R")
Bioconductor version 3.8 (BiocInstaller 1.32.1), ?biocLite for help
Warning message:
'BiocInstaller' and 'biocLite()' are deprecated, use the 'BiocManager' CRAN package
  instead. 

第二步,没问题。

> options(BioC_mirror="http://mirrors.ustc.edu.cn/bioc/")

第三步,下载依赖包没问题,但是下载org.Hs.eg.db的包却报错,且说明是依赖包错误

> BiocInstaller::biocLite('org.Hs.eg.db')
BioC_mirror: http://mirrors.ustc.edu.cn/bioc/
Using Bioconductor 3.8 (BiocInstaller 1.32.1), R 3.5.2 (2018-12-20).
Installing package(s) ‘org.Hs.eg.db’
also installing the dependencies ‘BH’, ‘plogr’, ‘BiocGenerics’, ‘Biobase’, ‘IRanges’, ‘DBI’, ‘RSQLite’, ‘S4Vectors’, ‘AnnotationDbi’

trying URL 'http://cran.rstudio.com/bin/windows/contrib/3.5/BH_1.69.0-1.zip'
Content type 'application/zip' length 19008161 bytes (18.1 MB)
downloaded 18.1 MB
#避免冗长一些依赖包下载路径就不贴出来了。
trying URL 'http://mirrors.ustc.edu.cn/bioc//packages/3.8/bioc/bin/windows/contrib/3.5/AnnotationDbi_1.44.0.zip'
Content type 'application/zip' length 5258893 bytes (5.0 MB)
downloaded 5.0 MB
package ‘BH’ successfully unpacked and MD5 sums checked
package ‘plogr’ successfully unpacked and MD5 sums checked
package ‘BiocGenerics’ successfully unpacked and MD5 sums checked
package ‘Biobase’ successfully unpacked and MD5 sums checked
package ‘IRanges’ successfully unpacked and MD5 sums checked
package ‘DBI’ successfully unpacked and MD5 sums checked
package ‘RSQLite’ successfully unpacked and MD5 sums checked
package ‘S4Vectors’ successfully unpacked and MD5 sums checked
package ‘AnnotationDbi’ successfully unpacked and MD5 sums checked  
 #AnnotationDbi这个包下载没有出现问题。
The downloaded binary packages are in
    C:\Users\飘落的枫叶\AppData\Local\Temp\Rtmp84QAPx\downloaded_packages
#问题来了:
installing the source package ‘org.Hs.eg.db’

trying URL 'http://mirrors.ustc.edu.cn/bioc//packages/3.8/data/annotation/src/contrib/org.Hs.eg.db_3.7.0.tar.gz'
Content type 'application/gzip' length 77962833 bytes (74.4 MB)
downloaded 74.4 MB

ERROR: dependency 'AnnotationDbi' is not available for package 'org.Hs.eg.db'
* removing 'C:/Users/飘落的枫叶/Documents/R/win-library/3.5/org.Hs.eg.db'
In R CMD INSTALL

The downloaded source packages are in
    ‘C:\Users\飘落的枫叶\AppData\Local\Temp\Rtmp84QAPx\downloaded_packages’
Warning messages:
1: 'BiocInstaller::biocLite' is deprecated.
Use 'BiocManager::install' instead.
See help("Deprecated") 
2: In install.packages(pkgs = doing, lib = lib, ...) :
  installation of package ‘org.Hs.eg.db’ had non-zero exit status
  • 提示ERROR: dependency 'AnnotationDbi' is not available for package 'org.Hs.eg.db',但是上面显示下载没有任何出错的地方。后来就删除AnnotationDbi再独立下载这个包再下载org.Hs.eg.db,还是出现相同的报错,最后在网上实在找不到解决方案,就怀疑是中文路径的问题,就重装了系统,重装了最新的R和Rstudio,解决了中文路径的问题。
  • 然后,出现了三个ERROR。。。。当时我的眼里只有两个error(AnnotationDbi和org.Hs.eg.db)条件反射啊,折腾这个太久了,现在眼里只有这两货了,下载AnnotationDbi还是一直报错,真的心如死灰了(但是问题很简单就是没下载DBI依赖包),在谷歌的同时发现了这个网站—bioconductor的社区,硬着头皮注册登录,提问,没想到不到半个小时就有人回答了,让我下载AnnotationDbi和DBl两个依赖包,我才发现漏了一个DBl依赖包,下载成功后,再下载org.Hs.eg.db就成功了。
  • 存在中文路径时,报错AnnotationDbi,但是下载没有出现错误,删除AnnotationDbi包,重下后还是报错可能是因为中文路径的问题,因为AnnotationDbi和DBl两个包下载时没有提示出错,到下载org.Hs.eg.db才报错('AnnotationDbi' is not available)。

教训:

1、存放包的路径避免有中文。
2、不管发生什么,折腾多久,都要细心,不要有遗漏,仔细看清楚报错的代码。
3、自己实在解决不了,学会提问,比如到bioconductor的社区提问。

> BiocManager::install('org.Hs.eg.db')
Bioconductor version 3.8 (BiocManager 1.30.4), R 3.5.2 (2018-12-20)
Installing package(s) 'org.Hs.eg.db'
installing the source package ‘org.Hs.eg.db’

trying URL 'http://mirrors.ustc.edu.cn/bioc//packages/3.8/data/annotation/src/contrib/org.Hs.eg.db_3.7.0.tar.gz'
Content type 'application/gzip' length 77962833 bytes (74.4 MB)
downloaded 74.4 MB

* installing *source* package 'org.Hs.eg.db' ...
** R
** inst
** byte-compile and prepare package for lazy loading
Error: package or namespace load failed for 'AnnotationDbi' in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
 there is no package called 'DBI'  #细心啊,关键在这里!
Error : package 'AnnotationDbi' could not be loaded
ERROR: lazy loading failed for package 'org.Hs.eg.db'
* removing 'C:/Users/lijian/Documents/R/win-library/3.5/org.Hs.eg.db'
In R CMD INSTALL

The downloaded source packages are in
    ‘C:\Users\lijian\AppData\Local\Temp\RtmpK8ZzUf\downloaded_packages’
installation path not writeable, unable to update packages: class, codetools, mgcv
Warning message:
In install.packages(pkgs = doing, lib = lib, repos = repos, ...) :
  installation of package ‘org.Hs.eg.db’ had non-zero exit status

解决办法:> BiocManager::install('DBI')
> BiocManager::install("AnnotationDbi")再重新下载org.Hs.eg.db就成功了。

> BiocManager::install('org.Hs.eg.db')
Bioconductor version 3.8 (BiocManager 1.30.4), R 3.5.2 (2018-12-20)
Installing package(s) 'org.Hs.eg.db'
installing the source package ‘org.Hs.eg.db’

trying URL 'http://mirrors.ustc.edu.cn/bioc//packages/3.8/data/annotation/src/contrib/org.Hs.eg.db_3.7.0.tar.gz'
Content type 'application/gzip' length 77962833 bytes (74.4 MB)
downloaded 74.4 MB

* installing *source* package 'org.Hs.eg.db' ...
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
  converting help for package 'org.Hs.eg.db'
    finding HTML links ... 好了
    org.Hs.egACCNUM                         html  
    org.Hs.egALIAS2EG                       html  
    org.Hs.egBASE                           html  
    org.Hs.egCHR                            html  
    org.Hs.egCHRLENGTHS                     html  
    org.Hs.egCHRLOC                         html  
    org.Hs.egENSEMBL                        html  
    org.Hs.egENSEMBLPROT                    html  
    org.Hs.egENSEMBLTRANS                   html  
    org.Hs.egENZYME                         html  
    org.Hs.egGENENAME                       html  
    org.Hs.egGO                             html  
    org.Hs.egMAP                            html  
    org.Hs.egMAPCOUNTS                      html  
    org.Hs.egOMIM                           html  
    org.Hs.egORGANISM                       html  
    org.Hs.egPATH                           html  
    org.Hs.egPFAM                           html  
    org.Hs.egPMID                           html  
    org.Hs.egPROSITE                        html  
    org.Hs.egREFSEQ                         html  
    org.Hs.egSYMBOL                         html  
    org.Hs.egUCSCKG                         html  
    org.Hs.egUNIGENE                        html  
    org.Hs.egUNIPROT                        html  
    org.Hs.eg_dbconn                        html  
** building package indices
** testing if installed package can be loaded
*** arch - i386
*** arch - x64
* DONE (org.Hs.eg.db)
In R CMD INSTALL

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

相关文章

网友评论

    本文标题:下载bioconductor的包掉坑总结

    本文链接:https://www.haomeiwen.com/subject/ixnduqtx.html