fix: handle in-frame complex variants in _get_within_cds_effect()#1227
fix: handle in-frame complex variants in _get_within_cds_effect()#1227sallykinyua wants to merge 1 commit intomalariagen:masterfrom
Conversation
|
Thank you @sallykinyua. Your solution works, mostly. The first issue is that it makes a large bit of code redundant (the cases where either |
|
@jonbrenas I fully acknowledge your input and actually understand on the first and second issue. However,would you be open to a minimal PR that replaces |
|
Hi @sallykinyua.
Raising an error would make things worse. This code is currently never reached. If a user manages to do something weird enough that they get to this code, an error that the user can't do anything about will not be more helpful than a return that says that this hasn't been done yet.
That's the thing, though, there isn't a real use case (and there shouldn't be). Actually, in my opinion, the best solution would be to ensure that 'len(ref) == len(alt) == 1' is always true, but I don't want that to be done right now (i.e., not until we decide that it is really what we want to do). |
Fixes #1132
Implements the previously unhandled
elsebranch in_get_within_cds_effect()for in-frame complex variants — cases wheremultiple ref bases are replaced by a different number of alt bases with
a net change divisible by 3 (reading frame preserved).
Changes:
is_codon_changedlogic already used for simpleinsertions and deletions, assigning:
CODON_CHANGE_PLUS_CODON_INSERTION/CODON_INSERTIONfor net insertionsCODON_CHANGE_PLUS_CODON_DELETION/CODON_DELETIONfor net deletionsveff.py(41 tests, all passing)No new effect types introduced. Labels are consistent with SnpEff
terminology already used elsewhere in the function.