rstudio / rstudio/packrat

bioconductor repos are not automatically included

Open
#507 9 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
409
Forks
89
PR merge metrics
No merged PRs in 30d

Description

rsconnect uses packrat::.snapshotImpl to record dependencies for a project without having packages installed into packrat/lib. If BiocInstaller is available, it is first loaded via requireNamespace.

https://github.com/rstudio/rsconnect/blob/13a515e5401ca2c7ca990f1aca432db47ecd5d5c/R/bundle.R#L631-L643

Start with the default repository configuration in the RStudio IDE.

getOption("repos")
                       CRAN 
# => "https://cran.rstudio.com/" 
# => attr(,"RStudio")
# => [1] TRUE

Given a Shiny application in a pristine directory (no packrat directory):

library(shiny)
# Biobase depends upon BioGenerics, so we have a top-level and dependent
# package coming from Bioconductor.
library(Biobase)

server <- function(input, output, session) {}
ui <- fluidPage("bio shiny")

shiny::shinyApp(ui = ui, server = server)

Running a snapshot in the containing directory:

packrat::.snapshotImpl(project = ".", snapshot.sources = FALSE, fallback.ok = TRUE, verbose = FALSE)

The packrat.lock file produced has the preamble:

PackratFormat: 1.4
PackratVersion: 0.4.9.13
RVersion: 3.5.1
Repos: CRAN=https://cran.rstudio.com/

This is because the activeRepos function looks in the project library for BiocInstaller and does not allow for projects that have not installed their dependencies (as is the case when used for rsconnect dependency analysis).

https://github.com/rstudio/packrat/blob/4a83b7fcc5c0c92c575c40bbd8a8aba746dd66c3/R/snapshot.R#L352-L366

Workaround is to explicitly configure the repos option to the bioc repos:

options(repos = BiocInstaller::biocinstallRepos())

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the activeRepos implementation in R/snapshot.R and the dependency snapshot path referenced in R/bundle.R. Reproduce the provided pristine Shiny application case with Biobase, then inspect the generated packrat.lock repository preamble. Done means Bioconductor repositories are detected and recorded without requiring dependencies to be installed in the project library.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.