Skip to content

Commit

Permalink
Contig stitcher: improve alignment visualisation
Browse files Browse the repository at this point in the history
Make sure that alignment does not go outside the range of the
reference sequence.
  • Loading branch information
Donaim committed Jan 22, 2024
1 parent 135ef59 commit 6f94af8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 18 deletions.
2 changes: 2 additions & 0 deletions micall/core/plot_contigs.py
Original file line number Diff line number Diff line change
Expand Up @@ -787,6 +787,7 @@ def get_neighbour(part, lookup):
else:
start_delta = -1 * part.alignment.q_st
r_st = part.alignment.r_st + start_delta + position_offset
r_st = max(r_st, 0)

if next_part is not None:
r_ei = next_part.alignment.r_ei + position_offset
Expand All @@ -796,6 +797,7 @@ def get_neighbour(part, lookup):
else:
end_delta = len(part.seq) - 1 - part.alignment.q_ei
r_ei = part.alignment.r_ei + end_delta + position_offset
r_ei = min(r_ei, len(part.ref_seq) + position_offset)

aligned_size_map[part.name] = (r_st, r_ei)

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6f94af8

Please sign in to comment.