comparison 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
comparison
equal deleted inserted replaced
8:976a5f2833cd 9:e52220a9ddad
54 the predictors which gives a cleavage site). *WORK IN PROGRESS* 54 the predictors which gives a cleavage site). *WORK IN PROGRESS*
55 """ 55 """
56 import sys 56 import sys
57 import os 57 import os
58 import tempfile 58 import tempfile
59 from seq_analysis_utils import stop_err, split_fasta, run_jobs, fasta_iterator 59 from seq_analysis_utils import stop_err, split_fasta, fasta_iterator
60 from seq_analysis_utils import run_jobs, thread_count
60 61
61 FASTA_CHUNK = 500 62 FASTA_CHUNK = 500
62 MAX_LEN = 6000 #Found by trial and error 63 MAX_LEN = 6000 #Found by trial and error
63 64
64 if len(sys.argv) not in [6,8]: 65 if len(sys.argv) not in [6,8]:
76 except: 77 except:
77 truncate = 0 78 truncate = 0
78 if truncate < 0: 79 if truncate < 0:
79 stop_err("Truncate argument %s is not a positive integer (or zero)" % sys.argv[2]) 80 stop_err("Truncate argument %s is not a positive integer (or zero)" % sys.argv[2])
80 81
81 try: 82 num_threads = thread_count(sys.argv[3], default=4)
82 num_threads = int(sys.argv[3])
83 except:
84 num_threads = 1 #Default, e.g. used "$NSLOTS" and environment variable not defined
85 if num_threads < 1:
86 stop_err("Threads argument %s is not a positive integer" % sys.argv[3])
87
88 fasta_file = sys.argv[4] 83 fasta_file = sys.argv[4]
89
90 tabular_file = sys.argv[5] 84 tabular_file = sys.argv[5]
91 85
92 if len(sys.argv) == 8: 86 if len(sys.argv) == 8:
93 cut_method = sys.argv[6] 87 cut_method = sys.argv[6]
94 if cut_method not in ["NN_Cmax", "NN_Ymax", "NN_Smax", "HMM_Cmax"]: 88 if cut_method not in ["NN_Cmax", "NN_Ymax", "NN_Smax", "HMM_Cmax"]: