ohnoplus
ohnoplus

Reputation: 1335

installing dada2 into a version of R that was installed through condas

I have an environment with R installed through condas (I currently use R with jupyter notebook, so this made sense at one point). I would like to use dada2 with this version of R.

As per this site https://anaconda.org/bioconda/bioconductor-dada2 the correct command to make this happen is

 conda install -c bioconda bioconductor-dada2 

which gives me the following error

Fetching package metadata ............. Solving package specifications: .

UnsatisfiableError: The following specifications were found to be in conflict: - bioconductor-dada2 -> bioconductor-biostrings >=2.32.1 -> bioconductor-biocgenerics >=0.15.6 -> r 3.3.1* -> r-base 3.3.1 - r-glue Use "conda info " to see the dependencies for each package.

If I run conda info package r-glue I can see that it depends on r-base 3.4.1.

Alternative approach that also doesn't work:

I also tried going into R and installing from there, but I can't get any packages to install with R packages

 source("https://bioconductor.org/biocLite.R")
 biocLite("dada2")

Gives me a really long output, but the short of it is that a bunch of the dependencies return errors

ERROR: compilation failed for package ‘RcppParallel’ * removing ‘/home/jacob/anaconda3/lib/R/library/RcppParallel’ ERROR: dependency ‘S4Vectors’ is not available for package ‘IRanges’ * removing ‘/home/jacob/anaconda3/lib/R/library/IRanges’ ERROR: dependencies ‘S4Vectors’, ‘IRanges’, ‘matrixStats’ are not available for package ‘DelayedArray’

and then more stuff and at the end

ERROR: dependencies ‘Biostrings’, ‘ShortRead’, ‘RcppParallel’ are not available for package ‘dada2’ * removing ‘/home/jacob/anaconda3/lib/R/library/dada2’

The downloaded source packages are in ‘/tmp/Rtmptx8OqE/downloaded_packages’ Updating HTML index of packages in '.Library' Making 'packages.html' ... done Old packages: 'curl', 'dplyr', 'foreign', 'haven', 'httpuv', 'mgcv', 'purrr', 'Rcpp', 'TTR', 'xts' Update all/some/none? [a/s/n]:

and then all of the updates fail too.

Is the correct answer to not try to use dada2 with condas in R and rather just use a condas independent version of R, or is there some way that I am missing?

I am running R version 3.4.1 on ubuntu linux 16.04 and conda 3.2.23 for what that is worth.

Upvotes: 0

Views: 1159

Answers (2)

abalter
abalter

Reputation: 10393

I also struggled with this issue. After engaging in some discussions contained in github issues, I learned that the order of your channels actually needs to be different from what the bioconductor channel documentation suggests. Making this be my .condarc for the environment where I'm installing dada2 fixed the problem.

.condarc

channels:
  - conda-forge
  - bioconda
  - defaults

In case it helps anyone, you can look here: https://github.com/abalter/dada2-tools

Upvotes: 1

ohnoplus
ohnoplus

Reputation: 1335

I found downgrading my R version to 3.3.1 seemed to fix the problem. To do that I first removed R

 conda remove r

Checked to make sure that worked with conda list

Then I re-installed an older version of r conda install r==3.3.1

followed by dada2

 conda install -c bioconda bioconductor-dada2 

which worked. and finally I added r-essentials (which I needed especially to get jupyter notebook to work)

 conda install -c bioconda bioconductor-dada2 

With that, everything seems to work as expected.

Upvotes: 0

Related Questions