diff tools/protein_analysis/psortb.py @ 18:eb6ac44d4b8e draft

Suite v0.2.8, record Promoter 2 verion + misc internal updates
author peterjc
date Tue, 01 Sep 2015 09:56:36 -0400
parents 99b82a2b1272
children f3ecd80850e2
line wrap: on
line diff
--- a/tools/protein_analysis/psortb.py	Fri Nov 21 08:19:09 2014 -0500
+++ b/tools/protein_analysis/psortb.py	Tue Sep 01 09:56:36 2015 -0400
@@ -24,7 +24,7 @@
 import sys
 import os
 import tempfile
-from seq_analysis_utils import stop_err, split_fasta, run_jobs, thread_count
+from seq_analysis_utils import sys_exit, split_fasta, run_jobs, thread_count
 
 FASTA_CHUNK = 500
 
@@ -33,7 +33,7 @@
     sys.exit(os.system("psort --version"))
 
 if len(sys.argv) != 8:
-    stop_err("Require 7 arguments, number of threads (int), type (e.g. archaea), "
+    sys_exit("Require 7 arguments, number of threads (int), type (e.g. archaea), "
              "output (e.g. terse/normal/long), cutoff, divergent, input protein "
              "FASTA file & output tabular file")
 
@@ -56,7 +56,7 @@
 if out_type == "terse":
     header = ['SeqID', 'Localization', 'Score']
 elif out_type == "normal":
-    stop_err("Normal output not implemented yet, sorry.")
+    sys_exit("Normal output not implemented yet, sorry.")
 elif out_type == "long":
     if org_type == "-n":
         #Gram negative bacteria
@@ -93,9 +93,9 @@
                   'Extracellular_Score', 'Final_Localization', 'Final_Localization_Details', 'Final_Score',
                   'Secondary_Localization', 'PSortb_Version']
     else:
-        stop_err("Expected -n, -p or -a for the organism type, not %r" % org_type)
+        sys_exit("Expected -n, -p or -a for the organism type, not %r" % org_type)
 else:
-    stop_err("Expected terse, normal or long for the output type, not %r" % out_type)
+    sys_exit("Expected terse, normal or long for the output type, not %r" % out_type)
 
 tmp_dir = tempfile.mkdtemp()
 
@@ -149,7 +149,7 @@
         except IOError:
             output = ""
         clean_up(fasta_files + temp_files)
-        stop_err("One or more tasks failed, e.g. %i from %r gave:\n%s" % (error_level, cmd, output),
+        sys_exit("One or more tasks failed, e.g. %i from %r gave:\n%s" % (error_level, cmd, output),
                  error_level)
 del results
 del jobs
@@ -163,7 +163,7 @@
     data_handle.close()
     if not count:
         clean_up(fasta_files + temp_files)
-        stop_err("No output from psortb")
+        sys_exit("No output from psortb")
 out_handle.close()
 print "%i records" % count