#################################
### INSTALLATION INSTRUCTIONS ###
#################################

This document contains the command lines used for installing each program in this evaluation. By way of example, each program here is installed in the directory /home/ndm.local/steveb/programs.

##### CREATE DIRECTORY FOR ALL PROGRAMS #####

mkdir ~/programs
cd ~/programs

##### INSTALL DEPENDENCIES AND OTHER ANCILLARY PROGRAMS #####

## BioPython (required for Simulome) # for the purpose of this study, this was installed locally; see https://gist.github.com/saurabhshri/46e4069164b87a708b39d947e4527298.
wget https://bootstrap.pypa.io/get-pip.py && python get-pip.py --user
cd ~/.local/bin
./pip install biopython --user
cd ~/programs

## BLAST+
wget ftp://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/LATEST/ncbi-blast-2.7.1+-x64-linux.tar.gz
tar xvzf ncbi-blast-2.7.1+-x64-linux.tar.gz
rm ncbi-blast-2.7.1+-x64-linux.tar.gz

## GNU parallel (required for Freebayes & Snippy)
wget http://ftp.gnu.org/gnu/parallel/parallel-latest.tar.bz2
tar -xvjf parallel*
rm parallel-latest.tar.bz2
cd parallel*
./configure --prefix=/home/ndm.local/steveb/programs
make
make install
cd ..

## Harvest Tools (required for ParSnp)
wget https://github.com/marbl/harvest-tools/releases/download/v1.2/harvesttools-Linux64-v1.2.tar.gz
tar xvzf harvesttools-Linux64-v1.2.tar.gz
rm harvesttools-Linux64-v1.2.tar.gz

## htslib (required for SAMtools & Platypus)
wget https://github.com/samtools/htslib/releases/download/1.7/htslib-1.7.tar.bz2
tar xvzf htslib-1.7.tar.bz2
rm htslib-1.7.tar.bz2
cd htslib-1.7
./configure --prefix=/home/ndm.local/steveb/programs
make
make install
cd ..

## Kaiju
git clone https://github.com/bioinformatics-centre/kaiju.git
cd kaiju/src
make
cd ..

## Kraken2
git clone https://github.com/DerrickWood/kraken2.git
cd kraken2
./install_kraken2.sh /home/ndm.local/steveb/programs/kraken2
cd ..

## Mash
wget https://github.com/marbl/Mash/releases/download/v2.1/mash-Linux64-v2.1.tar
tar xvf mash-Linux64-v2.1.tar
rm mash-Linux64-v2.1.tar

## Picard Tools
wget https://github.com/broadinstitute/picard/releases/download/2.17.11/picard.jar
chmod 755 picard.jar
wget https://downloads.sourceforge.net/project/picard/sam-jdk/1.99/sam-1.99.jar
chmod 755 sam-1.99.jar

## Prokka
git clone https://github.com/tseemann/prokka.git
cd prokka/bin
./prokka --setupdb # note that if you enable --usegenus when running Prokka *and also* provide a Genus via --genus then Prokka will use a genus-specific BLAST database. This is recommended. Prokka comes with a set of databases for the 3 most common bacterial genera (Enterococcus, Escherichia, Staphylococcus); this setup command creates them. To check on which genus-specific databases are available, run "prokka --listdb".
cd ..

## SAMtools (requires htslib)
wget https://sourceforge.net/projects/samtools/files/samtools/1.7/samtools-1.7.tar.bz2
tar xvjf samtools-1.7.tar.bz2
rm samtools-1.7.tar.bz2
cd samtools-1.7
./configure --prefix=/home/ndm.local/steveb/programs --with-htslib=/home/ndm.local/steveb/programs/htslib-1.7
make
make install
cd ..

## seqtk
git clone https://github.com/lh3/seqtk.git
cd seqtk
make
cd ..

## Simulome
git clone https://github.com/price0416/Simulome.git
cd Simulome
chmod 755 simulome.py
cd ..

## VCFlib
git clone --recursive git://github.com/ekg/vcflib.git
cd vcflib
make
cd ..

## vt (required for Snippy)
git clone https://github.com/atks/vt.git 
cd vt
make
cd ..

##### INSTALL WHOLE GENOME ALIGNERS #####

## MUMmer4
wget https://github.com/mummer4/mummer/releases/download/v4.0.0beta2/mummer-4.0.0beta2.tar.gz
tar xvzf mummer-4.0.0beta2.tar.gz
rm mummer-4.0.0beta2.tar.gz
cd mummer-4.0.0beta2
./configure --prefix=/home/ndm.local/steveb/programs
make
make install
cd ..

