Repository navigation
Align end-to-end regardless of earlier ends-free settings - #62
Merged
Merged
Conversation
set_alignment_free_ends sets the span to ends-free and nothing reset it, so align_end2end (and align_lambda, align_packed2bits) on a reused aligner still seeded begin-free cells: a leading gap was taken as a free skip, giving a suboptimal global score. Found by dada2-rs, which caches one aligner per thread. End-to-end alignment now runs with an end-to-end span and restores the previous one for later ends-free calls. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
C's wavefront_aligner_set_alignment_end_to_end had no Rust counterpart, so nothing could reset the span after set_alignment_free_ends or set_alignment_extension. The setter also zeroes the free-end limits, so a later align_endsfree is end-to-end too, as C's wavefront_align follows the span. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cjfields
added a commit
to HPCBio/dada2-rs
that referenced
this pull request
Oct 19, 2026
HPCBio/wfa2lib-rs#62 (fixes #61) makes align_end2end ignore earlier ends-free settings, so the adapter no longer clears free ends itself. end_model_global_after_ends_free_same_thread passes without the workaround; 7,980 real pairs each (PacBio, MiSeq), ends-free first then global: 0 score differences from NW. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 19, 2026
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.
Fixes #61.
align_end2end_inner(behindalign_end2end,align_lambda,align_packed2bits) runs with an end-to-end span and restores the previous one, so lateralign_endsfreecalls on the same aligner keep their free-end settings.set_alignment_end_to_end, C'swavefront_aligner_set_alignment_end_to_end, which the port lacked: it resets the span and zeroes the free-end limits, so a lateralign_endsfreeis end-to-end too (as C'swavefront_alignfollows the span).aligner::tests::test_end2end_ignores_free_ends: a reused aligner (linear, match −5 and 0, both compat modes) must give a fresh aligner's end-to-end score and CIGAR, before and after the setter. Fails without the fix (score 5 vs 21).All 282 tests pass; CLI output identical to
mainover 36 configurations (affine/linear/affine2p, global and ends-free spans, both compat modes, high/med). Not a C-parity change, so the differential harness is unaffected.🤖 Generated with Claude Code