Skip to content

Commit

Permalink
fix: truncate AA insertion at stop codon (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
holtgrewe authored Mar 24, 2023
1 parent 475398d commit 54231b9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/mapper/altseq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -947,6 +947,15 @@ impl AltSeqToHgvsp {
) -> Result<HgvsVariant, anyhow::Error> {
assert!(start.is_some() == end.is_some());

// If the `alternative` contains a stop codon (`*`/`X`) then we have to truncate
// after it.
let alternative = if let Some(pos) = alternative.find('*').or_else(|| alternative.find('X'))
{
&alternative[..=pos]
} else {
alternative
};

let loc_edit = if is_init_met {
ProtLocEdit::InitiationUncertain
} else if is_ambiguous {
Expand Down

0 comments on commit 54231b9

Please sign in to comment.