Rename TSM primary and secondary to descendant and ancestor.#189
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates terminology across the project by renaming Template Switch Model (TSM) “primary/secondary” to “descendant/ancestor”, and propagates that rename through configs, documentation, Rust crates, and Python bindings.
Changes:
- Renames TSM-related types/fields/enums across
lib_tsalign,lib_tsshow, andlib_ts_chainalign(e.g.,TemplateSwitchPrimary/Secondary→TemplateSwitchDescendant/Ancestor,anti_primary_gap→anti_descendant_gap). - Updates
.tsaconfig keys and examples (ForwardAntiPrimaryGap/ReverseAntiPrimaryGap→ForwardAntiDescendantGap/ReverseAntiDescendantGap). - Updates README + Python bindings docs/types to reflect the new names and removes unused plain-text alignment stream code in
lib_tsshow.
Reviewed changes
Copilot reviewed 37 out of 37 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| test_files/config/small/config.tsa | Renames anti-gap cost function keys to descendant terminology. |
| test_files/config/range/config.tsa | Renames anti-gap cost function keys to descendant terminology. |
| test_files/config/no_intra_forward_jump/config.tsa | Renames anti-gap cost function keys to descendant terminology. |
| test_files/config/experiments/config.tsa | Renames anti-gap cost function keys to descendant terminology. |
| test_files/config/chainalignn/config.tsa | Renames anti-gap cost function keys to descendant terminology. |
| test_files/config/chainalign/config.tsa | Renames anti-gap cost function keys to descendant terminology. |
| test_files/config/bench/config.tsa | Renames anti-gap cost function keys to descendant terminology. |
| sample_tsa_config/config.tsa | Updates sample config to new anti-gap cost function key names. |
| README.md | Updates documentation and example config snippet to new key names. |
| python_bindings/README.md | Updates Python usage examples to new op field names. |
| python_bindings/python/tsalign/_types.py | Renames parsed alignment op fields to descendant/ancestor and anti_descendant_gap. |
| lib_tsshow/src/ts_arrangement/template_switch.rs | Renames TemplateSwitch struct fields to descendant/ancestor terminology. |
| lib_tsshow/src/ts_arrangement/source.rs | Propagates descendant/ancestor rename through TS arrangement construction and helpers. |
| lib_tsshow/src/ts_arrangement/inner.rs | Updates inner arrangement logic to use ancestor/descendant naming and accessors. |
| lib_tsshow/src/ts_arrangement/complement.rs | Renames secondary-complement helpers to ancestor-complement. |
| lib_tsshow/src/ts_arrangement.rs | Updates arrangement APIs and internal fields to ancestor terminology. |
| lib_tsshow/src/svg.rs | Updates SVG rendering logic to use descendant/ancestor enums and fields. |
| lib_tsshow/src/plain_text/parse_template_switches.rs | Updates TS parsing offsets/fields to ancestor/descendant names. |
| lib_tsshow/src/plain_text/alignment_stream.rs | Removes now-unneeded local alignment stream implementation. |
| lib_tsshow/src/plain_text.rs | Updates plain-text renderer to use new TS field names. |
| lib_tsshow/src/error.rs | Renames SVG negative-gap error variant/message to anti-descendant terminology. |
| lib_tsalign/src/config/io.rs | Updates config parser/printer to expect new anti-gap cost function keys. |
| lib_tsalign/src/config.rs | Renames config fields and helpers to anti_descendant_gap_costs and descendant/ancestor enums. |
| lib_tsalign/src/a_star_aligner/template_switch_distance/strategies/template_switch_min_length.rs | Propagates renamed identifier fields (descendant/ancestor indices/types). |
| lib_tsalign/src/a_star_aligner/template_switch_distance/strategies/descendant.rs | Updates descendant strategy trait to use the new descendant enum. |
| lib_tsalign/src/a_star_aligner/template_switch_distance/lower_bounds/template_switch.rs | Updates lower-bound logic to use anti_descendant_gap and renamed config fields. |
| lib_tsalign/src/a_star_aligner/template_switch_distance/lower_bounds/template_switch_alignment.rs | Updates generated lower-bound config to new anti-gap cost fields. |
| lib_tsalign/src/a_star_aligner/template_switch_distance/identifier.rs | Renames core identifier enums/fields from primary/secondary to descendant/ancestor. |
| lib_tsalign/src/a_star_aligner/template_switch_distance/display.rs | Updates display formatting for renamed TS fields (but still has old labels in places). |
| lib_tsalign/src/a_star_aligner/template_switch_distance/context.rs | Propagates rename through successor generation and cost evaluation. |
| lib_tsalign/src/a_star_aligner/template_switch_distance/alignment_type.rs | Renames alignment type fields (descendant/ancestor, anti_descendant_gap). |
| lib_tsalign/src/a_star_aligner/template_switch_distance.rs | Propagates renamed identifiers/types into node generation. |
| lib_tsalign/src/a_star_aligner/alignment_result/alignment/template_switch_specifics.rs | Updates TS-specific alignment manipulation to renamed fields. |
| lib_tsalign/src/a_star_aligner/alignment_result/alignment/stream.rs | Updates alignment stream coordinate tracking to use descendant enum and anti-descendant gap. |
| lib_ts_chainalign/src/costs/compat.rs | Updates chainalign compat mapping to new anti-descendant cost field. |
| lib_ts_chainalign/src/chain_align.rs | Updates emitted tsalign alignment ops to new TS field names. |
| lib_ts_chainalign/src/alignment/ts_kind.rs | Updates ts_kind conversions to new tsalign descendant/ancestor enums. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.