Predefine default siteRepos for biocLite
Entering edit mode
Last seen 6.0 years ago

Is there a way to specify which siteRepos to use by default?

We have a few repositories local to our site where users can put packages.

However they are confused about this:

  • install.package(
        pkgs=c("localPackage1", "localPackage2") # will happily work
  • BiocInstaller::biocLite(
        pkgs=c("localPackage1", "localPackage2")) # will fail miserably
  • BiocInstaller::biocLite(
        pkgs=c("localPackage1", "localPackage2"),
        siteRepos = siteRepos) # will happily work

Our global Rprofile looks a little like this:

# To have predefined variable that can be used later and during R sessions
siteRepos = c(
    repo1= "http://server/repo1",
    repo2 = "http://server/repo2"
# Make the siteRepos available by default
options("repos" = c(
# Use internal bandwith so we save upstream a few bytes
options("BioC_mirror" = "http://server/bioconductor")

The problem is I don't see a way to tell biocLite about these locations so users don't have to know about it. This also breaks the user experience when they create a package that is in our custom repositories and depends on packages from Bioconductor.

Is there any way to let BiocInstaller::biocLite know about these repos, some option or other setting that will honor all the repos in options()$repos?


biocinstaller bioclite • 874 views
Entering edit mode

I'm afraid I don't have a good solution, but I can echo that I've run into the same problem in the past.  There's an explicit statement in biocinstallRepos() that temporarily removes your local repositories i.e.

    keepRepos <- c(names(biocPaths), "CRAN")
    repos <- repos[keepRepos]


I got around it by pretending my local packages were part of Bioconductor and putting them under the bioc folder in my local Bioconductor mirror.  That was sufficient for the course we were running, but it's definitely more of a hack than a satisfying solution.

Entering edit mode

Repositories are searched for packages in the order of the repositories. We could come up with a solution that places repo1 and repo2 after the Bioconductor repositories. This seems like a good solution provided the purpose of your repos is to add new packages, rather than to 'mask' existing packages.

Would that serve your purposes?


Login before adding your answer.

Traffic: 587 users visited in the last hour
Help About
Access RSS

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6