diff tools/effectiveT3/effectiveT3.py @ 9:512530020360 draft

v0.0.18 Internal changes to command line handling
author peterjc
date Tue, 16 May 2017 09:17:17 -0400
parents 60a9b3f760cc
children a46d7861c32c
line wrap: on
line diff
--- a/tools/effectiveT3/effectiveT3.py	Wed Feb 01 09:22:21 2017 -0500
+++ b/tools/effectiveT3/effectiveT3.py	Tue May 16 09:17:17 2017 -0400
@@ -11,9 +11,9 @@
 webservice), and reformats the semi-colon separated output into
 tab separated output for use in Galaxy.
 """
-import sys
 import os
 import subprocess
+import sys
 
 # The Galaxy auto-install via tool_dependencies.xml will set this environment variable
 effective_t3_dir = os.environ.get("EFFECTIVET3", "/opt/EffectiveT3/")
@@ -32,8 +32,7 @@
 if not os.path.isfile(fasta_file):
     sys.exit("Input FASTA file not found: %s" % fasta_file)
 
-if threshold not in ["selective", "sensitive"] \
-    and not threshold.startswith("cutoff="):
+if threshold not in ["selective", "sensitive"] and not threshold.startswith("cutoff="):
     sys.exit("Threshold should be selective, sensitive, or cutoff=..., not %r" % threshold)
 
 
@@ -43,8 +42,7 @@
     positive = 0
     errors = 0
     for line in raw_handle:
-        if not line or line.startswith("#") \
-            or line.startswith("Id; Description; Score;"):
+        if not line or line.startswith("#") or line.startswith("Id; Description; Score;"):
             continue
         assert line.count(";") >= 3, repr(line)
         # Normally there will just be three semi-colons, however the
@@ -71,6 +69,7 @@
 
 
 def run(cmd):
+    """Run the command line string via subprocess."""
     # Avoid using shell=True when we call subprocess to ensure if the Python
     # script is killed, so too is the child process.
     try: