Update predicates to handle special cases #1184
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
ENSVAR-6654
Handle special cases for
inframe_insertion
*
- not an inframe_insertion.Ideally we should not get
$ref_pep == $alt_pep
with the check oflength($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 codonsTAA/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
andstop_lost
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 peptidesL/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 < 3I 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
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?)