Skip to content

Commit c5a3b19

Browse files
authored
Merge pull request #917 from blankirigaya/fix/TODO-strings
Fix: Replace TODO Strings With Proper Variant Effect Values in veff.py
2 parents 503c7ec + 5a83462 commit c5a3b19

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

malariagen_data/veff.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,21 @@ def _get_within_intron_effect(base_effect, intron):
548548
effect = base_effect._replace(effect="INTRONIC", impact="MODIFIER")
549549

550550
else:
551-
# TODO intronic INDELs and MNPs
552-
effect = base_effect._replace(effect="TODO intronic indels and MNPs")
551+
# INDELs and MNPs — use the closest edge of the variant to the splice site
552+
if strand == "+":
553+
dist_5prime = ref_start - (intron_start - 1)
554+
dist_3prime = -(ref_stop - (intron_stop + 1))
555+
else:
556+
dist_5prime = (intron_stop + 1) - ref_stop
557+
dist_3prime = -((intron_start - 1) - ref_start)
558+
559+
indel_min_dist = min(dist_5prime, dist_3prime)
560+
561+
if indel_min_dist <= 2:
562+
effect = base_effect._replace(effect="SPLICE_CORE", impact="HIGH")
563+
elif indel_min_dist <= 7:
564+
effect = base_effect._replace(effect="SPLICE_REGION", impact="MODERATE")
565+
else:
566+
effect = base_effect._replace(effect="INTRONIC", impact="MODIFIER")
553567

554568
return effect

0 commit comments

Comments
 (0)