Skip to content

Conversation

nakib103
Copy link
Contributor

@nakib103 nakib103 commented Sep 25, 2025

ENSVAR-6654

Handle special cases for inframe_insertion

  • ref and alt pep both * - not an inframe_insertion.
    Ideally we should not get $ref_pep == $alt_pep with the check of length($alt_codon) > length ($ref_codon). But cases found where alt_codon can be just a 1bp/2bp larger than ref_codon and the insertion is not inframe.
    For example, 5 134750948 . TG T variant have codons TAA/TAAG and peptides */*.
    We only handle cases where $ref_pep=$alt_pep=* to incur minimal change and do not add logic to check if $ref_pep=$alt_pep.

stop_retained and stop_lost

  • Check transcript sequence if alt_pep has X
    In these functions first the peptide is used to infer if the effect is present, if not possible, such as peptide string is not available than the transcript sequences is used to infer the effect. We should use the transcript sequence if alt_pep has X as in some cases it cannot infer the effect with such peptide sequence.
    For example, 3 149520808 . G GTTAA has peptides L/L*X which says it is stop_gained but if we look at the transcript sequence it is actually stop_retained.

Remove false cases from ref_eq_alt_sequence function -

  • # 1 - even if alt_pep has * it might not be exact stop location.
    Because we do not know if the stop codon is actually at the original stop position. (Ola also removed this case in her last PR and I agree)
  • # 2 - why we are checking $final_stop_length < 3
    I do not know why we are checking $final_stop_length is less than 3 here. First of all final_stop_length is the number of aa in the mut aa string from the length of ref aa string. We do not care about the length as long as the first aa is a stop (i.e. the stop is at the same position). I change it to $final_stop =~ /^\Q*\E/ so we know that first aa is a stop codon.
    (What happens if ref_seq does not go all the way until stop codon?)

_overlaps_stop_codon

  • consider length of insertion when checking for stop_codon overlap.
    For example, 3 149520808 . G GTTAA variant, the insertion is happened before stop codon. If we only consider the position where it is inserted it does not overlap stop codon and we never know that stop is actually retained. So, we consider the full length of insertion in the reference sequence to see if it actually overlaps stop codon.
    (What happens if an indel length does not go until the stop codon but after adding in the change in the transcript sequence it is actually a stop_retained? - is it something to do with VEP not being completely haplotype-aware?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant