#### The support.bioconductor.org editor has been updated to markdown! Please see more info at: Tutorial: Updated Support Site Editor

Question: Predefine default siteRepos for biocLite
0
14 months ago by
Earth
Martin Marcher0 wrote:

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.

• 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(
CRAN="http://server/internal-cranmirror",
siteRepos
))
# 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 • 320 views
modified 14 months ago • written 14 months ago by Martin Marcher0

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.

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.