Skip to content

2. Installation

Marit Hetland edited this page Jun 1, 2021 · 24 revisions

This page tells you how to install and update the tools used in the pipeline. Please note python 3 is required.

Table of Contents

Easy install

All necessary tools can be installed with the ./scripts/install.sh script. The only thing you need to set is the path of INSTALL_DIR, which is where the repositories will be installed (including this one), and you need to have conda and docker installed:

INSTALL_DIR="/home/marit/Programs/"  #Change to your install dir
cd $INSTALL_DIR
git clone https://github.com/marithetland/susCovONT  #Clone this repo
bash ./susCovONT/scripts/install.sh $INSTALL_DIR #Install all necessary tools

This also updates the paths in the scripts/config.cfg file so you should be ready to use susCovONT as soon as the installation is complete. For easier use, export susCovONT to your path.

Prerequisites

  • python 3
  • biopython conda install -c conda-forge biopython
  • pandas conda install -c anaconda pandas
  • numpy conda install -c anaconda numpy
  • nextflow v20+ Go to nextflow.io, scroll down to "Getting started" and follow installation instructions. You should then add nextflow to your path.

Manual installation

If you don't want to us the installs script, you can install the tools manually as described below. You will have to edit the paths in the scripts/config.cfg file before running susCovONT.

Clone this repo

Go to your install directory and download this repository:

cd ~/Programs/ #Change to your install dir
git clone https://github.com/marithetland/susCovONT

Config file

You need to edit the config file so this script works on your computer. There are 3 things to change here:

  • Location of the artic nextflow directory, which you install as described below (default: /home/marit/Programs/ncov2019-artic-nf/)
  • Artic-conda location: Location where the artic conda environment will be installed (see below) (default:/home/marit//Programs/conda_for_covid/work/conda/)
  • Path to schemeRepoURL if running in offline mode, which you install as described below (default: /home/marit/Programs/primer-schemes/)

Nextflow pipeline

Follow the commands below to clone the ncov2019-artic-nf repository, change the artic version to the most recent (currently 1.2.1) and update the QC file with the one from this repo (see 3. QC and parameters) for more information).

cd ~/Programs #Change to your install directory
git clone https://github.com/connor-lab/ncov2019-artic-nf
sed -i.bak 's/artic=1.1.3/artic=1.2.1/g' ncov2019-artic-nf/environments/nanopore/environment.yml #Change "1.2.1" to desired artic version
cp ~/Programs/susCovONT/scripts/articQC.py ncov2019-artic-nf/bin/qc.py #Update the QC script with the one from this repository.

Install necessary conda environment for nextflow pipeline:

Run the conda env create command below to make the necessary conda environment for running the nextflow pipeline. Remember to update this (re-install) when a new version of artic comes out:

CONDA_LOCATION should be the same as specified in scripts/config.cfg file:

CONDA_LOCATION= ~/Programs/conda_for_covid/ #Change this to match your system
mkdir $CONDA_LOCATION
conda env create --prefix ${CONDA_LOCATION}/work/conda/artic-2c6f8ebeb615d37ee3372e543ec21891 --file ~/Programs/ncov2019-artic-nf/environments/nanopore/environment.yml

Offline mode

To run in offline mode, i.e. without downloading primer schemes each time, the primer-schemes repository must be downloaded. Clone the repository and give its path in the config file (./scripts/config.cfg):

cd ~/Programs/
git clone https://github.com/artic-network/primer-schemes.git

Pangolin

Install pangolin (as per the github instructions - https://github.com/cov-lineages/pangolin):

cd ~/Programs
git clone https://github.com/cov-lineages/pangolin.git
cd pangolin
conda env create -f environment.yml
conda activate pangolin
python setup.py install

Nextclade

Nextclade can be used online: https://clades.nextstrain.org/ or on the CLI with either Docker or nmp. This pipeline will pull the latest image of nextclade from https://hub.docker.com/r/neherlab/nextclade every time it is run, so no need to install it now, but you must make sure you have Docker installed with non-root access.

Installing docker and conda

Docker

Docker is needed to install nextclade. Instructions for installing Docker are here: https://docs.docker.com/engine/install/ubuntu/ but also summarised below:

  1. Remove any old packages first sudo apt-get remove docker docker-engine docker.io containerd runc

  2. Then run (as described here: https://labs.epi2me.io/quickstart/)

sudo apt update
sudo apt install docker.io
sudo usermod -aG docker $USER #To use without needing sudo
  1. Test that the intallation worked
docker run hello-world
  1. If the test does not work, try running:
sudo chmod 666 /var/run/docker.sock
docker run hello-world #Test if it is working now

or read more on: https://docs.docker.com/engine/install/linux-postinstall/

Conda

For conda installation on your computer system, please see: conda.

Update

You should check for updates of artic and the artic nextflow pipeline regularly as they become improved. Pangolin and nextclade are updated each time this pipeline is run (when not run in --offline mode). Note that on your GridION/MinIT you should also make sure to keep the MinKNOW software up-to-date (this includes guppy) and remember to pull the RAMPART image every now and then unless you do it every time.

To update the tools:

Updating nf pipeline

Git clone the repository as with install.

Updating artic version

Same as installation: Check if there is a new update of artic and then run:

cd ~/Programs #Change to your install directory
git clone https://github.com/connor-lab/ncov2019-artic-nf
sed -i.bak 's/artic=1.1.3/artic=1.2.1/g' ncov2019-artic-nf/environments/nanopore/environment.yml #Change "1.2.1" to desired artic version

Updating pangolin

Minor updates

conda activate pangolin
pangolin --update

When a new version comes out (like v2.3) a bigger update may be needed: (see also: https://cov-lineages.org/pangolin_docs/updating.html)

conda activate pangolin
pangolin --update
cd ~/Programs/pangolin
git pull
python setup.py install
conda env update -f environment.yml
pip install git+https://github.com/cov-lineages/pangoLEARN.git --upgrade
pip install git+https://github.com/cov-lineages/lineages.git --upgrade

Updating nextclade

docker pull neherlab/nextclade:latest

Bonus: Installing and using artic

Note: Artic does not need to be installed separately as it is included with the nextflow pipeline, but it can be useful for you to have it installed in path in case you want to run any of the artic guppyplex or artic minion commands outside of this pipeline.

Install the latest release of artic using conda with:

conda create -n artic
conda activate artic
conda install -c bioconda -c conda-forge artic
#Or specify version with:
#conda install -c bioconda -c conda-forge artic=1.2.1