## MUMmerSNPs2VCF.py
wget https://raw.githubusercontent.com/liangjiaoxue/PythonNGSTools/master/MUMmerSNPs2VCF.py
chmod 755 MUMmerSNPs2VCF.py

## Parsnp
wget https://github.com/marbl/parsnp/releases/download/v1.2/parsnp-Linux64-v1.2.tar.gz
tar xvzf parsnp-Linux64-v1.2.tar.gz
rm parsnp-Linux64-v1.2.tar.gz

##### INSTALL SHORT READ ALIGNERS #####

## BBmap
wget https://downloads.sourceforge.net/project/bbmap/BBMap_38.11.tar.gz
tar xvzf BBMap_38.11.tar.gz
rm BBMap_38.11.tar.gz

## Bowtie2
wget https://sourceforge.net/projects/bowtie-bio/files/bowtie2/2.3.4.1/bowtie2-2.3.4.1-linux-x86_64.zip
unzip bowtie2-2.3.4.1-linux-x86_64.zip
rm bowtie2-2.3.4.1-linux-x86_64.zip

## BWA
git clone https://github.com/lh3/bwa.git
cd bwa
make
cd ..

## Cushaw3
wget https://downloads.sourceforge.net/project/cushaw3/cushaw3-v3.0.2_binary_SSE4.tar.bz2
tar xjvf cushaw3-v3.0.2_binary_SSE4.tar.bz2
rm cushaw3-v3.0.2_binary_SSE4.tar.bz2

## GASSST
wget http://www.irisa.fr/symbiose/projects/gassst/Gassst_v1.28.tar.gz
tar xvzf Gassst_v1.28.tar.gz
rm Gassst_v1.28.tar.gz
cd Gassst_v1.28
make
cd ..

## GEM
git clone --recursive https://github.com/smarco/gem3-mapper.git gem3-mapper
cd gem3-mapper
./configure
make
cd ..

## HISAT2
wget ftp://ftp.ccb.jhu.edu/pub/infphilo/hisat2/downloads/hisat2-2.1.0-Linux_x86_64.zip
unzip hisat2-2.1.0-Linux_x86_64.zip
rm hisat2-2.1.0-Linux_x86_64.zip

## minimap2
git clone https://github.com/lh3/minimap2

## MOSAIK
wget https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/mosaik-aligner/MOSAIK-2.2.3-Linux-x64.tar # from https://code.google.com/archive/p/mosaik-aligner/downloads
tar xvf MOSAIK-2.2.3-Linux-x64.tar # this is to provide access to executables
rm MOSAIK-2.2.3-Linux-x64.tar
git clone https://github.com/wanpinglee/MOSAIK.git # this is only to have access to the contents of MOSAIK/src/networkFile - on the cluster used in thus study, installation from git required -lz, which was unavailable (there were also no sudo privileges that could be used to make it available)

## NextGenMap
wget http://github.com/Cibiv/NextGenMap/archive/0.5.0.tar.gz
tar xvzf 0.5.0.tar.gz
rm 0.5.0.tar.gz
cd NextGenMap-0.5.0/
mkdir -p build/
cd build/
cmake ..
make
cd ..

## SMALT
wget https://downloads.sourceforge.net/project/smalt/smalt-0.7.6-static.tar.gz
tar xvzf smalt-0.7.6-static.tar.gz
rm smalt-0.7.6-static.tar.gz
cd smalt-0.7.6
./configure --prefix=/home/ndm.local/steveb/programs
make
make install
cd ..

## SNAP
wget http://snap.cs.berkeley.edu/downloads/snap-beta.18-linux.tar.gz
tar xvzf snap-beta.18-linux.tar.gz
rm snap-beta.18-linux.tar.gz

## SOAP3-dp (necessary to build the indexes used by 16GT although its core alignment functionality requires a CUDA-capable GPU)
wget https://downloads.sourceforge.net/project/soap3dp/v2.3.172/soap3-dp-2.3.172-cuda4.2-linux-AmazonEC2.tar.gz
tar xvzf soap3-dp-2.3.172-cuda4.2-linux-AmazonEC2.tar.gz
rm soap3-dp-2.3.172-cuda4.2-linux-AmazonEC2.tar.gz

## Stampy
wget http://www.well.ox.ac.uk/bioinformatics/Software/Stampy-latest.tgz
tar xvzf Stampy-latest.tgz
cd stampy-1.0.32
make
cd ..
rm Stampy-latest.tgz

## Yara
git clone https://github.com/seqan/seqan.git
mkdir yara-build
cd yara-build
cmake ../seqan -DSEQAN_BUILD_SYSTEM=APP:yara
make all
cd ..

##### INSTALL VARIANT CALLERS AND ALL-IN-ONE VARIANT CALLING PIPELINES #####

