changeset 10:d10e7502aba8 draft

planemo upload for repository https://github.com/richard-burhans/galaxytools/tree/main/tools/batched_lastz commit effd27b9070dc4564d3cea38869d3bf043201683
author richard-burhans
date Tue, 13 Aug 2024 15:56:46 +0000
parents 1ac663f6a344
children aa5586d83ae3
files macros.xml run_lastz_tarball.py
diffstat 2 files changed, 13 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/macros.xml	Mon Aug 12 15:41:05 2024 +0000
+++ b/macros.xml	Tue Aug 13 15:56:46 2024 +0000
@@ -6,7 +6,7 @@
         </requirements>
     </xml>
     <token name="@TOOL_VERSION@">1.04.22</token>
-    <token name="@VERSION_SUFFIX@">1</token>
+    <token name="@VERSION_SUFFIX@">2</token>
     <token name="@PROFILE@">21.05</token>
     <xml name="citations">
         <citations>
--- a/run_lastz_tarball.py	Mon Aug 12 15:41:05 2024 +0000
+++ b/run_lastz_tarball.py	Tue Aug 13 15:56:46 2024 +0000
@@ -34,6 +34,13 @@
 ) -> None:
     os.chdir("galaxy/files")
 
+    # These are not considered errors even though
+    # we will end up with a segmented alignment
+    truncation_regex = re.compile(
+        r"truncating alignment (ending|starting) at \(\d+,\d+\);  anchor at \(\d+,\d+\)$"
+    )
+    truncation_msg = "truncation can be reduced by using --allocate:traceback to increase traceback memory"
+
     while True:
         command_dict = input_queue.get()
 
@@ -80,7 +87,6 @@
             output_queue.put(elapsed)
 
         elif p.returncode == 1:
-            # should be more robust
             traceback_warning = True
 
             stderr_file = command_dict["stderr"]
@@ -89,12 +95,11 @@
             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:
+                        if (
+                            not truncation_regex.match(stderr_line)
+                            and stderr_line != truncation_msg
+                        ):
                             traceback_warning = False
 
             if traceback_warning:
@@ -229,9 +234,7 @@
                 format_name = f.readline()
                 format_name = format_name.rstrip("\n")
         except FileNotFoundError:
-            sys.exit(
-                f"ERROR: input tarball missing galaxy/format.txt: {self.pathname}"
-            )
+            sys.exit(f"ERROR: input tarball missing galaxy/format.txt: {self.pathname}")
 
         if format_name in ["bam", "maf"]:
             self.format_name = format_name