Mercurial > repos > peterjc > tmhmm_and_signalp
comparison tools/protein_analysis/seq_analysis_utils.py @ 26:20139cb4c844 draft
planemo upload for repository https://github.com/peterjc/pico_galaxy/tools/protein_analysis commit 221d4187992cbb993e02dc3ea0ef0150c7916a4a-dirty
author | peterjc |
---|---|
date | Wed, 13 May 2015 06:14:42 -0400 |
parents | 41a42022f815 |
children | 3cb02adf4326 |
comparison
equal
deleted
inserted
replaced
25:41a42022f815 | 26:20139cb4c844 |
---|---|
12 import subprocess | 12 import subprocess |
13 from time import sleep | 13 from time import sleep |
14 | 14 |
15 __version__ = "0.0.1" | 15 __version__ = "0.0.1" |
16 | 16 |
17 def stop_err(msg, error_level=1): | 17 def sys_exit(msg, error_level=1): |
18 """Print error message to stdout and quit with given error level.""" | 18 """Print error message to stdout and quit with given error level.""" |
19 sys.stderr.write("%s\n" % msg) | 19 sys.stderr.write("%s\n" % msg) |
20 sys.exit(error_level) | 20 sys.exit(error_level) |
21 | 21 |
22 try: | 22 try: |
55 try: | 55 try: |
56 num = int(command_line_arg) | 56 num = int(command_line_arg) |
57 except: | 57 except: |
58 num = default | 58 num = default |
59 if num < 1: | 59 if num < 1: |
60 stop_err("Threads argument %r is not a positive integer" % command_line_arg) | 60 sys_exit("Threads argument %r is not a positive integer" % command_line_arg) |
61 #Cap this with the pysical limit of the machine, | 61 #Cap this with the pysical limit of the machine, |
62 try: | 62 try: |
63 num = min(num, cpu_count()) | 63 num = min(num, cpu_count()) |
64 except NotImplementedError: | 64 except NotImplementedError: |
65 pass | 65 pass |