Repository navigation
Label seeds that match only a source dummy k-mer on BASIC graphs - #691
Merged
Merged
Conversation
There was a problem hiding this comment.
All reported issues were addressed across 3 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
Base automatically changed from
fix/annotation-buffer-dangling-refs
to
master
October 28, 2026 21:46
A seed shorter than k which occurs only within the first k-1 characters of an input sequence matches, as a k-mer suffix, only a source dummy k-mer $...$T. Dummy k-mers have no annotation, so on BASIC graphs the labeled aligner dropped such seeds (CANONICAL graphs recover them from the other strand, and PRIMARY graphs from the reverse-complement seeding pass). When the annotation buffer fetches an empty label set for a source dummy k-mer of a BASIC succinct graph, it now walks forward to the real k-mers that continue it, which all start with T, and gives the dummy the union of their labels, with coordinates shifted back to the start of the dummy k-mer. Seeds and extensions through the dummy then get labels like any other node. A dummy continued by more than 16 real k-mers keeps an empty label set, as a seed locus with too many matches is dropped. The seeds themselves come from unmasked graphs: align_to_graph resets the mask of succinct graphs, and graphs are built unmasked by default. Test: LabeledAlignerTest.SubkSeedLabels, which failed on BASIC graphs for a query found only at the start of a sequence. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
adamant-pwn
force-pushed
the
fix/labeled-subk-sequence-start
branch
from
October 28, 2026 21:46
f3eb60d to
be7c376
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #690. Review only the top commit, "Label seeds that match only a source dummy k-mer on BASIC graphs"; this PR will be retargeted to master after #690 merges.
Problem
On BASIC graphs, the labeled aligner misses seeds shorter than k that occur only within the first k−1 characters of an input sequence.
$…$T.align_to_graphdoes and as graphs are built by default, suffix seeding finds that dummy k-mer.filter_seedsdrops the seed.suffix_to_prefixpass.Fix
In
AnnotationBuffer::fetch_queued_annotations, on BASIC succinct graphs:$count to the real k-mers that continue it. They all start with T.LabeledExtenderwork unchanged.max_num_seeds_per_locus. For scale, on a 24-genome graph with 19-mer seeds, the forward-resolution fan-out over read windows has p50 1, p99 3 and p99.9 ≤ 14.Test
LabeledAlignerTest.SubkSeedLabels(BASIC, CANONICAL and PRIMARY; A =TTACGAAA, B =ACGTTGCA, k = 5, seeds ≥ 3):ACGT→ B,TACGA→ A,CGTTG→ B andTGCA→ B, and that every reported label contains the aligned sequence on either strand.ACGT; with it, it passes. Checked locally, assertion-enabled build, filtered run only.Before / after (benchmark harness
bench/align-harness, labeled, seed 19)Targeted set: the first 20/25/30 bp of each of the 42 contigs of a 24-genome graph, both strands (252 reads).
BASIC per strand:
+36 → 123 of 126,−36 → 123 of 126.Regression check: simulated reads (150 bp Illumina-like; ONT 400 bp and 1–5 kb at 3/5/10% error) on BASIC and CANONICAL.
Multi-threaded CLI,
metagraph align -p 8, labeled BASIC graph, 945 long reads, 3 interleaved repeats each (median wall, before → after):Output checksums are identical in all three configurations.
🤖 Generated with Claude Code
Summary by cubic
Fixes the labeled aligner dropping seeds shorter than k that occur only within the first k−1 characters of an input sequence on BASIC graphs. Such seeds match only source dummy k-mers
$…$T, which carry no annotations and were filtered out; CANONICAL and PRIMARY graphs recovered them through separate passes.LabeledAlignerTest.SubkSeedLabels, covering BASIC, CANONICAL, and PRIMARY modes.Written for commit be7c376. Summary will update on new commits.