Skip to content

Commit b7e1600

Browse files
committed
added commit logic to avoid interwebbing
1 parent 152d32d commit b7e1600

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

malariagen_data/veff.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -539,9 +539,19 @@ def _get_within_intron_effect(base_effect, intron):
539539
effect = base_effect._replace(effect="INTRONIC", impact="MODIFIER")
540540

541541
else:
542-
if intron_min_dist <= 2:
542+
# INDELs and MNPs — use the closest edge of the variant to the splice site
543+
if strand == "+":
544+
dist_5prime = ref_start - (intron_start - 1)
545+
dist_3prime = -(ref_stop - (intron_stop + 1))
546+
else:
547+
dist_5prime = (intron_stop + 1) - ref_stop
548+
dist_3prime = -((intron_start - 1) - ref_start)
549+
550+
indel_min_dist = min(dist_5prime, dist_3prime)
551+
552+
if indel_min_dist <= 2:
543553
effect = base_effect._replace(effect="SPLICE_CORE", impact="HIGH")
544-
elif intron_min_dist <= 7:
554+
elif indel_min_dist <= 7:
545555
effect = base_effect._replace(effect="SPLICE_REGION", impact="MODERATE")
546556
else:
547557
effect = base_effect._replace(effect="INTRONIC", impact="MODIFIER")

0 commit comments

Comments
 (0)