Anaconda, Miniconda & Conda
You can install many python and non-python packages yourself using conda or especially for bioinformatics software bioconda.
Conda enables you to easily install complex packages and software. Creating multiple enviroments enables you to have installations of the same software in different versions or incompatible software collections at once. You can easily share a list of the installed packages with collaborators or colleagues, so they can setup the same eniviroment in a matter of minutes.
Setup
First you load the miniconda module which is like a python and r package manager. Conda makes it easy to have multiple environments for example one python2 and one python3 based parallel to each other without interfering.
Load conda module
Start by removing all preloaded modules which can complicate things. We then display all installed version and load the newest Miniconda one (4.6.14):
$ module purge
$ module avail conda
$ module load Miniconda3/4.6.14
Setup conda activate command
To use conda activate
interactively you have to initialise your shell once with:
$ conda init bash
Add channels
To install packages we first have to add the package repository to conda (we only have to do this once). This is the place conda will download the packages from.
$ conda config --add channels defaults
$ conda config --add channels conda-forge
If you want install bioinformatics packages you should also add the bioconda channel:
$ conda config --add channels bioconda
Supress unneccessary warnings
To suppress the warning that a newer version of conda exists which is usually not important for most users and will be fixed by us by installing a new module:
$ conda config --set notify_outdated_conda false
Create new environment
New environments are initialised with the conda create
. During the creation you
should list all the packages and software that should be installed in this
environment instead of creating an empty one and installing them one by one. This
makes the installation much faster and there is less chance for conda to get stuck in
a dependency loop.
$ conda create --name ENVIRONMENT python=3 SOMESOFTWARE MORESOFTWARE
If you are planning on adding many libraries to your environment, you should
consider placing it in a directory other than your $HOME, due to the
{ref}storage restrictions <clusters-homedirectory>
on that folder. One
alternative could be to use the {ref}Project area <project-area>
, please
check out {ref}Storage areas on HPC clusters <clusters-overview>
for other
alternatives. To install conda in an alternative location, use the --prefix PATH
or -p PATH
option when creating a
new environment.
conda create -p PATH SOMEPACKAGES
This enables multiple users of a project to share the conda environment by installing it into their project folder instead of the user's home.
Daily usage
Interactively
To load this environment you have to use the following commands either on the command line or in your job script:
$ module purge
$ module Miniconda3/4.6.14 # Replace with the version available on the system
$ conda activate ENVIRONMENT
Then you can use all software as usual.
To deactivate the current environment:
$ conda deactivate
If you need to install additional software or packages, we can search for it with:
$ conda search SOMESOFTWARE
and install it with:
$ conda install -n ENVIRONMENT SOMESOFTWARE
If the python package you are looking for is not available in conda you can use