Conda is a cross platform (Windows, Linux, MacOSx) environment management software.
Works for any language, version, and library as specified by the user.
Allows for easy control and maintenance of multiple environments with different specifications.
Allows for software packages and their dependencies to be easily loaded “automatically” via channels such as Bioconda, which specifically hosts a variety of bioinformatics software.
Installability of 98 randomly selected published software tools across 22 life-science journals over a span of 15 years. Error bars, where present, indicate SEM. (A) Pie chart showing the percentage of tools with various levels of installability. (B) A pie chart showing the proportion of evaluated tools that required no deviation from the documented installation procedure. (C) Tools that require no manual intervention (pass automatic installation test) exhibit decreased installation time. (D) Tools installed exhibit increased citation per year compared with tools that were not installed (Kruskal-Wallis, p-value = 0.035). (E) Tools that are easy to install include a decreased portion of undocumented commands (Not Installed versus Easy Install: Mann-Whitney U test, p-value = 0.01, Easy Install versus Complex Install: Mann-Whitney U test, p-value = 8.3 × 10 −8 ). (F) Tools available in well-maintained package managers such as Bioconda were always installable, whereas tools not shipped via package managers were prone to problems in 32% of the studied cases. SEM, standard error of the mean. https://doi.org/10.1371/journal.pbio.3000333.g002
Anaconda is the name of the software where we get conda from. However, it is quite large, so we are going to instead download a smaller version called miniconda. Go to the miniconda website and get the link for the Linux 64 bit python 3.8 installer. Then download the installer:
cd /share/workshop/prereq_workshop/$USER/software
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
This is a shell script so we need to use the “sh” command to run it. Run the installer:
sh Miniconda3-latest-Linux-x86_64.sh
Press Enter to continue the installer and then scroll through the EULA using the spacebar. Then type “yes” to accept the terms. Now, we want to change the default install location, so enter “/share/workshop/prereq_workshop/$USER/software/miniconda3”:
Do you accept the license terms? [yes|no]
[no] >>> yes
Miniconda3 will now be installed into this location:
/home/joshi/miniconda3
- Press ENTER to confirm the location
- Press CTRL-C to abort the installation
- Or specify a different location below
[/home/joshi/miniconda3] >>> /share/workshop/prereq_workshop/$USER/software/miniconda3
PREFIX=/share/workshop/prereq_workshop/joshi/software/miniconda3
Unpacking payload ...
Collecting package metadata (current_repodata.json): done
Solving environment: done
You will see a bunch of messages about packages being installed, and then it will ask you if you want to initialize Miniconda3. Type “yes”. The initialization just creates a file called “~/.bashrc” which we will need to source to actually initialize:
source ~/.bashrc
You will see that your prompt changes to have “(base)” at the beginning.
Installing software
Conda is useful for software installation because you can create an “environment” for each piece of software and that environment will have exactly the right packages it needs with the exact versions it needs. Different software will have different requirements in terms of which packages and versions it needs, so it is useful to compartmentalize those. Now let’s create an environment and install some software. Here we want to install HTStream, a tool for High Throughput Sequencing Read Processing.
You see that there are multiple versions of htstream you could install. And that the software is available on the “bioconda” channel. If you run “conda info” you can see information about the install including the channels that are searched.
(base) joshi@tadpole:/share/workshop/prereq_workshop/joshi/software$ conda info
active environment : base
active env location : /share/workshop/prereq_workshop/joshi/software/miniconda3
shell level : 1
user config file : /home/joshi/.condarc
populated config files : /home/joshi/.condarc
conda version : 4.8.3
conda-build version : not installed
python version : 3.8.3.final.0
virtual packages : __glibc=2.23
base environment : /share/workshop/prereq_workshop/joshi/software/miniconda3 (writable)
channel URLs : https://conda.anaconda.org/conda-forge/linux-64
https://conda.anaconda.org/conda-forge/noarch
https://conda.anaconda.org/bioconda/linux-64
https://conda.anaconda.org/bioconda/noarch
https://repo.anaconda.com/pkgs/main/linux-64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/r/linux-64
https://repo.anaconda.com/pkgs/r/noarch
https://conda.anaconda.org/r/linux-64
https://conda.anaconda.org/r/noarch
https://conda.anaconda.org/etetoolkit/linux-64
https://conda.anaconda.org/etetoolkit/noarch
package cache : /share/workshop/prereq_workshop/joshi/software/miniconda3/pkgs
/home/joshi/.conda/pkgs
envs directories : /share/workshop/prereq_workshop/joshi/software/miniconda3/envs
/home/joshi/.conda/envs
platform : linux-64
user-agent : conda/4.8.3 requests/2.23.0 CPython/3.8.3 Linux/4.15.0-107-generic ubuntu/16.04.6 glibc/2.23
UID:GID : 20331:2019
netrc file : None
offline mode : False
So since the bioconda channel is already available, we do not have to specify it when we create the environment and install the software. However, if it is not available, you will need to do so:
Enter “y” when prompted. This command is creating an environment called “htstream-1.3.2” and installing the “htstream” package into it. By default, it installs the latest version. This might take a little while to run.
Compared to typical installations such as the one shown above, conda installs only requires one command. Conda is quicker, more user friendly, and more commonly results in success.
A few things for your future Conda usage:
When running conda on your own computer you will need to add channels, which is where conda will look when performing package installs