Commit faafebd8 by Mustafa Tekpinar

Added a timer function to sgemme.py to show total compute time.

parent a53a653e
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -9,27 +9,33 @@ then ...@@ -9,27 +9,33 @@ then
# rm -rf BLAT.fasta # rm -rf BLAT.fasta
rm -rf BLAT* rm -rf BLAT*
rm -f default.conf caracTest.dat rm -f default.conf caracTest.dat
rm -rf bin*.fasta
elif [ "$1" == "jetoff" ] elif [ "$1" == "jetoff" ]
then then
# If you have your own JET2 score file, you can turn off JET2 as follows: # 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 # In ../tests folder, you can find a sample JET2 file called BLAT_jet.res
echo "Running GEMME with a user-provided alignment file." echo "Running SGEMME with a user-provided alignment file."
echo "Using a previously produced prot_jet.res file to check reproducibility!" echo "Using a previously produced prot_jet.res file to check reproducibility!"
cp ../tests/BLAT_jet.res . cp ../tests/BLAT_jet.res .
python $GEMME_PATH/gemme.py aliBLAT.fasta -r input -f aliBLAT.fasta --jetfile BLAT_jet.res python $SGEMME_PATH/sgemme.py aliBLAT.fasta -r input -f aliBLAT.fasta --jetfile BLAT_jet.res
elif [ "$1" == "withpdb" ] elif [ "$1" == "withpdb" ]
then then
#Please note that CV isa structural feature and it can not be calculated if you don't specify a pdb file. #Please note that CV isa structural feature and it can not be calculated if you don't specify a pdb file.
echo "Using blat-curated.pdb for the structural feature calculations!" echo "Using blat-af2.pdb for the structural feature calculations!"
python $GEMME_PATH/gemme.py aliBLAT.fasta -r input -f aliBLAT.fasta --pdbfile blat-curated.pdb --normweightmode dfi python $SGEMME_PATH/sgemme.py aliBLAT.fasta -r input -f aliBLAT.fasta --pdbfile blat-af2.pdb --normweightmode maxhalftracepchalftracecvhalfcvpc
else elif [ "$1" == "withpdb-withmutfile" ]
echo "Running GEMME with a user-provided alignment file." then
python $GEMME_PATH/gemme.py aliBLAT.fasta -r input -f aliBLAT.fasta
fi #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
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Copyright (c) 2018: Elodie Laine # Copyright (c) 2018: Elodie Laine
# Copyright (c) 2022: Mustafa Tekpinar # Copyright (c) 2022-2023: Mustafa Tekpinar
# This code is part of the gemme package and governed by its license. # This code is part of the gemme package and governed by its license.
# Please see the LICENSE.txt file included as part of this package. # Please see the LICENSE.txt file included as part of this package.
import sys import sys
import os import os
import time
import argparse import argparse
import re import re
import subprocess import subprocess
...@@ -672,11 +673,17 @@ def doit(inAli,mutFile,retMet,bFile,fFile,n,N, jetfile, pdbfile, normWeightMode, ...@@ -672,11 +673,17 @@ def doit(inAli,mutFile,retMet,bFile,fFile,n,N, jetfile, pdbfile, normWeightMode,
def main(): def main():
tic = time.perf_counter()
args = parse_command_line() args = parse_command_line()
doit(args.input,args.mutations,args.retrievingMethod,args.blastFile,\ doit(args.input,args.mutations,args.retrievingMethod,args.blastFile,\
args.fastaFile,args.nIter,args.NSeqs, args.jetfile, args.pdbfile,\ args.fastaFile,args.nIter,args.NSeqs, args.jetfile, args.pdbfile,\
args.normweightmode, args.alphabet) args.normweightmode, args.alphabet)
toc = time.perf_counter()
print(f"S-GEMME computation finished in {toc - tic:0.4f} seconds!")
if (__name__ == '__main__'): if (__name__ == '__main__'):
main() main()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment