44GREEN=' \033[0;32m'
55RED=' \033[0;31m'
66NC=' \033[0m'
7- VERSION=" v1.1.8 "
7+ VERSION=" v1.1.9 "
88
99
1010if [ " $1 " == " --version" ] || [ " $1 " == " -v" ]; then
@@ -807,8 +807,71 @@ if [ -n "$genbank_list_file" ]; then
807807 # ## running in parallel if set, otherwise running in serial ###
808808 if [ $num_jobs == " 1" ]; then
809809 gtt-genbank-serial.sh $genbank_list_file $tmp_dir $hmm_file $genbank_genomes_total $num_cpus $hmm_target_genes_total $output_dir $best_hit_mode
810+
811+ # ## kill backstop ###
812+ # if there was a problem with the serial genbank genome processing, killing main program here and reporting
813+ if [ -s ${tmp_dir} /kill_genbank_serial.prodigal ]; then
814+
815+ problem_assembly=$( head -n 1 ${tmp_dir} /kill_genbank_serial.prodigal)
816+
817+ printf " \n\n ${RED} ############################################################################## \n" | tee -a $gtotree_log
818+ printf " ${RED} ############################################################################## \n" | tee -a $gtotree_log
819+ printf " ####${NC} GToTree is exiting without completing :( ${RED} ####\n" | tee -a $gtotree_log
820+ printf " ##############################################################################${NC} \n" | tee -a $gtotree_log
821+ printf " ${RED} ############################################################################## \n\n" | tee -a $gtotree_log
822+
823+ printf " ${RED} ************************** ${NC} REASON FOR TERMINATION ${RED} **************************${NC} \n" | tee -a $gtotree_log
824+ printf " Something went wrong with prodigal trying to call genes on the fasta\n" | tee -a $gtotree_log
825+ printf " file generated from assembly ${GREEN}${problem_assembly}${NC} .\n" | tee -a $gtotree_log
826+ printf " GToTree is not sure it should move forward when something odd is going\n" | tee -a $gtotree_log
827+ printf " on like this :(\n" | tee -a $gtotree_log
828+ printf " ${RED} **************************************************************************** ${NC} \n\n" | tee -a $gtotree_log
829+
830+ printf " \nExiting for now.\n\n" | tee -a $gtotree_log
831+
832+ # removing tmp directory unless debug set
833+ if [ $debug_flag == ' false' ]; then
834+ rm -rf $tmp_dir
835+ fi
836+
837+ mv $gtotree_log ${output_dir} /gtotree-runlog.txt
838+ exit
839+ fi
840+
810841 else
811842 cat $genbank_list_file | parallel -j $num_jobs gtt-genbank-parallel.sh {} $tmp_dir $hmm_file $num_cpus $hmm_target_genes_total $output_dir $best_hit_mode
843+
844+
845+ # ## kill backstop ###
846+ # if there was a problem with the parallel genbank genome processing, killing main program here and reporting
847+ if [ -s ${tmp_dir} /kill_genbank_parallel.prodigal ]; then
848+
849+ problem_assembly=$( head -n 1 ${tmp_dir} /kill_genbank_parallel.prodigal)
850+
851+ printf " \n\n ${RED} ############################################################################## \n" | tee -a $gtotree_log
852+ printf " ${RED} ############################################################################## \n" | tee -a $gtotree_log
853+ printf " ####${NC} GToTree is exiting without completing :( ${RED} ####\n" | tee -a $gtotree_log
854+ printf " ##############################################################################${NC} \n" | tee -a $gtotree_log
855+ printf " ${RED} ############################################################################## \n\n" | tee -a $gtotree_log
856+
857+ printf " ${RED} ************************** ${NC} REASON FOR TERMINATION ${RED} **************************${NC} \n" | tee -a $gtotree_log
858+ printf " Something went wrong with prodigal trying to call genes on the fasta\n" | tee -a $gtotree_log
859+ printf " file generated from assembly ${GREEN}${problem_assembly}${NC} .\n" | tee -a $gtotree_log
860+ printf " GToTree is not sure it should move forward when something odd is going\n" | tee -a $gtotree_log
861+ printf " on like this :(\n" | tee -a $gtotree_log
862+ printf " ${RED} **************************************************************************** ${NC} \n\n" | tee -a $gtotree_log
863+
864+ printf " \nExiting for now.\n\n" | tee -a $gtotree_log
865+
866+ # removing tmp directory unless debug set
867+ if [ $debug_flag == ' false' ]; then
868+ rm -rf $tmp_dir
869+ fi
870+
871+ mv $gtotree_log ${output_dir} /gtotree-runlog.txt
872+ exit
873+ fi
874+
812875 fi
813876
814877 mv ${tmp_dir} /genbank_genomes_list.tmp ${tmp_dir} /final_included_genbank_genomes.tmp
@@ -821,8 +884,6 @@ if [ -n "$genbank_list_file" ]; then
821884fi
822885
823886
824-
825-
826887# ############################################################################
827888# #################### FASTA-DERIVED GENOME PROCESSING #####################
828889# ############################################################################
@@ -848,10 +909,73 @@ if [ -n "$fasta_files" ]; then
848909 # ## running in parallel if set, otherwise running in serial ###
849910 if [ $num_jobs == " 1" ]; then
850911 gtt-fasta-serial.sh $fasta_files $tmp_dir $hmm_file $fasta_genomes_total $num_cpus $hmm_target_genes_total $output_dir $best_hit_mode
912+
913+ # ## kill backstop ###
914+ # if there was a problem with the serial fasta genome processing, killing main program here and reporting
915+ if [ -s ${tmp_dir} /kill_fasta_serial.prodigal ]; then
916+
917+ problem_assembly=$( head -n 1 ${tmp_dir} /kill_fasta_serial.prodigal)
918+
919+ printf " \n\n ${RED} ############################################################################## \n" | tee -a $gtotree_log
920+ printf " ${RED} ############################################################################## \n" | tee -a $gtotree_log
921+ printf " ####${NC} GToTree is exiting without completing :( ${RED} ####\n" | tee -a $gtotree_log
922+ printf " ##############################################################################${NC} \n" | tee -a $gtotree_log
923+ printf " ${RED} ############################################################################## \n\n" | tee -a $gtotree_log
924+
925+ printf " ${RED} ************************** ${NC} REASON FOR TERMINATION ${RED} **************************${NC} \n" | tee -a $gtotree_log
926+ printf " Something went wrong with prodigal trying to call genes on assembly\n" | tee -a $gtotree_log
927+ printf " ${GREEN}${problem_assembly}${NC} . GToTree is not sure it should\n" | tee -a $gtotree_log
928+ printf " move forward when something odd is going on like this :(\n" | tee -a $gtotree_log
929+ printf " ${RED} **************************************************************************** ${NC} \n\n" | tee -a $gtotree_log
930+
931+ printf " \nExiting for now.\n\n" | tee -a $gtotree_log
932+
933+ # removing tmp directory unless debug set
934+ if [ $debug_flag == ' false' ]; then
935+ rm -rf $tmp_dir
936+ fi
937+
938+ mv $gtotree_log ${output_dir} /gtotree-runlog.txt
939+ exit
940+ fi
941+
851942 else
852943 cat $fasta_files | parallel -j $num_jobs gtt-fasta-parallel.sh {} $tmp_dir $hmm_file $num_cpus $hmm_target_genes_total $output_dir $best_hit_mode
944+
945+ # ## kill backstop ###
946+ # if there was a problem with the parallel fasta genome processing, killing main program here and reporting
947+ if [ -s ${tmp_dir} /kill_fasta_parallel.prodigal ]; then
948+
949+ problem_assembly=$( head -n 1 ${tmp_dir} /kill_fasta_parallel.prodigal)
950+
951+ printf " \n\n ${RED} ############################################################################## \n" | tee -a $gtotree_log
952+ printf " ${RED} ############################################################################## \n" | tee -a $gtotree_log
953+ printf " ####${NC} GToTree is exiting without completing :( ${RED} ####\n" | tee -a $gtotree_log
954+ printf " ##############################################################################${NC} \n" | tee -a $gtotree_log
955+ printf " ${RED} ############################################################################## \n\n" | tee -a $gtotree_log
956+
957+ printf " ${RED} ************************** ${NC} REASON FOR TERMINATION ${RED} **************************${NC} \n" | tee -a $gtotree_log
958+ printf " Something went wrong with prodigal trying to call genes on assembly\n" | tee -a $gtotree_log
959+ printf " ${GREEN}${problem_assembly}${NC} . GToTree is not sure it should\n" | tee -a $gtotree_log
960+ printf " move forward when something odd is going on like this :(\n" | tee -a $gtotree_log
961+ printf " ${RED} **************************************************************************** ${NC} \n\n" | tee -a $gtotree_log
962+
963+ printf " \nExiting for now.\n\n" | tee -a $gtotree_log
964+
965+ # removing tmp directory unless debug set
966+ if [ $debug_flag == ' false' ]; then
967+ rm -rf $tmp_dir
968+ fi
969+
970+ mv $gtotree_log ${output_dir} /gtotree-runlog.txt
971+ exit
972+ fi
973+
853974 fi
854975
976+
977+
978+
855979 # adding retained genomes to genomes from all sources file
856980 cat ${tmp_dir} /fasta_genomes_list.tmp >> ${tmp_dir} /genomes_from_all_sources.tmp
857981
@@ -1658,6 +1782,7 @@ else
16581782fi
16591783
16601784# reporting primary output files
1785+
16611786printf " Full alignment written to file:\n" | tee -a $gtotree_log
16621787printf " ${GREEN}${output_dir} /Aligned_SCGs.faa${NC} \n\n" | tee -a $gtotree_log
16631788if [ -n " $file_to_genome_id_map " ] || [ $taxonkit_id_swap != " false" ]; then
@@ -1734,5 +1859,9 @@ duration=$SECONDS
17341859
17351860printf " Total process runtime: $(( $duration / 60 / 60 )) hours and $(( ($duration / 60 ) % 60 )) minutes.\n\n" | tee -a $gtotree_log
17361861
1862+ # reporting log file output
1863+ printf " Log file written to:\n" | tee -a $gtotree_log
1864+ printf " ${GREEN}${output_dir} /gtotree-runlog.txt${NC} \n\n" | tee -a $gtotree_log
1865+
17371866mv $gtotree_log ${output_dir} /gtotree-runlog.txt
1738- rm -rf * .tmp
1867+ rm -rf * .tmp
0 commit comments