Skip to content

Commit

Permalink
Update fgpyo/sam/__init__.py
Browse files Browse the repository at this point in the history
Co-authored-by: Matt Stone <[email protected]>
  • Loading branch information
yfarjoun and msto authored Sep 19, 2024
1 parent e610f1e commit 3542b61
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fgpyo/sam/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,11 +572,14 @@ def get_alignment_offsets(self, reverse: bool = False) -> Tuple[int, int]:
elements = self.elements if not reverse else reversed(self.elements)
for cig_el in elements:
if cig_el.operator.is_clipping and not alignment_began:
# We are in the clipping operators preceding the alignment
start_offset += cig_el.length_on_query
end_offset += cig_el.length_on_query
elif cig_el.operator.is_clipping:
# We have exited the alignment and are in the clipping operators after the alignment
break
else:
# We are within the alignment
alignment_began = True
end_offset += cig_el.length_on_query

Expand Down

0 comments on commit 3542b61

Please sign in to comment.