Skip to content

Commit

Permalink
fix: issue with out of bounds deletion (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
holtgrewe authored Mar 24, 2023
1 parent 3ada6b2 commit 475398d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/mapper/altseq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,12 +324,16 @@ impl AltSeqBuilder {
_ => panic!("invalid variant"),
}

let seq = self.reference_data.transcript_sequence.to_owned();
let start = std::cmp::min(start_end[0], seq.len());
let end = std::cmp::min(start_end[1] + 1, seq.len());

(
self.reference_data.transcript_sequence.to_owned(),
seq,
self.reference_data.cds_start,
self.reference_data.cds_stop,
start_end[0],
start_end[1] + 1,
start,
end,
)
}

Expand Down

0 comments on commit 475398d

Please sign in to comment.