第一步,应该没什么问题。(BiocInstaller' and 'biocLite()被废弃了。以后使用这个命令下载bioconductor的包:BiocManager::install('org.Hs.eg.db')
)
> 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://cran.rstudio.com/bin/windows/contrib/3.5/plogr_0.2.0.zip'
Content type 'application/zip' length 18737 bytes (18 KB)
downloaded 18 KB
trying URL 'http://mirrors.ustc.edu.cn/bioc//packages/3.8/bioc/bin/windows/contrib/3.5/BiocGenerics_0.28.0.zip'
Content type 'application/zip' length 749094 bytes (731 KB)
downloaded 731 KB
trying URL 'http://mirrors.ustc.edu.cn/bioc//packages/3.8/bioc/bin/windows/contrib/3.5/Biobase_2.42.0.zip'
Content type 'application/zip' length 2415278 bytes (2.3 MB)
downloaded 2.3 MB
trying URL 'http://mirrors.ustc.edu.cn/bioc//packages/3.8/bioc/bin/windows/contrib/3.5/IRanges_2.16.0.zip'
Content type 'application/zip' length 2352991 bytes (2.2 MB)
downloaded 2.2 MB
trying URL 'http://cran.rstudio.com/bin/windows/contrib/3.5/DBI_1.0.0.zip'
Content type 'application/zip' length 889780 bytes (868 KB)
downloaded 868 KB
trying URL 'http://cran.rstudio.com/bin/windows/contrib/3.5/RSQLite_2.1.1.zip'
Content type 'application/zip' length 2156508 bytes (2.1 MB)
downloaded 2.1 MB
trying URL 'http://mirrors.ustc.edu.cn/bioc//packages/3.8/bioc/bin/windows/contrib/3.5/S4Vectors_0.20.1.zip'
Content type 'application/zip' length 2005904 bytes (1.9 MB)
downloaded 1.9 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
#这个包下载没有出现问题。
The downloaded binary packages are in
C:\Users\飘落的枫叶\AppData\Local\Temp\Rtmp84QAPx\downloaded_packages
image.png
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
出现问题:
image.png
尝试解决:
单独下载依赖包
> BiocInstaller::biocLite('AnnotationDbi')
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) ‘AnnotationDbi’
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 ‘AnnotationDbi’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\飘落的枫叶\AppData\Local\Temp\Rtmp84QAPx\downloaded_packages
Warning message:
'BiocInstaller::biocLite' is deprecated.
Use 'BiocManager::install' instead.
See help("Deprecated")
再试一下安装,还是依赖包问题
> 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’
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
后话:由于重装系统无法再次尝试解决,当时你如果也有这个问题的话,可以尝试和下面同样的命令即> BiocManager::install('DBI')
再> BiocManager::install('org.Hs.eg.db')
试试看。
解决无效,决定重装R及Rstudio
重装完R及Rstudio,下载biomanage的包,果然坑与我常在。
> 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")
再重新下载成功了。
> 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’
总结一下经验:
首先还是要细心一点,仔细查看报错的部分,重装系统和R及Rstudio后出现的报错其实就是两个依赖包没有下载而已,而但是我只看到了一个依赖包出错,重装系统和R及Rstudio前的报错是确实只有AnnotationDbi报错,尝试下载AnnotationDbi成功后还是没能成功,大家如果下次遇到这个问题,可以到bioconductor的官网提问,真的良心推荐,我当时遇到第二个问题也就是少安装了一个依赖包,就跑到这个官网提问,不到半个小时就有人回复了,而且很准确。
网友评论