## 16GT
git clone https://github.com/aquaskyline/16GT
cd 16GT
make
cd ..

## BCFtools mpileup (requires htslib)
wget https://github.com/samtools/bcftools/releases/download/1.7/bcftools-1.7.tar.bz2
tar xvjf bcftools-1.7.tar.bz2
rm bcftools-1.7.tar.bz2
cd bcftools-1.7
./configure --prefix=/home/ndm.local/steveb/programs --with-htslib=/home/ndm.local/steveb/programs/htslib
make
cd ..

## DeepVariant (see https://github.com/google/deepvariant/blob/master/docs/deepvariant-quick-start.md)
sudo docker pull gcr.io/deepvariant-docker/deepvariant:0.8.0

## Freebayes
git clone --recursive git://github.com/ekg/freebayes.git
cd freebayes
make
cd ..

## GATK
wget https://github.com/broadinstitute/gatk/releases/download/4.0.11.0/gatk-4.0.11.0.zip
unzip gatk-4.0.11.0.zip
rm gatk-4.0.11.0.zip
chmod 755 ~/programs/gatk-4.0.11.0/gatk-package-4.0.11.0-local.jar ~/programs/gatk-4.0.11.0/gatk-package-4.0.11.0-spark.jar

## LoFreq
wget https://github.com/CSB5/lofreq/raw/master/dist/lofreq_star-2.1.2_linux-x86-64.tgz
tar xvzf lofreq_star-2.1.2_linux-x86-64.tgz
rm lofreq_star-2.1.2_linux-x86-64.tgz

## Octopus
git clone -b develop https://github.com/luntergroup/octopus.git
octopus/scripts/install.py --install-dependencies --download-forests

## Pilon
wget https://github.com/broadinstitute/pilon/releases/download/v1.23/pilon-1.23.jar
chmod 755 pilon-1.23.jar

## Platypus (requires htslib)
wget http://www.well.ox.ac.uk/bioinformatics/Software/Platypus-latest.tgz
tar xvzf Platypus-latest.tgz
rm Platypus-latest.tgz
cd Platypus_0.8.1
cp -r /home/ndm.local/steveb/programs/htslib-1.7/htslib . # see https://stackoverflow.com/questions/31295559/platypus-installation-error-message
export C_INCLUDE_PATH=/home/ndm.local/steveb/programs/include # see https://github.com/andyrimmer/Platypus/blob/master/README.md
export LD_LIBRARY_PATH=/home/ndm.local/steveb/programs/lib
export LIBRARY_PATH=/home/ndm.local/steveb/programs/lib
./buildPlatypus.sh
cd ..

## Snippy
git clone https://github.com/tseemann/snippy.git

## SNVer
wget https://downloads.sourceforge.net/project/snver/SNVer-0.5.3.tar.gz
tar xvzf SNVer-0.5.3.tar.gz
rm SNVer-0.5.3.tar.gz
chmod 755 SNVerIndividual.jar SNVerPool.jar
chmod 755 lib/commons-math-2.2.jar lib/picard-1.54.jar lib/sam-1.54.jar lib/vcf.jar

## SNVSniffer (http://snvsniffer.sourceforge.net)
wget https://downloads.sourceforge.net/project/snvsniffer/SNVSniffer-v2.0.4_bin_x86_64.tar.gz
tar xvzf SNVSniffer-v2.0.4_bin_x86_64.tar.gz
rm SNVSniffer-v2.0.4_bin_x86_64.tar.gz
rm README

## SolSNP
mkdir SolSNP
cd SolSNP
wget https://downloads.sourceforge.net/project/solsnp/SolSNP-1.1/SolSNP-1.1.zip
unzip SolSNP-1.1.zip
rm SolSNP-1.1.zip
chmod 755 *.jar
cd ..

## SPANDx (https://github.com/dsarov/SPANDx)
git clone https://github.com/dsarov/SPANDx.git
cd SPANDx
chmod +x ./*
# now modify SPANDx.config to set SPANDx_LOCATION to the installation directory
# now modify scheduler.config to SCHEDULER to NONE

## SpeedSeq (https://github.com/hall-lab/speedseq)
git clone --recursive https://github.com/hall-lab/speedseq
cd speedseq
make

## Strelka
wget https://github.com/Illumina/strelka/releases/download/v2.9.2/strelka-2.9.2.centos6_x86_64.tar.bz2
tar xvjf strelka-2.9.2.centos6_x86_64.tar.bz2
rm strelka-2.9.2.centos6_x86_64.tar.bz2

## VarScan
wget https://downloads.sourceforge.net/project/varscan/VarScan.v2.3.9.jar
chmod 755 VarScan.v2.3.9.jar