Traversal v1 (2/4): the labeled traversal walker

AD
1h ago
+3339-0

Second of four stacked PRs for labeled traversal, on #708.

This PR adds traverse_seed, which extends a seed through the graph and keeps, on each path, the labels that carry every k-mer walked. The labels are named, or taken from the seed: those on every seed k-mer. Each arm returns a tree of segments, one path per leaf, the reason each label left, and complete_to_bp: the length up to which every walk is present.

A path never reuses an edge or steps back into the seed, so walks end on graphs with cycles. Fixed caps bound each seed: 1,000,000 steps, 1000 live paths, 10,000 paths and 64 splits per path. A cap marks the arm truncated.

test_walker_reference checks every label end against an independent string model of the test records.

On RefSeq r237 bact_other (mex, 21 seeds of 500 bp, 5000 bp each way), a seed takes 158 ms at the median (prototype 136 ms), and the slowest takes 6.1 s (prototype 29.6 s).

Co-authored-by: Gunnar Rätsch

🤖 Generated with Claude Code