Skip to content

02. Install

Krista Ternus edited this page Mar 11, 2019 · 14 revisions

Install

The metagenomics workflows require the following software to be installed:

  • Singularity
  • Python 3
  • Git
  • Conda
  • Snakemake
  • Open Science Framework (OSF) client

The instructions below will help you get started installing and running the above software.

NOTE: If you previously ran the v1.0 workflows, then you can skip to the bottom of this page because you should only need to install the new source code.

Table of Contents

Install Singularity

There are multiple versions of Singularity that you can install. The latest version is 3.0.1, but the current supported version is 2.6.1.

Installation: To install your version of choice, simply execute the following commands (below we are installing version 2.6.1, but you can replace this with the newest version if you wish):

wget https://github.com/singularityware/singularity/releases/download/2.6.1/singularity-2.6.1.tar.gz  
tar xvf singularity-2.6.1.tar.gz 
cd singularity-2.6.1 
./configure --prefix=/usr/local  --sysconfdir=/etc
make  
sudo make install  

To see if Singularity installed, you can check the version by running this command:

singularity --version  

Removal: If you need to remove an old version there are instructions here: singularity removal instructions. In a single command:

sudo rm -rf /usr/local/libexec/singularity /usr/local/etc/singularity /usr/local/include/singularity /usr/local/lib/singularity /usr/local/var/lib/singularity/ /usr/local/bin/singularity /usr/local/bin/run-singularity /usr/local/etc/bash_completion.d/singularity /usr/local/man/man1/singularity.1

To download/setup singularity containers:

sudo yum install squashfs-tools

Install Python 3

The direct installation of Python 3 is optional (conda also installs this). Please install Python 3 however is most appropriate on your system. The below commands are specific to CentOS, and this particular method uses the Software Collections Repository (SCL).

To install python with yum:

sudo yum install centos-release-scl
sudo yum install rh-python36
scl enable rh-python36 bash

Verify that Python 3.6 is installed:

python --version 

Install Git

Install Git

sudo yum install git

Install Conda

Once Python is installed, you can install the latest version of Miniconda using the following commands:

wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh 

You should accept the defaults, and we suggest saying yes to adding the Miniconda install location to your path. It makes entering the virtual environment easier.

Restart the terminal, then see which version of conda you have installed:

which conda  

Now you need to add the required conda channels:

conda config --add channels r  
conda config --add channels defaults
conda config --add channels conda-forge  
conda config --add channels bioconda  

Create Conda Environment

Now that you have conda installed, you can create an environment for your metagenomics work called metag:

conda create --name metag

You can activate and deactivate this environment by following the commands below. This can be executed from any directory. It is important to make sure you have activated the metag environment every time you start a new session for running these metagenomics workflows. For now, practice turning it on and off.

Activate the metag virtual environment:

source activate metag  

If you are inside the metag virtual environment, it will show:

(metag)[user@localhost ~]$

To de-activate:

(metag)[user@localhost ~]$ source deactivate metag  

If you are outside the virtual environment, it will show:

[user@localhost ~]$

Re-activate the metag environment before you proceed with this documentation. Once you are inside the metag virtual environment, follow the installation commands below to setup the software inside your environment.

Install Snakemake in Conda Environment

Install datrie with conda:

conda install datrie

You'll also need to install psutil:

conda install psutil

Make sure pip is up-to-date:

pip install --upgrade pip

Then install snakemake with the following command:

pip install snakemake  

Install Open Science Framework in Conda Environment

Install the Open Science Framework CLI client:

pip install osfclient  

Install Source Code in Conda Environment

Install the source code for the metagenomics project:

git clone https://github.com/signaturescience/metagenomics.git
cd metagenomics
git checkout tags/v1.1

If you would like to view the wiki for the metagenomics project offline, it can be downloaded with the following command:

git clone https://github.com/signaturescience/metagenomics.wiki.git

Now that you have completed all the installations, you are ready to proceed to the Offline Setup.

Clone this wiki locally