meta data for this page
This is an old revision of the document!
Setting up your computer environment
General information
One of the main challenges in bioinformatics analyses - though frequently neglected - is the set up of the computer environment such that you can run your analyses smoothly. Rather than providing you with a nice and shiny pre-installed environment, we will guide you through the main steps of setting up your system on your own. Please note, installing software for comparative genomics works quite well for LINUX and MacOS, but if you run Microsoft_Windows you are likely to encounter considerable issues. This is, since many of the software for biological sequence analysis has not been implemented for this operating system. In this case, you may want to consider installing a LINUX distribution on a virtual machine.
The conda package manager
Whenever possible, we will use the conda package manager to install the software we need for the individual analysis steps. The main advantage of this package manager is that it not only installs the program you wish to use, but also all the dependencies you are often not aware of. The conda package manager, which can be easily installed on your system provides access to the Anaconda cloud. Using the conda package manager is considerably straightforward and we will guide you through the first steps. However, reading the documentation and using cheat sheets can certainly not harm. Sometimes, it may also help to take a look at the Anaconda glossary to get the meaning behind some of the terms used in the context of conda.
Mamba
The standard installation of Anaconda becomes considerably slow after a couple of different environments have been set up. We therefore recommend using Mamba which is much faster than Anaconda while maintaining all other advantages of Anaconda.
Setting up Mamba
- You can follow the installation guide on the official Mamba documentation page or refer to the steps below
- Download the latest
x86_64 Linux
installer from the miniforge GitHub page
wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh
Setting up conda (Alternative to mamba)
- Installation of Conda. Make sure to install the full anaconda3 package and not miniconda, and please use the Python 3.9 version!
- Access the download section of Anaconda and copy the URL of the installer script (right mouse click on the link and select copy link location)
- Log in into the remote computer and retrieve the installer script via wget or click on the download button and navigate to your Downloads directory in the shell
wget https://repo.anaconda.com/archive/Anaconda3-XXXX.XX-Linux-x86_64.sh.
Replace the link location in the above example command with the actual link you just copied
- Start the installation by typing
bash Anaconda3-XXXX.XX-Linux-x86_64.sh
Replace the file name in the above example command with the actual name of the file you just downloaded
- The installation process will ask you to read and agree to the license agreement. Press ENTER to see the agreement, then scroll down. At the end you can agree to them by typing yes. When asked in which location Anaconda should be installed you can just press ENTER to accept the default location (e.g. /home/your_name/anaconda3).
- Towards the end of the installation, the installer will ask you:
Do you wish the installer to initialize Anaconda3 by running conda init? [yes|no]
Answer with:
yes
This directly activates conda's base environment whenever you open a terminal.
- If you wait for some time, Anaconda will automatically answer with “no”. In this case, please activate Anaconda manually with these two commands:
source <path to conda>/bin/activate conda init
- At the end the installation process will tell you
For changes to take effect, close and re-open your current shell.
So close your terminal and open a new one.
- Check if the set up was successful:
- In the new terminal that you have just opened, it should say something like:
(base) francisca@workstation1:~$
This “(base)” indicates the base conda environment is activated. Now type:
conda -h
This should print some basic help to your terminal. If all is good, proceed to the next step.
- Creating a Conda environment. We will now create a working environment for your analyses. This step is optional, but it has the advantage of keeping software that you installed via the package manager together in one spot1). Moreover, it helps to have different - and even conflicting - set-ups at the same time on your computer. For example, you can have two environments using different versions of python, and you can easily switch between them.
- To create a working environment named compgen with python 3.82), type
conda create --name compgen python=3.9
- To activate the environment, type
conda activate compgen
- To leave the environment, type
conda deactivate
If you want to switch between environments, please de-activate the current environment, and only then activate the new environment!
- To remove an environment permanently, type
conda env remove -n EnvNAME
Please replace EnvName with the name of your environment
- To print out some information about your conda installation to your screen type
conda info
into a shell. You will obtain something like the following:
active environment : compgen active env location : /Users/ingo/anaconda/envs/compgen shell level : 1 user config file : /Users/ingo/.condarc populated config files : /Users/ingo/.condarc conda version : 4.5.11 conda-build version : 2.0.2 python version : 2.7.12.final.0 base environment : /Users/ingo/anaconda (writable) channel URLs : https://conda.anaconda.org/conda-forge/osx-64
- If the installation was successful, you can ask for further help with the individual commands,such as, e.g. install , update , remove by typing
conda install --help
- You are now ready to install any software that is distributed via the conda package manager using the following command
conda install -c CHANNELNAME PACKAGENAME
- The software packages are distributed via different channels. We will mainly use the channels bioconda and conda-forge.
- To simplify your life, it might be a good idea to add frequently used channels to a list of channels where conda searches for your package by default. Use the following syntax to add the channels bioconda and conda-forge to your default channel list
conda config --add channels bioconda conda config --add channels conda-forge
- conda lets you also update already installed packages. Just type
conda update samtools
- if you wish, you can also delete an already installed package by typing
conda remove samtools
If you completed all of the steps above, then you should be ready to make full use of the conda package manager.