diff tools/protein_analysis/signalp3.py @ 9:e52220a9ddad draft

Uploaded v0.1.2 Use the new <stdio> settings in the XML wrappers to catch errors. Obeys SGE style XNSLOTS environment variable for thread count (otherwise default to 4).
author peterjc
date Fri, 25 Jan 2013 06:08:31 -0500
parents 9b45a8743100
children 99b82a2b1272
line wrap: on
line diff
--- a/tools/protein_analysis/signalp3.py	Mon Jul 30 12:56:54 2012 -0400
+++ b/tools/protein_analysis/signalp3.py	Fri Jan 25 06:08:31 2013 -0500
@@ -56,7 +56,8 @@
 import sys
 import os
 import tempfile
-from seq_analysis_utils import stop_err, split_fasta, run_jobs, fasta_iterator
+from seq_analysis_utils import stop_err, split_fasta, fasta_iterator
+from seq_analysis_utils import run_jobs, thread_count
 
 FASTA_CHUNK = 500
 MAX_LEN = 6000 #Found by trial and error
@@ -78,15 +79,8 @@
 if truncate < 0:
    stop_err("Truncate argument %s is not a positive integer (or zero)" % sys.argv[2])
 
-try:
-   num_threads = int(sys.argv[3])
-except:
-   num_threads = 1 #Default, e.g. used "$NSLOTS" and environment variable not defined
-if num_threads < 1:
-   stop_err("Threads argument %s is not a positive integer" % sys.argv[3])
-
+num_threads = thread_count(sys.argv[3], default=4)
 fasta_file = sys.argv[4]
-
 tabular_file = sys.argv[5]
 
 if len(sys.argv) == 8: