diff tools/protein_analysis/wolf_psort.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 a290c6d4e658
children 99b82a2b1272
line wrap: on
line diff
--- a/tools/protein_analysis/wolf_psort.py	Mon Jul 30 12:56:54 2012 -0400
+++ b/tools/protein_analysis/wolf_psort.py	Fri Jan 25 06:08:31 2013 -0500
@@ -35,13 +35,13 @@
 """
 import sys
 import os
-from seq_analysis_utils import stop_err, split_fasta, run_jobs
+from seq_analysis_utils import stop_err, split_fasta, run_jobs, thread_count
 
 FASTA_CHUNK = 500
 exe = "runWolfPsortSummary"
 
 """
-Note: I had trouble getting runWolfPsortSummary on the path (via a link, other
+Note: I had trouble getting runWolfPsortSummary on the path (via a link), other
 than by including all of /opt/WoLFPSORT_package_v0.2/bin , so used a wrapper
 python script called runWolfPsortSummary as follows:
 
@@ -65,15 +65,8 @@
 if organism not in ["animal", "plant", "fungi"]:
    stop_err("Organism argument %s is not one of animal, plant, fungi" % organism)
 
-try:
-   num_threads = int(sys.argv[2])
-except:
-   num_threads = 0
-if num_threads < 1:
-   stop_err("Threads argument %s is not a positive integer" % sys.argv[2])
-
+num_threads = thread_count(sys.argv[2], default=4)
 fasta_file = sys.argv[3]
-
 tabular_file = sys.argv[4]
 
 def clean_tabular(raw_handle, out_handle):