#!/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 -f default.conf caracTest.dat
    rm -rf bin*.fasta
    
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 SGEMME with a user-provided alignment file."
    echo "Using a previously produced prot_jet.res file to check reproducibility!"
    cp ../tests/BLAT_jet.res .
    python $SGEMME_PATH/sgemme.py aliBLAT.fasta -r input -f aliBLAT.fasta --jetfile 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!"
    python $SGEMME_PATH/sgemme.py aliBLAT.fasta -r input -f aliBLAT.fasta --pdbfile blat-af2.pdb --normweightmode maxhalftracepchalftracecvhalfcvpc

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!"
    python $SGEMME_PATH/sgemme.py aliBLAT.fasta -r input -f aliBLAT.fasta --pdbfile blat-af2.pdb --normweightmode maxhalftracepchalftracecvhalfcvpc -m Stiffler_2015_BLAT_ECOLX.mut
   
else
    echo "Running SGEMME with a user-provided alignment file."
    python $SGEMME_PATH/sgemme.py aliBLAT.fasta -r input -f aliBLAT.fasta
    
fi
