Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a configurable “descendant restriction” to the template-switch-distance A* aligner, enabling runs where all template-switch events must use the same descendant (in addition to the existing “allow any” behavior). It threads this selection through both the tsalign CLI and the lib_tsalign configurable aligner API, and introduces a DynamicStrategies parameter to the template-switch-distance alignment context.
Changes:
- Introduces a new
TemplateSwitchDescendantStrategystrategy family withAllowAnyandOnlyEqualimplementations, and plugs it into the template-switch entrance successor generation. - Exposes the option via
tsalignCLI (--ts-descendant-strategy) and vialib_tsalign’sAligner::set_descendant_strategy. - Extends the template-switch-distance aligner plumbing with a
DynamicStrategiescontext parameter and updates call sites/tests/lower-bound helpers accordingly.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
tsalign/src/align/template_switch_distance_type_selectors.rs |
Adds CLI selector enum and wires descendant strategy selection into the templated call chain. |
tsalign/src/align.rs |
Adds --ts-descendant-strategy CLI option to the main align command configuration. |
test_files/twin_both_descendants.fa |
Adds a new FASTA fixture likely intended for descendant-strategy testing/manual runs. |
lib_tsalign/src/tests.rs |
Updates template-switch-distance test invocations for the new strategy parameter(s). |
lib_tsalign/src/a_star_aligner/template_switch_distance/strategies/descendant.rs |
New descendant strategy implementations (AllowAny, OnlyEqualAllEqual). |
lib_tsalign/src/a_star_aligner/template_switch_distance/strategies.rs |
Extends AlignmentStrategySelector / node memory to include the new descendant strategy dimension. |
lib_tsalign/src/a_star_aligner/template_switch_distance/lower_bounds/template_switch.rs |
Updates lower-bound alignment strategy selection and context creation for new strategy parameter(s). |
lib_tsalign/src/a_star_aligner/template_switch_distance/lower_bounds/template_switch_alignment.rs |
Same as above for the alignment lower-bound matrix codepath. |
lib_tsalign/src/a_star_aligner/template_switch_distance/context.rs |
Adds DynamicStrategies to the context and reset flow. |
lib_tsalign/src/a_star_aligner/template_switch_distance.rs |
Enforces the descendant restriction when generating initial template-switch entrance successors. |
lib_tsalign/src/a_star_aligner/configurable_a_star_align.rs |
Adds descendant strategy selector, setter, and routes strategy selection into the align call. |
lib_tsalign/src/a_star_aligner.rs |
Extends template_switch_distance_a_star_align signature to accept/reset DynamicStrategies. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
No description provided.