Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
28 changes: 25 additions & 3 deletions malariagen_data/veff.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,11 +444,33 @@ def _get_within_cds_effect(ann, base_effect, cds, cdss):
effect = base_effect._replace(effect="CODON_CHANGE", impact="MODERATE")

else:
# TODO in-frame complex variation (MNP + INDEL)
effect = base_effect._replace(
effect="TODO in-frame complex variation (MNP + INDEL)", impact="UNKNOWN"
# in-frame complex variation: multiple ref bases replaced by a
# different number of alt bases, net change a multiple of 3.
# Reading frame is preserved. Apply the same codon-change logic
# used for simple insertions and deletions above.
is_codon_changed = (strand == "+" and ref_aa[0] != alt_aa[0]) or (
strand == "-" and ref_aa[-1] != alt_aa[-1]
)

if len(alt) > len(ref):
if is_codon_changed:
effect = base_effect._replace(
effect="CODON_CHANGE_PLUS_CODON_INSERTION", impact="MODERATE"
)
else:
effect = base_effect._replace(
effect="CODON_INSERTION", impact="MODERATE"
)
else:
if is_codon_changed:
effect = base_effect._replace(
effect="CODON_CHANGE_PLUS_CODON_DELETION", impact="MODERATE"
)
else:
effect = base_effect._replace(
effect="CODON_DELETION", impact="MODERATE"
)

return effect


Expand Down
Loading