rpackagebioconductorrenv

Problems installing older version of Bioconductor's mixOmics packages in R


I've spent the day trying to load the appropriate package versions in R that I saved in a renv lockfile.

I used the package RVAideMemoire which is tied in with mixOmics in bioconductor, which can't be loaded automatically using renv::restore().

I followed the steps outlined here to install the appropriate version of bioconductor (3.11) to get moxOmics version 6.12.1.

R how to install a specified version of a bioconductor package?

Unfortunately I ended up with mixOmics version 6.14.1. I attempted to load the earlier version using:

BiocManager::install("mixOmics", version = '6.12.1')

which resulted in the following error:

Error: version '6.12.1' must have two components, e.g., '3.7'

This seemed somewhat unclear, and I thought the additional ".1" at the end might be causing problems, but what I tried loading the version omitting the last ".1" as shown:

BiocManager::install("mixOmics", version = "6.12")

I got another error:

Error: unknown Bioconductor version '6.12'; see https://bioconductor.org/install

I'm at a bit of a loss here. The renv::restore() function won't complete the update as long as the mixOmics package install keeps failing, so I seem to be a bit stuck until I can get this straightened out.

EDIT Just to provide some more info for the renv error, here's the message I get:

Error: failed to retrieve package 'mixOmics' In addition: Warning messages:
1: In system2("curl", args$data(), stdout = TRUE, stderr = TRUE) : running command '"curl" --config "C:/Users/Corey/AppData/Local/Temp/RtmpuYYvKB/renv-tempdir-3d7050aa2ac3/renv-download-config-3d7076f57e1c"' had status 22
2: In downloader(url, destfile, type, request, headers) : curl: (22) The requested URL returned error: 404
3: In system2("curl", args$data(), stdout = TRUE, stderr = TRUE) : running command '"curl" --config "C:/Users/Corey/AppData/Local/Temp/RtmpuYYvKB/renv-tempdir-3d7050aa2ac3/renv-download-config-3d701ff05e24"' had status 22
4: In downloader(url, destfile, type, request, headers) : curl: (22) The requested URL returned error: 404`

After trying initial suggestion of using
options(renv.settings.bioconductor.version = "3.11") renv::install("bioc::mixOmics@6.12.1")
I got the following errors:

'getOption("repos")' replaces Bioconductor standard repositories, see '?repositories' for details replacement repositories: CRAN: https://cran.rstudio.com
Querying repositories for available binary packages ... Done!
Querying repositories for available source packages ... Done! Retrieving 'https://bioconductor.org/packages/3.12/bioc/src/contrib/Archive/mixOmics/mixOmics_6.12.1.tar.gz' ... Retrieving 'https://bioconductor.org/packages/3.12/data/annotation/src/contrib/Archive/mixOmics/mixOmics_6.12.1.tar.gz' ... Retrieving 'https://bioconductor.org/packages/3.12/data/experiment/src/contrib/Archive/mixOmics/mixOmics_6.12.1.tar.gz' ... Retrieving 'https://bioconductor.org/packages/3.12/workflows/src/contrib/Archive/mixOmics/mixOmics_6.12.1.tar.gz' ... Retrieving 'https://bioconductor.org/packages/3.12/books/src/contrib/Archive/mixOmics/mixOmics_6.12.1.tar.gz' ... Retrieving 'https://cran.rstudio.com/src/contrib/Archive/mixOmics/mixOmics_6.12.1.tar.gz' ...
Error: failed to retrieve package 'mixOmics'
In addition: There were 24 warnings (use warnings() to see them)


Solution

  • BiocManager::install() doesn't provide an interface for installing specific versions of a package. The documentation for the version argument states:

    version: 'character(1)' Bioconductor version to install, e.g., 'version = "3.8"'. The special symbol 'version = "devel"' installs the current 'development' version.

    That is, it relates to the Bioconductor version, not the package version.

    That said, you should be able to use renv to install a specific version of the package from Bioconductor. For example:

    options(renv.settings.bioconductor.version = "3.11")
    renv::install("bioc::mixOmics@6.12.1")
    

    You could also use renv::settings$bioconductor.version("3.11") to store the required version of Bioconductor as a project setting, to be used by renv during restore().

    I used the package RVAideMemoire which is tied in with mixOmics in bioconductor, which can't be loaded automatically using renv::restore().

    I'd be curious to know why renv::restore() is failing for you.

    EDIT: Based on your output, you're trying to use Bioconductor 3.12, but mixOmics 6.12.1 isn't available from that version of Bioconductor. You need to set the Bioconductor version used by renv as detailed in this answer. (You might also need to install the latest version of renv to gain support for this.)