Install binaries from Bioconductor

Binary installation is available through the Bioconductor package repository. Binary installation of the current release version (1.8) requires R 3.5.0 and Bioconductor version 3.7:

## try http:// if https:// URLs are not supported
source("https://bioconductor.org/biocLite.R")
biocLite("dada2")

If the above installed an early version of dada2 (e.g. 1.4 or 1.6) you can get the current dada2 release by updating to Bioconductor 3.7: biocLite("BiocUpgrade") then biocLite(). This may require updating R as well.

Install from source

Source installation is available for R 3.2 or later, and the latest and greatest features will be available first through source installs of the development branch.

1. Install External Dependencies

The following instructions assume that you have installed R and have installed Xcode (Mac) or Rtools (Windows); as well as Bioconductor.

For Bioconductor, start a fresh R session, and enter the following.

source("http://bioconductor.org/biocLite.R")
biocLite("ShortRead", suppressUpdates = FALSE)

2. Install using devtools

The easiest method is to use the devtools package to install from github:

biocLite("devtools")
library("devtools")
devtools::install_github("benjjneb/dada2")

If that worked you’re done (see step 4)! If it failed on missing dependencies, goto step 2.

2a. Install manually from source

Alternatively, you can install from the source by hand. First download the zipped package and unzip it (or expand the tarball).

Start a fresh R session, and enter the following.

install.packages("path/to/dada2",
repos = NULL,
type = "source",
dependencies = c("Depends", "Suggests","Imports"))

For example, if the dada2 source code directory was in ~/github/dada2, then the following would work.

install.packages("~/github/dada2",
repos = NULL,
type = "source",
dependencies = c("Depends", "Suggests","Imports"))

Check Package Version

packageVersion("dada2")
## [1] '1.8.0'

3. Troubleshoot Dependencies (Optional)

At this point, there may be complaints about missing dependencies. To install missing dependencies on either CRAN or Bioconductor, start a fresh R session, and enter the following.

source("http://bioconductor.org/biocLite.R")
biocLite("missing_package_1")
biocLite("missing_package_2")
# ... and so on

Install again, after dependencies have been installed.

Devtools method:

library("devtools")
devtools::install_github("benjjneb/dada2")

Manual install from source method:

install.packages("path/to/dada2",
repos = NULL,
type = "source",
dependencies = c("Depends", "Suggests","Imports"))

You should now be done, if installation was successful. If not, do not panic, and post a message to the issue tracker.

5. Load Package, Explore Function Documentation

library("dada2")
## Warning: package 'Rcpp' was built under R version 3.4.4

Now that the package is loaded, you can explore the documentation using the R help system.

help(package="dada2")
?derepFastq
?dada