Skip to content

Commit

Permalink
fix: out of bound panic in case of long deletions (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
holtgrewe authored Apr 6, 2023
1 parent 5d951b1 commit f0bcaa6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/mapper/altseq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ impl AltTranscriptData {
// transcripts from ENSEMBL, e.g., ENST00000420031.2). In this case, we will
// artificially cut down the amino acid sequence to this length.
let orig_aa_len = (cds_stop - cds_start + 1) as usize / 3;
let orig_aa_len = std::cmp::min(orig_aa_len, seq_aa.len());
let stop_pos = seq_aa[..orig_aa_len]
.rfind('*')
.or_else(|| seq_aa.find('*'));
Expand Down

0 comments on commit f0bcaa6

Please sign in to comment.