#! /usr/bin/bash

# the following are necessary for Cogent
echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/ZIM-gast/repos/Cogent/Complete-Striped-Smith-Waterman-Library/src' >> $HOME/.bashrc
echo 'export PYTHONPATH=$PYTHONPATH:/home/ZIM-gast/repos/Cogent/Complete-Striped-Smith-Waterman-Library/src' >> $HOME/.bashrc
source $HOME/.bashrc

# easy things
pip3 install HTSeq
pip3 install scikit-learn

oldpwd=`pwd`

mkdir repos/alisandra
cd repos/alisandra
# cDNAcupcake (originally from Magdoll of course, but patched)
git clone https://github.com/alisandra/cDNA_Cupcake.git
cd cDNA_Cupcake/
pip3 install -r requirements.txt
python3 setup.py build
python3 setup.py install
cd $oldpwd

#mkdir Magdoll
#cd Magdoll
# Cogent
cd repos/alisandra
git clone https://github.com/Magdoll/Cogent.git  # 22 Aug 2018
cd Cogent
#git checkout tags/v3.3  # need the new commit for the format error, also that's old
git submodule update --init --recursive
cd Complete-Striped-Smith-Waterman-Library/src/
make
cd ../..
python3 setup.py build
python3 setup.py install
cd ../..


# ANGEL
cd $oldpwd
cd repos/alisandra
mkdir PacificBiosciences
cd PacificBiosciences
git clone https://github.com/PacificBiosciences/ANGEL.git # 22 Aug 2018
cd ANGEL
python3 setup.py build
python3 setup.py install
cd ../..

# Quast
wget https://sourceforge.net/projects/quast/files/quast-5.0.0.tar.gz
tar xvf quast-5.0.0.tar.gz

cd quast-5.0.0
python3 setup.py install
cd ..

# the remaining pbcoretools and dependency stuff
# I only do this for _dataset create_ but for any expansion to the current
# pipeline it's probably necessary
git clone https://github.com/PacificBiosciences/pbcore.git
git clone https://github.com/PacificBiosciences/pbcommand.git

# pip versions for the next two were not recent enough for pbcoretools...
cd pbcore
git checkout 1.5.1
pip3 install -r requirements.txt
python3 setup.py install
cd ..

cd pbcommand
git checkout 1.1.1
pip3 install -r REQUIREMENTS.txt 
python3 setup.py install
cd ..

# not working, not sure if we'll need after a isoseq pipline update anyway...
#git clone https://github.com/PacificBiosciences/pbcoretools.git
#cd pbcoretools
#git checkout 0.2.4
#pip3 install -r requirements.txt 
#python3 setup.py install
#cd ..
