#PBS -l select=1:ncpus=1:mem=2gb
#PBS -l walltime=48:00:00
set -e
module load anaconda3/personal
source activate
conda activate gps_pbp
cd /rds/general/project/bacterial_evo_genomics/live/gps_annotations_4_2_2020/gps_pbp_runs
current_dir=$(head -n 2 re_run_trims.txt | tail -n 1)
echo "In this directory now ${current_dir}"
cd $current_dir
out_prefix=$(echo $current_dir | grep -o -a cluster_[0-9]*_)
out_file="${out_prefix}_trim_predictions.csv"
echo "In this out file ${out_file}"
ls -d $PWD/*.gff > cluster_gff_file.txt
ls -d $PWD/*.velvet.fasta > cluster_fasta_list.txt
echo "Now running the python script"
python ../gps_pbp_runs/pbp_tpd_extraction/python/pen_checker_cdc.py --gff cluster_gff_file.txt \
--pbp dhfR --aln ../gps_pbp_runs/pbp_tpd_extraction/data/pbp1a.faa --tlength 2159 \
--output $out_file --tolerance 100 --gene dhfR \
--data_dir ../gps_pbp_runs/pbp_tpd_extraction/data \
--fasta cluster_fasta_list.txt
cp $out_file ../gps_pbp_runs
cd ../gps_pbp_runs
echo $out_prefix >> gps_trim_finished.txt