Skip to content

Option to force all TSM descendants to be the same.#168

Merged
sebschmi merged 1 commit intomainfrom
161-allow-to-restrict-that-all-tsms-must-be-of-the-same-kind-rr-qq-rq-or-qr
May 7, 2026
Merged

Option to force all TSM descendants to be the same.#168
sebschmi merged 1 commit intomainfrom
161-allow-to-restrict-that-all-tsms-must-be-of-the-same-kind-rr-qq-rq-or-qr

Conversation

@sebschmi
Copy link
Copy Markdown
Collaborator

@sebschmi sebschmi commented May 7, 2026

No description provided.

Copilot AI review requested due to automatic review settings May 7, 2026 09:57
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 TemplateSwitchDescendantStrategy strategy family with AllowAny and OnlyEqual implementations, and plugs it into the template-switch entrance successor generation.
  • Exposes the option via tsalign CLI (--ts-descendant-strategy) and via lib_tsalign’s Aligner::set_descendant_strategy.
  • Extends the template-switch-distance aligner plumbing with a DynamicStrategies context 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.

Comment thread lib_tsalign/src/a_star_aligner/configurable_a_star_align.rs
Comment thread lib_tsalign/src/a_star_aligner/configurable_a_star_align.rs
@sebschmi sebschmi merged commit 9b31d82 into main May 7, 2026
32 checks passed
@sebschmi sebschmi deleted the 161-allow-to-restrict-that-all-tsms-must-be-of-the-same-kind-rr-qq-rq-or-qr branch May 7, 2026 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow to restrict that all TSMs must be of the same kind RR, QQ, RQ, or QR

2 participants