Installing and Managing _Bioconductor_ Packages

knitr::opts_chunk$set(echo = TRUE)


Use the BiocManager package to install and manage packages from the Bioconductor project for the statistical analysis and comprehension of high-throughput genomic data.

Current Bioconductor packages are available on a 'release' version intended for every-day use, and a 'devel' version where new features are introduced. A new release version is created every six months. Using the BiocManager package helps users install packages from the same release.

Basic use

Use standard R installation procedures to install the BiocManager package. This command is requried only once per R installation.


Install Bioconductor (or CRAN) packages with

BiocManager::install(c("GenomicRanges", "Organism.dplyr"))

Installed packages can be updated to their current version with


Use version() to discover the version of Bioconductor currently in use.


Bioconductor packages work best when they are all from the same release. Use valid() to identify packages that are out-of-date or from unexpected versions.


valid() returns an object that can be queried for detailed information about invalid packages, as illustrated in the following screen capture

> v <- valid()
Warning message:
6 packages out-of-date; 0 packages too new
> names(v)
[1] "out_of_date" "too_new"
> head(v$out_of_date, 2)
    Package LibPath
bit "bit"   "/home/mtmorgan/R/x86_64-pc-linux-gnu-library/3.5-Bioc-3.8"
ff  "ff"    "/home/mtmorgan/R/x86_64-pc-linux-gnu-library/3.5-Bioc-3.8"
    Installed Built   ReposVer Repository
bit "1.1-12"  "3.5.0" "1.1-13" ""
ff  "2.2-13"  "3.5.0" "2.2-14" ""

Packages available for your version of Bioconductor can be discovered with available(); the first argument can be used to filter package names based on a regular expression, e.g., 'BSgenome' package available for Homo sapiens

avail <- BiocManager::available()

Questions about installing and managing Bioconductor packages should be addressed to the Bioconductor support site.

Advanced use

Changing version

Use the version= argument to update all packages to a specific Bioconductor version


Bioconductor versions are associated with specific R versions, as summarized here. To use the most recent version of Bioconductor may require installing a new version of R.

A special version, version="devel", allows use of Bioconductor packages that are under development.

Managing multiple versions

It is possible to have multiple versions of Bioconductor installed on the same computer. A best practice is to create an initial R installation. Then create and use a library for each version of Bioconductor. The library will contain all Bioconductor, CRAN, and other packages for that version of Bioconductor. We illustrate the process assuming use of Bioconductor version 3.7, available using R version 3.5

Create a directory to contain the library (replace USER_NAME with your user name on Windows)

Set the environment variable R_LIBS_USER to this directory, and invoke R. Command line examples for Linux are

Once in R, confirm that the version-specific library path has been set


On Linux and macOS, create a bash alias to save typing, e.g.,

Invoke these from the command line as Bioc3.7.

On Windows, create a shortcut. 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\USER_NAME\Documents\R\3.5-Bioc-3.7 && R"

Click "Next". In the "Type a name for this shortcut" box, type Bioc-3.7.

Try the BiocManager package in your browser

Any scripts or data that you put into this service are public.

BiocManager documentation built on May 1, 2019, 9:27 p.m.