Skip to content

02. Install

Krista Ternus edited this page Mar 25, 2021 · 14 revisions

Install

Table of Contents

Overview

The MetScale workflows require the following software to be installed:

  • Singularity
  • Python 3 and other dependencies
  • Git
  • Conda
  • Conda channels: r, defaults, conda-forge, bioconda
  • Snakemake
  • Datrie
  • Psutil
  • R packages: r-base, r-essentials, r-ggplot2, r-DT
  • Open Science Framework (OSF) client

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

Install Singularity

There are multiple versions of Singularity that you can install. The Version 3.2.0-1 or greater is required to run the workflows (NOTE: older versions 3.0.1 and 2.6.1 are no longer supported).

Installation: To install Singularity, please follow the instructions on this site: https://sylabs.io/guides/3.2/user-guide/installation.html

To see if you have the correct Singularity version (3.2.1 or greater) 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.

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 (python 3.7+ required). Verify that Python 3.7 (or newer) is installed:

python3 --version 

After you have ensured that the correct version of python is installed, you will need to install in following:

python -m pip install -U matplotlib 

The following should also be installed on your server:

sudo yum install mysql-devel
sudo yum install postgresql-devel

Install Git

Install Git

sudo yum install git

Verify that Git 1.8.3.1 (or newer) is installed:

git --version 

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 

We recommend accepting the defaults and typing "yes" when prompted to add the Miniconda installation location to your path. This makes entering the virtual environment easier in the future.

Restart the terminal, then see if and where conda is installed:

which conda  

Verify that conda 4.6.14 or later is installed:

conda --version 

To update conda:

conda update -n base conda

Removal: To remove your old version of conda before installation, there are instructions here: conda instructions.

Create Conda Environment

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

conda create --name metscale

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 metscale environment every time you start a new session for running these MetScale workflows. For now, practice turning it on and off.

Activate the metscale virtual environment:

conda activate metscale

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

(metscale)[user@localhost ~]$

To de-activate:

(metscale)[user@localhost ~]$ conda deactivate

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

[user@localhost ~]$

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

Now you need to add the required conda channels:

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

Install Snakemake and Other Packages in Conda Environment

Install datrie with conda:

conda install datrie -y

Install psutil with conda:

conda install psutil -y

Then install snakemake with the following command:

conda install snakemake=5.5.3 -y  

Verify that Snakemake 5.5.3 is installed:

snakemake --version 

Then install additional packages with the following commands:

conda install -c r r-base -y
conda install -c r r-essentials -y
conda install -c r r-ggplot2 -y
conda install -c r r-DT -y
conda install -c conda-forge conda-forge::r-stringi
conda install -c r r-dplyr -y
conda install -c r r-tidyr -y
conda install -c r r-r.utils -y
conda install -c r r-rjson -y
conda install -c r r-ggfittext -y

Make sure pip is up-to-date:

pip install --upgrade pip

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 MetScale workflows for the first time:

git clone https://github.com/signaturescience/metscale.git
cd metscale
git checkout tags/v1.4

If the MetScale workflows have previously been installed, update the source code:

cd metscale
git pull origin master
git checkout tags/v1.4

To checkout previous development versions of the code (i.e. v1.3), you may specify the version in your git checkout command:

git checkout tags/v1.3

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

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

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