Skip to content

Commit

Permalink
Merge pull request #18 from richard-burhans/update-batched-lastz
Browse files Browse the repository at this point in the history
updating check for truncated alignment
  • Loading branch information
richard-burhans authored Aug 13, 2024
2 parents 52a5597 + 6992d50 commit effd27b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion tools/batched_lastz/macros.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
21 changes: 12 additions & 9 deletions tools/batched_lastz/run_lastz_tarball.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ def run_command(
) -> 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()

Expand Down Expand Up @@ -80,7 +87,6 @@ def run_command(
output_queue.put(elapsed)

elif p.returncode == 1:
# should be more robust
traceback_warning = True

stderr_file = command_dict["stderr"]
Expand All @@ -89,12 +95,11 @@ def run_command(
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:
Expand Down Expand Up @@ -229,9 +234,7 @@ def _load_format(self) -> None:
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
Expand Down

0 comments on commit effd27b

Please sign in to comment.