Conda quickly installs, runs and updates packages and their dependencies. Conda can create and switch between environments on your computer, resolving dependency conflicts that might arise due to package requirements.
Jump to:
Let’s first activate the base environment for conda:
conda activate base
You should see the (base)
prefix before your username on the terminal.
Now let’s install the package fastqc
. First, look up the package in the Anaconda repository: https://anaconda.org/bioconda/fastqc.
conda install -c bioconda fastqc
or
conda install bioconda::fastqc
If we wanted to specify the version of the tool, we can ‘pin’ the version in the install command:
conda install bioconda::fastqc=0.11.9
fastqc
has been installed correctly by prompting the help message.fastqc
was installed (hint: use whereis
).We have seen how simple it is to install tools using the conda install
command.
In reality, we will want to install multiple packages at once for an analysis and create a clean environment for the packages. This can be simplified using a .yml
file. The strucutre of a .yml
file is:
In this weeks tutorial we want to create an environment for the quality control of sequencing reads. We will need fastqc
and multiqc
to generate HTML reports of sequencing statistics and a tool to perform adapter trimming and read filtering.
Choosing a trimming tool is highly subjective however, I like the flexibility of bbduk
, part of the bbtools
suite.
Please save the below block as week1.yml
.
name: QC
channels:
- agbiome
- bioconda
- conda-forge
- defaults
dependencies:
- fastqc
- multiqc
- bbtools
To create a conda environment using the .yml
file, run the following command in the terminal:
conda env create -f week1.yml && conda clean -a
Conda should install the three packages under the environment QC
.
conda env export > QC.yml
.