Post

Cool stuff boys! It would be interesting to compare against kmer matches under Hamming distance. Since your method is specialized for short patterns, maybe kmer under H. dist could give similar results, but hopefully in an even shorter time :)

Didn't look much into implementations yet. FFT is unlikely to be competitive, but O(n*sqrt(m)) is probably not better than O(n*k) either (just the top O(k) rows). There are a few recent papers using SIMD, but for now my feeling is that the bitpacking for edit distance is very competitive.

First off, the problem definition :) Sassy solves approximate string matching (ASM): finding all occurrences of a pattern in a text, with up to k errors. As you would expect from me, Sassy uses unit-cost edit distance.

The one long-lasting takeaway from this work: Searching a pattern P in text T and searching rev(P) in rev(T) give different results! Saying 'we find all matches' is kinda undefined, unless you specifically list all *intervals* of the text that align with cost <= k. But nobody does that.

Anyway, research on ASM is super old, with so many papers on it between 1980 and 2000. But then Myers'99 ruined the fun by introducing his O(ceil[k/w]*n) bitpacking algorithm (m=|P|, n=|T|), that computes 64 states in a column at once. Edlib also implements pretty much exactly this figure.

Speaking of Edlib: like many other modern tools, it solves 'semi-global alignment', which finds a (set of) alignments of the pattern to a substring of the text *of optimal cost*. Note that this can be much less than the set of matches of cost ≤k.