#!/bin/bash

if [ "$1" == "clean" ]
then
    echo "Cleaning the folder."
    # rm -rf BLAT_*.txt
    # rm -rf BLAT_*.png
    # rm -rf BLAT.pdb
    # rm -rf BLAT.fasta
    rm -rf BLAT*
    rm -rf *.R
    rm -rf *.txt
    rm -f default.conf caracTest.dat
    rm -rf bin*.fasta
    rm -rf ../data/blat-af2.pdb.dssp ../data/blat-af2.pdb.dssp.new
elif [ "$1" == "jetoff" ]
then
    # If you have your own JET2 score file, you can turn off JET2 as follows:
    # In ../tests folder, you can find a sample JET2 file called BLAT_jet.res 
    echo "Running PRESCOTT with a user-provided alignment file."
    echo "Using a previously produced prot_jet.res file to check reproducibility!"

    escott ../data/aliBLAT.fasta --jetfile ../data/BLAT_jet.res

elif [ "$1" == "withpdb" ]
then

    #Please note that CV isa structural feature and it can not be calculated if you don't specify a pdb file.
    echo "Using blat-af2.pdb for the structural feature calculations!"
    echo "Entire mutational map of the protein will be calculated!"
    escott ../data/aliBLAT.fasta --pdbfile ../data/blat-af2.pdb

elif [ "$1" == "withpdb-withmutfile" ]
then

    #Please note that CV isa structural feature and it can not be calculated if you don't specify a pdb file.
    echo "Using blat-af2.pdb for the structural feature calculations!"
    echo "Only effects of mutations specified in the Stiffler_2015_BLAT_ECOLX.mut file will be calculated!"
    escott ../data/aliBLAT.fasta --pdbfile ../data/blat-af2.pdb -m ../data/Stiffler_2015_BLAT_ECOLX.mut
    demust compare -i ../data/BLAT_ECOLX_Stiffler_2015_experimental.dat --itype singleline -j BLAT_normPred_evolCombi.txt --jtype singleline

elif [ "$1" == "cvrc-test" ]
then

    #Please note that CV isa structural feature and it can not be calculated if you don't specify a pdb file.
    echo "Using blat-af2.pdb for the structural feature calculations!"
    echo "Only effects of mutations specified in the Stiffler_2015_BLAT_ECOLX.mut file will be calculated!"
    escott ../data/aliBLAT.fasta --pdbfile ../data/blat-af2.pdb -m ../data/Stiffler_2015_BLAT_ECOLX.mut --cvrc 9
    demust compare -i ../data/BLAT_ECOLX_Stiffler_2015_experimental.dat --itype singleline -j BLAT_normPred_evolCombi.txt --jtype singleline

    
else
    echo "Running ESCOTT with a user-provided alignment file."
    echo "Since a pdb file is not provided, only evolutionary information will be used!"
    escott ../data/aliBLAT.fasta
    
fi
