conda
is a package management system that allows the installation of multiple versions of software through a virtual environment mechanism.
This system allows each cluster user to install and use the tools they need without the need of administrator rights.
Virtual environments
The tools you install through conda
must be installed in a virtual environment that can be seen as a toolbox.
You can create as many virtual environments as you want, for example, to be able to use different versions of the same tool (each version in a different environment).
Creation
To create a virtual environment, use the conda create
command like this:
conda create -n myenv
This command will create the virtual environment called myenv
.
Activation
In order to use your virtual environment, you must activate it. To do this, use the following command:
conda activate myenv
Deactivation
When you no longer want to use the current virtual environment, just deactivate it:
conda deactivate myenv
Deletion
You can remove a virtual environment that is no longer needed by using the following command:
conda env remove -n myenv
Listing
Find a list of your virtual environments using the following command:
conda env list
By default, conda
will store all of your virtual environments and the tools you want to install in the .conda
folder located at the root of your home directory (/shared/home/<your_username>). They will thus be accessible on all the nodes of the compute cluster.
Clonage
You can clone an existing virtual environment to use as a starting point for a new virtual environment:
conda create -n myenv --clone snakemake
This command will create a new virtual environment myenv
identical to the virtual environment snakemake
available on the compute cluster.
Tools
Install tools
Once you have activated a personal virtual environment, you can install tools.
conda install git
The tools are made available by the conda community through numerous package repositories called channels
.
The best known channels are:
- Default (https://anaconda.org) : Official conda channel (available by default)
- Bioconda (https://bioconda.github.io) : Repository of more than 3500 tools dedicated to bioinformatics
- Conda Forge (https://conda-forge.github.io) : Community channel
To install a tool from a particular channel, use the following command:
conda install -c bioconda snakemake
This command will install the snakemake
package available on the bioconda
repository.
You can create a virtual environment and install packages in one single command:
conda create -n myenv -c bioconda snakemake python==3.5
This command will create the virtual environment myenv
and install the snakemake
and python 3.5
packages.
List installed tools
The following command allows you to list all installed tools in the current virtual environment:
conda list
Remove a tool
To delete a tool, use the following command:
conda remove <tool>