Skip to content

Commit 022885a

Browse files
authored
Update microhomology flank comparison logic
Compare the upstream flank around bkp_a with the downstream flank around bkp_b for the canonical L-m-X-m-R deletion model. This avoids the extra forward-flank comparison, which was redundant for this microhomology check.
1 parent 7338035 commit 022885a

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

src/XXEJ_scanner/reference.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,11 @@ def detect_microhomology(
5252
if bkp_a > bkp_b:
5353
bkp_a, bkp_b = bkp_b, bkp_a
5454
for length in range(max_len, min_len - 1, -1):
55-
# Check both upstream and downstream flanks. Different aligners can place
56-
# an imprecise junction on either side of a short homology run.
55+
# Detect microhomology for a canonical L-m-X-m-R -> L-m-R deletion model.
5756
left = reference.fetch(chrom, bkp_a - length, bkp_a)
58-
right = reference.fetch(chrom, bkp_b - length, bkp_b)
57+
right = reference.fetch(chrom, bkp_b, bkp_b + length)
5958
if len(left) == length and left == right:
6059
return left, length
61-
left_forward = reference.fetch(chrom, bkp_a, bkp_a + length)
62-
right_forward = reference.fetch(chrom, bkp_b, bkp_b + length)
63-
if len(left_forward) == length and left_forward == right_forward:
64-
return left_forward, length
6560
return "NA", 0
6661

6762

0 commit comments

Comments
 (0)