diff tools/mira4/mira4.py @ 11:02350bef2e99 draft

Uploaded v0.0.2 preview 3, correction regression in URL
author peterjc
date Tue, 10 Dec 2013 06:29:13 -0500
parents 302d13490b23
children a6a56440567c
line wrap: on
line diff
--- a/tools/mira4/mira4.py	Tue Dec 10 06:26:19 2013 -0500
+++ b/tools/mira4/mira4.py	Tue Dec 10 06:29:13 2013 -0500
@@ -57,27 +57,13 @@
         print "WARNING: miraconvert %s" % mira_convert_ver
     sys.exit(0)
 
-def fix_threads(manifest):
-    """Tweak the manifest to alter the number of threads."""
-    try:
-        threads = int(os.environ.get("GALAXY_SLOTS", "1"))
-    except ValueError:
-        threads = 1
-    assert 1 <= threads 
-    if threads == 1:
-        #Nothing to do...
-        return
 
-    handle = open(manifest)
-    text = handle.read()
-    handle.close()
+try:
+    threads = int(os.environ.get("GALAXY_SLOTS", "1"))
+except ValueError:
+    threads = 1
+assert 1 <= threads, threads
 
-    text = text.replace(" -GE:not=1 ", " -GE:not=%i " % threads)
-
-    handle = open(manifest, "w")
-    handle.write(text)
-    handle.flush()
-    handle.close()
 
 def log_manifest(manifest):
     """Write the manifest file to stderr."""
@@ -150,11 +136,9 @@
 name = "MIRA"
 manifest, out_maf, out_bam, out_fasta, out_log = sys.argv[1:]
 
-fix_threads(manifest)
-
 start_time = time.time()
 #cmd_list =sys.argv[8:]
-cmd_list = [mira_binary, manifest]
+cmd_list = [mira_binary, "-t", str(threads), manifest]
 cmd = " ".join(cmd_list)
 
 assert os.path.isdir(temp)