fuzzy changes negative indexes

Create issue
Issue #353 resolved
Former user created an issue

It seems that indexes for fuzzy changes are sometimes computed incorrectly.

import regex



string = "TTCCCCGCGCCAGCGGGGATAAACCG"
search_pattern = "(?be)(AGTGTTCCCCGCGCCAGCGGGGATAAACCG){s<=5,i<=5,d<=5,s+i+d<=10}"
original_matches = list(regex.finditer(search_pattern, string,))
print(original_matches[0].fuzzy_changes)
#([], [], [-1, 0, 2, 4])
# need to be ([], [], [0, 1, 2, 3])

Comments (2)

  1. Matthew Barnett repo owner

    The fuzzy changes aren’t necessarily ([], [], [0, 1, 2, 3]), but ([], [], [0, 1, 3, 5]):

    You start with: AGTGTTCCCCGCGCCAGCGGGGATAAACCG
    Delete 0: _GTGTTCCCCGCGCCAGCGGGGATAAACCG
    Delete 1: __TGTTCCCCGCGCCAGCGGGGATAAACCG
    Delete 3: __T_TTCCCCGCGCCAGCGGGGATAAACCG
    Delete 5: __T_T_CCCCGCGCCAGCGGGGATAAACCG
    That leaves you with: TTCCCCGCGCCAGCGGGGATAAACCG
    

  2. Log in to comment