changeset 8:3a67d287d19f draft

planemo upload for repository https://github.com/richard-burhans/galaxytools/tree/main/tools/batched_lastz commit a5a11ffe6ec0c36c5997499a50d58c38c36d54ec
author richard-burhans
date Fri, 09 Aug 2024 21:10:40 +0000
parents 4cd7884635c2
children 1ac663f6a344
files run_lastz_tarball.py
diffstat 1 files changed, 29 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/run_lastz_tarball.py	Tue Jul 30 19:53:53 2024 +0000
+++ b/run_lastz_tarball.py	Fri Aug 09 21:10:40 2024 +0000
@@ -40,7 +40,7 @@
         if not command_dict:
             return
 
-        args = ["lastz"]
+        args = ["lastz", "--allocate:traceback=1.99G"]
         args.extend(command_dict["args"])
 
         stdin = command_dict["stdin"]
@@ -62,9 +62,7 @@
             if var is not None:
                 var.close()
 
-        if p.returncode != 0:
-            sys.exit(f"command failed: {' '.join(args)}")
-        else:
+        if p.returncode == 0:
             stderr = command_dict["stderr"]
             if stderr is not None:
                 try:
@@ -81,6 +79,33 @@
             elapsed = time.perf_counter() - begin
             output_queue.put(elapsed)
 
+        elif p.returncode == 1:
+            # should be more robust
+            traceback_warning = True
+
+            stderr_file = command_dict["stderr"]
+            if stderr_file is None:
+                traceback_warning = False
+            else:
+                with open(stderr_file) as f:
+                    for stderr_line in f:
+                        for prefix in ["truncating alignment", "truncation can be reduced"]:
+                            if stderr_line.startswith(prefix):
+                                continue
+
+                        stderr_line = stderr_line.strip()
+                        if stderr_line:
+                            traceback_warning = False
+
+            if traceback_warning:
+                elapsed = time.perf_counter() - begin
+                output_queue.put(elapsed)
+            else:
+                sys.exit(f"command failed: {' '.join(args)}")
+
+        else:
+            sys.exit(f"command failed: {' '.join(args)}")
+
         if debug:
             print(f"runtime {elapsed}", file=sys.stderr, flush=True)