Refactor MatchWords indexing and introduce seed indexing

Corrects the indexing strategy for seed searching, improving performance and introducing a new seed index structure for efficient pattern lookup.

This commit updates the core matching logic by shifting the indexing strategy to use two halves of k/2 bases, resulting in significant speed improvements for sequence matching. It also introduces a new `seedIndex` structure for fast pattern retrieval and implements comprehensive performance testing logic for matching functions. Future features, such as bit-parallel search, are deferred.
This commit is contained in:
Eric Coissac committed 2026-11-03 22:38:11 +11:00
1 parent 02c8ded683
commit 1ab512ab5c
5 files changed
+301 -102

No files matched your search

+1 -1
View File
@@ -136,7 +136,7 @@ func TestPairsAgainstEcoPrimers(t *testing.T) {
for i, w := range sw.Words {
words[i] = w.Kmer
}
wm, err := matchApat(corpus, words, MatchParams{K: 18, MaxErrors: 3, Circular: true})
wm, err := MatchWords(corpus, words, MatchParams{K: 18, MaxErrors: 3, Circular: true})
if err != nil {
t.Fatal(err)
}