简体   繁体   English

R如何安装指定版本的生物导体包?

[英]R how to install a specified version of a bioconductor package?

The current version of the package I would like to use is failing on bioconductor.我想使用的当前版本的包在 bioconductor 上失败了。 Yet, the old version used to work.然而,旧版本曾经可以工作。
I am wondering how one can install a specific version of a bioconductor package?我想知道如何安装特定版本的生物导体包?
Thanks in advance.提前致谢。

In my case, the package is called biomaRt and the failing version is 2.34.2 while 2.34.0 is successful.在我的例子中,这个包叫做 biomaRt,失败的版本是 2.34.2 而 2.34.0 是成功的。

Important Update : The year is 2022, I strongly encourage you to switch to a programming language that is used in the enterprise.重要更新:今年是 2022 年,我强烈建议您切换到企业中使用的编程语言。 Unlike R, the software used in enterprise do have non-functional requirements allowing them to be used in real-life scenarios.与 R 不同,企业中使用的软件确实具有非功能性要求,可以在现实生活场景中使用。 Check for example the technologies used in Instagram/Twitter/Dropbox/Reddit's back-end services and what were their motivations in choosing those technologies.例如,检查 Instagram/Twitter/Dropbox/Reddit 的后端服务中使用的技术,以及他们选择这些技术的动机。 This is already a good start.这已经是一个好的开始。

Bioconductor stores the package archives here:https://bioconductor.org/packages/3.6/bioc/src/contrib/Archive/ Bioconductor 在此处存储包档案:https ://bioconductor.org/packages/3.6/bioc/src/contrib/Archive/

1) Locate and download the version you would like to install. 1) 找到并下载您要安装的版本。
2) Install it using R CMD INSTALL yourpackage_version_x.yztar.gz as suggested by Eugène Adell in the comments. 2) 按照 Eugène Adell 在评论中的建议,使用 R CMD INSTALL yourpackage_version_x.yztar.gz 安装它。
If you cannot find the specific version on the bioconductor archive, then try to find it on the github repository of the package.如果您在 bioconductor 存档中找不到特定版本,请尝试在包的 github 存储库中找到它。

The version of DESeq2 package I wanted is 1.24 and is located in Bioconductor release version 3.9.我想要的DESeq2包版本是 1.24,位于 Bioconductor 版本 3.9 中。 The current release version of Bioconductor is 3.10 and DESeq2 version is 1.26. Bioconductor 的当前发布版本是 3.10, DESeq2版本是 1.26。

Doing a BiocManager::install("DESeq2") would thus yield version 1.26.因此,执行BiocManager::install("DESeq2")将产生版本 1.26。 To get my desired version, I had to install packages compatible with Bioconductor release of 3.9 using为了获得我想要的版本,我必须安装与 Bioconductor 3.9 版本兼容的软件包,使用

BiocManager::install(version = "3.9")

and then接着

BiocManager::install("DESeq2", version = "3.9")

This is from part of my sessionInfo() .这是来自我的sessionInfo()的一部分。 Notice the correct version of DESeq2.注意正确版本的 DESeq2。

> sessionInfo()
R version 3.6.2 (2019-12-12)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: Fedora 31 (Workstation Edition)

Matrix products: default
BLAS/LAPACK: /usr/lib64/R/lib/libRblas.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=sl_SI.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=sl_SI.UTF-8    LC_MESSAGES=en_US.UTF-8    LC_PAPER=sl_SI.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=sl_SI.UTF-8 LC_IDENTIFICATION=C       

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

other attached packages:
 [1] data.table_1.13.2           DESeq2_1.24.0               SummarizedExperiment_1.14.1 DelayedArray_0.10.0        
 [5] BiocParallel_1.18.1         matrixStats_0.57.0          Biobase_2.44.0              GenomicRanges_1.36.1       
 [9] GenomeInfoDb_1.20.0         IRanges_2.18.3              S4Vectors_0.22.1            BiocGenerics_0.30.0

Try adding repos = c("https://bioconductor.org/packages/3.5/bioc", "other CRAN repos that might be needed") option to the install.packages call to install Bioconductor packages from previous releases.尝试在install.packages调用中添加repos = c("https://bioconductor.org/packages/3.5/bioc", "other CRAN repos that might be needed")选项以安装以前版本的 Bioconductor 软件包。 Installing specific version from tar.gz archive isn't recommended as you might end up with mutually incompatible packages in your Bioconductor installation.不建议从 tar.gz 存档安装特定版本,因为您最终可能会在 Bioconductor 安装中使用相互不兼容的软件包。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM