Skip to content

Commit

Permalink
fix(call): errors from offsetting the entire flank seq
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlougheed committed Nov 18, 2024
1 parent 24cc09c commit af4d120
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions strkit/call/repeats.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,13 @@ def get_ref_repeat_count(
l_offset = rev_top_res[1][1]
r_offset = fwd_top_res[1][1]

if l_offset >= len(flank_left_seq):
# don't do anything weird if we're removing the entire flank sequence
# TODO: this can be caused by NNNNNNN - see chr5:139453668-139454525 in GRCh38
l_offset = 0
if r_offset >= len(flank_right_seq):
r_offset = 0 # same here

if l_offset > 0:
tr_seq = flank_left_seq[-1*l_offset:] + tr_seq # first, move a chunk of the left flank to the TR seq
flank_left_seq = flank_left_seq[:-1*l_offset] # then, remove that chunk from the left flank
Expand Down

0 comments on commit af4d120

Please sign in to comment.