Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Sec and Stop coincide in SEPHS2 #214

Merged
merged 2 commits into from
Dec 9, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/mapper/altseq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,19 @@ impl AltTranscriptData {
) -> Result<Self, Error> {
let transcript_sequence = seq.to_owned();
let aa_sequence = if !seq.is_empty() {
let seq_cds = &transcript_sequence[((cds_start - 1) as usize)..];
// In case of SEPHS2 / HGNC:19686, the last amino acid is both a selenocysteine
// and a stop codon.
// We handle this by explicitly truncating the sequence at the Sec + stop codon.
// This heuristic may not always be correct;
// alternatively/additionally, we could check `protein_accession` for known cases.
let seq_cds = if translation_table == TranslationTable::Selenocysteine
&& ref_aa_sequence.ends_with('U')
{
&transcript_sequence[((cds_start - 1) as usize)..cds_stop as usize]
} else {
&transcript_sequence[((cds_start - 1) as usize)..]
};

let seq_aa = if variant_start_aa.is_some() {
translate_cds(seq_cds, false, "X", translation_table)?
} else {
Expand Down
Loading