Skip to content

Commit

Permalink
Contig stitcher: ensure no conflicting mappings in overlap
Browse files Browse the repository at this point in the history
  • Loading branch information
Donaim committed Jan 13, 2024
1 parent 4c9829a commit 14ea3bb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions micall/core/contig_stitcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,10 @@ def stitch_2_contigs(left, right):
aligned_right_r_index = right_overlap.alignment.coordinate_mapping.query_to_ref.right_min(aligned_right_q_index)
if aligned_right_r_index is None:
aligned_right_r_index = right_overlap.alignment.r_ei + 1
assert aligned_right_r_index > aligned_left_r_index
if aligned_right_r_index <= aligned_left_r_index:
# This should never happen due to how aligners work, but just to be sure...
aligned_right_r_index = aligned_left_r_index + 1

Check warning on line 370 in micall/core/contig_stitcher.py

View check run for this annotation

Codecov / codecov/patch

micall/core/contig_stitcher.py#L370

Added line #L370 was not covered by tests
left_overlap_take, left_overlap_drop = left_overlap.cut_reference(aligned_left_r_index + 0.5)
right_overlap_drop, right_overlap_take = right_overlap.cut_reference(aligned_right_r_index - 0.5)

Expand Down

0 comments on commit 14ea3bb

Please sign in to comment.