Conda environment

DADA2 - 16S analysis

2021

see also: → original DADA2 installation page

see also: → Installing QIIME 2 within a conda environment (conda of QIIME2-2019 includes DADA2 version 1.10)

Install DADA2 (v1.14) using a conda environment

1) Install (Mini-)conda

# check if conda exist already

conda info --envs

# conda environments:

#

base * /home/myname/tools/miniconda3

qiime2-2019.10 /home/myname/tools/miniconda3/envs/qiime2-2019.10

# If command "conda" does not exist

conda info --envs

conda: command not found

# Install miniconda

wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh

bash Miniconda3-latest-Linux-x86_64.sh # run installation

https://docs.conda.io/en/latest/miniconda.html


# add conda channels ( repositories from which software tools will be downloaded )

conda config --add channels defaults

conda config --add channels bioconda

conda config --add channels conda-forge

# check order of conda channels

conda config --get channels

--add channels 'defaults' # lowest priority

--add channels 'bioconda'

--add channels 'conda-forge' # highest priority

2) Setup a new conda environment for DADA2

To avoid → error "Segmentation fault", several conda channels are added to solve multithreading problems

conda create -n dada2-v1.14 -c conda-forge -c bioconda -c defaults --override-channels bioconductor-dada2

Proceed ([y]/n)? y

# check location of new environment

conda info --envs

# conda environments:

#

base * /home/myname/tools/miniconda3

dada2-v1.14 /home/myname/tools/miniconda3/envs/dada2-v1.14

qiime2-2019.10 /home/myname/tools/miniconda3/envs/qiime2-2019.10

3) Install DADA2

# start the new conda environment for DADA2

conda activate dada2-v1.14

# start R within the conda environment

R

R version 3.6.1 (2019-07-05) -- "Action of the Toes"

# In R: install DADA2 (see also: https://benjjneb.github.io/dada2/dada-installation.html )

if (!requireNamespace("BiocManager", quietly = TRUE))

install.packages("BiocManager")

BiocManager::install("dada2", version = "3.10")

Old packages

Update all/some/none? [a/s/n]: a

# close conda environment

conda deactivate

4) Run DADA2

# start DADA2 conda environment

conda activate dada2-v1.14

# start R

(dada2-v1.14) username@laptop:~$ R

# start DADA2 (in R)

library(dada2); packageVersion("dada2")

Loading required package: Rcpp

[1] ‘1.14.0’

to run DADA2, see tutorial

https://benjjneb.github.io/dada2/tutorial.html


# close R

q()

Save workspace image? [y/n/c]: n

# close conda environment

conda deactivate



x) Delete conda environment

# Delete complete conda environment "dada2-v1.14" if not needed anymore

conda remove --name dada2-v1.14 --all

# Uninstall a singe conda package from environment (remove a package, but keep environment)

conda remove --name environmentName packageName


Read more

https://docs.conda.io/en/latest/miniconda.html

https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-pkgs.html