# HG changeset patch # User richard-burhans # Date 1723237840 0 # Node ID 3a67d287d19f4a1079471ac139503fe9bb04357d # Parent 4cd7884635c279d04085517a173f0c4bf98e85af planemo upload for repository https://github.com/richard-burhans/galaxytools/tree/main/tools/batched_lastz commit a5a11ffe6ec0c36c5997499a50d58c38c36d54ec diff -r 4cd7884635c2 -r 3a67d287d19f run_lastz_tarball.py --- 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)