[Bioc-devel] Tips for using R-2.15 with BioC 2.10 and 2.11

Dan Tenenbaum dtenenba at fhcrc.org
Tue Apr 3 01:04:48 CEST 2012


Hello BioC Developers,

We want to let you know about some important changes to the way R and
Bioconductor are linked.

Up until now, there has been a new release of R and Bioconductor every
six months. Continuing this pattern, R 2.15.0 will be released on
March 30th, and Bioconductor 2.10 on April 2.

After this release, R will move to an annual release schedule. R
2.16.0 will not be released until Spring 2013.

However, Bioconductor will continue to release a new version every six months.

In the past, a given release of Bioconductor was meant to work only
with one specific release of R.

It was easy for us to make sure a user was running the appropriate
version of Bioconductor: we'd just check their version of R and then
make sure that the corresponding Bioconductor packages were being
installed.

We can no longer do that, because R 2.15 is the correct version of R
for both BioC 2.10 and 2.11.

Starting with the release of R 2.15 and Bioconductor 2.10, we will use
the version number of the BiocInstaller package to determine whether
to install release or devel Bioconductor packages. Since "y" in an
x.y.z package version is always even in release versions and odd in
devel versions (see
http://bioconductor.org/developers/version-numbering/), if a release
version of BiocInstaller is installed, it will install packages from
the release version of the BioC repository, e.g.
http://bioconductor.org/packages/2.10. If a devel version of
BiocInstaller is installed, it will install packages from our devel
repository, e.g. http://bioconductor.org/packages/2.11.

By default, when you install R 2.15.0 and
source("http://bioconductor.org/biocLite.R")
the release version of BiocInstaller will be installed, and all
packages you install with biocLite() will be BioC 2.10 packages.

If this is not what you want, you should immediately run the
useDevel(TRUE) function. This will upgrade BiocInstaller to the devel
version. From that point on, anything installed by biocLite() will be
installed from our devel repository. useDevel() should be run only
once, with a brand new R 2.15.0. (Do not use this function with any
kind of pre-release version of R.)

The information in this email is also contained in the ?useDevel
man page, from BiocInstaller 1.3.11.

As developers, you will probably want to maintain both release and
devel versions of BioC on your machine. Here's how to do it:

The trick is to use the R_LIBS_USER environment variable to tell R
where to look for and install packages.

Let's say that when working with "release" BioC (2.10), you want all
packages to be installed in one location (example locations suggested
here for consistency):

Mac OS:
~/Library/R/2.15-bioc-release/library

Windows:
C:\Users\YOUR_USER_NAME\Documents\R\win-library\2.15-bioc-release
(change YOUR_USER_NAME to your user name)

Linux:
~/R/x86_64-unknown-linux-gnu-library/2.15-bioc-release

When working with "devel" BioC (2.11), you want your packages to be
stored in a different directory:

Mac OS:
~/Library/R/2.15-bioc-devel/library

Windows:
C:\Users\YOUR_USER_NAME\Documents\R\win-library\2.15-bioc-devel
(change YOUR_USER_NAME to your user name)

Linux:
~/R/x86_64-unknown-linux-gnu-library/2.15-bioc-devel

So create both directories and then invoke "bioc-release" R as follows:


Mac OS X:
R_LIBS_USER=~~/Library/R/2.15-bioc-release/library R

Windows:
cmd /C "set R_LIBS_USER=C:\Users\YOUR_USER_NAME\Documents\R\win-library\2.15-bioc-release
&&  R"
(Note: this assumes that R.exe is in your PATH.)

Linux:
R_LIBS_USER=~/R/x86_64-unknown-linux-gnu-library/2.15-bioc-release R

Invoke "bioc-devel" R like this:

Mac OS X:
R_LIBS_USER=~/Library/R/2.15-bioc-devel/library R

Windows:
cmd /C "set R_LIBS_USER=C:\Users\YOUR_USER_NAME\Documents\R\win-library\2.15-bioc-devel
&&  R"

Linux:
R_LIBS_USER=~/R/x86_64-unknown-linux-gnu-library/2.15-bioc-devel R


If you do
.libPaths()
within R, you'll see that the first item is your special release or
devel directory. Packages will be installed to that directory and that
is the first place that library() will look for them. biocLite(),
install.packages(), update.packages() and friends all respect this
setting.

As long as you invoke R in this way you should be able to use "R for
use with bioc-devel"  separately from  "R for use with bioc-release".

On Linux and Mac OS X, You can create bash aliases (called e.g. Rdevel
and Rrelease) that will invoke the command line above. (Note that the
"devel" in "Rdevel" refers not to the development version of R, but to
that of Bioconductor; slightly confusing). Put the following in
~/.bash_profile:

# Mac OS X
alias Rdevel='R_LIBS_USER=~/Library/R/2.15-bioc-devel/library R'
alias Rrelease='R_LIBS_USER=~/Library/R/2.15-bioc-release/library R'

# Linux
alias Rdevel='R_LIBS_USER=~/R/x86_64-unknown-linux-gnu-library/2.15-bioc-devel
R'
alias Rrelease='R_LIBS_USER=~/R/x86_64-unknown-linux-gnu-library/2.15-bioc-release
R'

You can then invoke these from the command line as
Rdevel
...and...
Rrelease

On Windows, you can create two shortcuts, one for devel and one for
release. Go to My Computer and navigate to a directory that is in your
PATH. Then right-click and choose New->Shortcut.

in the "type the location of the item" box, put:
cmd /C "set R_LIBS_USER=C:\Users\YOUR_USER_NAME\Documents\R\win-library\2.15-bioc-release
&&  R"
...for release and
cmd /C "set R_LIBS_USER=C:\Users\YOUR_USER_NAME\Documents\R\win-library\2.15-bioc-devel
&&  R"
...for devel.

(again, it's assumed R.exe is in your PATH)
Click "Next".
In the "Type a name for this shortcut" box, type
Rdevel
or
Rrelease

You can invoke these from the command line as
Rdevel.lnk
...and...
Rrelease.lnk
(You must type in the .lnk extension.)

Because R_LIBS_USER is an environment variable, its value should be
inherited by any subprocesses started by R, so they should do the
right thing as well.

Please let us know if you have any questions, concerns, or suggestions
about this.

Thanks,
Dan



More information about the Bioc-devel mailing list