RStudio Connect/packrat chokes on Bioconductor packages

As of R 3.6.0, Bioconductor packages need to be installed using BiocManager::install().

RStudio-connect/packrat cannot seem to handle this. The workaround I've been given is to:

  1. manually install any needed Bioc packages on the RStudio-connect server
  2. manually add these to the [Packages] section as External = <package>.

This is a major headache, especially as compared to the way that deploying to the server worked previously. Rather than my users effortlessly publishing their code, they will need to figure out the new Bioconductor packages that need special treatment, then contact me to provide this.

Has anyone found a better way? Is RStudio addressing this problem?

1 Like

I think RStudio package manager will help - you can sync the bioconductor github repos and then your users can install them like any other package.

https://support.rstudio.com/hc/en-us/articles/360016400354-Using-BioConductor-with-RStudio-Package-Manager?mobile_site=true

A post was split to a new topic: publishing my app, fails to load with error : Warning: Error in library: there is no package called ‘xxx’

Thanks for raising this to us! @iain's approach definitely works, but we would expect packrat / Connect to be able to handle this case as well. I will raise with developers so that we can address the issue!

For tracking, I have opened issues in renv and packrat:

1 Like

Any chance you can help out with a reprex here? Do you have a packrat.lock file that fails to restore and the output that it gives? rsconnect generates the lockfile with something like packrat::.snapshotImpl(".", snapshot.sources = FALSE), if that's helpful.

This solution from a separate thread worked for me when deploying bioconductor packages on connect very recently

library(BiocManager)
options(repos = BiocManager::repositories())

3 Likes

For any folks that have run into a similar issue, there are multiple options documented on the posit site now.

2 Likes

Welcome to Community @jhert! And thanks for sharing the useful link!