Installing Conda, Setting Up Environments, and Installing Packages - statonlab/UTIA_Computational_Resource GitHub Wiki

Conda is an open source package and environment management. Within a conda environment you will be able to install any packages - and their dependencies - and run them. If you find a package that is unavailable in Spack but available in Conda, you can load a Conda environment and install the package.

1. Installing Conda

There are multiple methods to install Conda; the simplest is to install the latest version of Miniconda. Miniconda is a simplified version of Anaconda containing only what is needed to run Conda. This can be set up in your home directory (~).

cd ~
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh

Complete the offered prompts, setting everything to default. Once installation is complete, close and reopen your window to confirm installation. If you are able to get a list of installed packages by running conda list, Conda has been installed correctly.

2. Creating a Conda Environment

Making a conda environment from scratch is fairly simple:

conda create --name <env_name>
conda activate <env_name>

I recommend making the name something you will be able to remember easily. If you aren't attempting to install packages that will conflict with each other, I also recommend creating one, centralized environment so that you know where most everything is located.

However, you may also need to load a saved environment associated with an existing package, such as aTRAM. This environment is created using the following commands:

cd /pickett_centaur/software/aTRAM
conda env create -f environment.yml
conda activate aTRAM

3. Installing new packages

If you plan on running python for any bioinformatics pipelines, Biopython is essential. To install Biopython for use, activate your personal environment and run this command:

conda install -c conda-forge biopython

As long as your environment is active, you will be able to run biopython.

The -c option specifies the channel from which we installed biopython, which will not be the same for every package you load. I recommend searching for your package + conda and getting the command from their documentation.

⚠️ **GitHub.com Fallback** ⚠️