Skip to content

Commit

Permalink
fix last window going over the end of reference seq
Browse files Browse the repository at this point in the history
  • Loading branch information
LaraFuhrmann committed Apr 25, 2024
1 parent 6b29140 commit c9dabb8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions viloca/tiling.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def get_window_tilings(self) -> List[Tuple[int, int]]:
))
while window_positions[-1] + self.window_length >= self.end:
del window_positions[-1] # FIXME uncommented to create one single window
window_positions.append(self.end - 1 - self.window_length)
#window_positions.append(self.end - 1 - self.window_length)

else:
window_positions = list(range(
Expand All @@ -120,7 +120,11 @@ def get_window_tilings(self) -> List[Tuple[int, int]]:
if self.exact_conformance_overlap_at_boundary == True:
window_positions.append(window_positions[-1] + self.incr)

return [(i, self.window_length) for i in window_positions]
tiling = [(i, self.window_length) for i in window_positions]
if tiling[-1][0] + tiling[-1][1] >= self.end:
tiling[-1][1] = self.end-1 -tiling[-1][0]

return tiling

def get_reference_name(self):
return self.reference_name
Expand Down

0 comments on commit c9dabb8

Please sign in to comment.