Mercurial > repos > peterjc > effectivet3
comparison tools/effectiveT3/effectiveT3.py @ 29:35c358aa7801 draft
planemo upload for repository https://github.com/peterjc/pico_galaxy/tree/master/tools/effectiveT3 commit 37d5b47ec23e2cbaa453cc660bb1fcbb10dd34ee-dirty
author | peterjc |
---|---|
date | Wed, 17 May 2017 11:16:58 -0400 |
parents | af14f755c05b |
children | 007e86eff414 |
comparison
equal
deleted
inserted
replaced
28:d6976a4c055b | 29:35c358aa7801 |
---|---|
19 effective_t3_dir = os.environ.get("EFFECTIVET3", "/opt/EffectiveT3/") | 19 effective_t3_dir = os.environ.get("EFFECTIVET3", "/opt/EffectiveT3/") |
20 effective_t3_jar = os.path.join(effective_t3_dir, "TTSS_GUI-1.0.1.jar") | 20 effective_t3_jar = os.path.join(effective_t3_dir, "TTSS_GUI-1.0.1.jar") |
21 | 21 |
22 if "-v" in sys.argv or "--version" in sys.argv: | 22 if "-v" in sys.argv or "--version" in sys.argv: |
23 # TODO - Get version of the JAR file dynamically? | 23 # TODO - Get version of the JAR file dynamically? |
24 print("Wrapper v0.0.17, TTSS_GUI-1.0.1.jar") | 24 print("Wrapper v0.0.19, TTSS_GUI-1.0.1.jar") |
25 sys.exit(0) | 25 sys.exit(0) |
26 | 26 |
27 if len(sys.argv) != 5: | 27 if len(sys.argv) != 5: |
28 sys.exit("Require four arguments: model, threshold, input protein FASTA file & output tabular file") | 28 sys.exit("Require four arguments: model, threshold, input protein FASTA file & output tabular file") |
29 | 29 |
72 """Run the command line string via subprocess.""" | 72 """Run the command line string via subprocess.""" |
73 # Avoid using shell=True when we call subprocess to ensure if the Python | 73 # Avoid using shell=True when we call subprocess to ensure if the Python |
74 # script is killed, so too is the child process. | 74 # script is killed, so too is the child process. |
75 try: | 75 try: |
76 child = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) | 76 child = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
77 except Exception, err: | 77 except Exception as err: |
78 sys.exit("Error invoking command:\n%s\n\n%s\n" % (" ".join(cmd), err)) | 78 sys.exit("Error invoking command:\n%s\n\n%s\n" % (" ".join(cmd), err)) |
79 # Use .communicate as can get deadlocks with .wait(), | 79 # Use .communicate as can get deadlocks with .wait(), |
80 stdout, stderr = child.communicate() | 80 stdout, stderr = child.communicate() |
81 return_code = child.returncode | 81 return_code = child.returncode |
82 if return_code or stderr.startswith("Exception in thread"): | 82 if return_code or stderr.startswith("Exception in thread"): |