204 add separate equal cost range mode that ignores geometric tsm constraints - #205
Merged
sebschmi merged 7 commits intoAug 31, 2026
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a new “TSM uncertainty range” concept (renaming the previous equal-cost range), adds a mode to extend ranges while ignoring geometry-related cost, and updates the CLI/visualisation + bindings accordingly, alongside a coordinated major version bump across the workspace.
Changes:
- Replace “equal-cost range” with
TSMUncertaintyRangeacross core alignment, SVG rendering, and Python types. - Add
TSMUncertaintyRangeExtensionModewithEqualCostIgnoreGeometryand expose it via--ts-uncertainty-range-extension-mode. - Bump workspace crate versions to
6.0.0and update dependent crate constraints/lockfile.
Reviewed changes
Copilot reviewed 32 out of 33 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tsalign/src/show.rs | Renames CLI flag/type for SVG range rendering to uncertainty ranges. |
| tsalign/src/align/template_switch_distance_type_selectors.rs | Adds CLI selector for uncertainty-range extension mode and plumbs it into align call. |
| tsalign/src/align.rs | Exposes --ts-uncertainty-range-extension-mode on the align CLI. |
| tsalign/Cargo.toml | Bumps package/dependency versions to 6.0.0. |
| tsalign-tests/Cargo.toml | Bumps test crate version to 6.0.0. |
| test_files/twin_equal_cost_ignore_geometry.sh | Adds a repro script comparing equal-cost vs ignore-geometry outputs. |
| test_files/twin_equal_cost_ignore_geometry.fa | Adds a small input FASTA for the repro script. |
| seed_chain/Cargo.toml | Bumps seed_chain + generic_a_star dependency version to 6.0.0. |
| python_bindings/src/lib.rs | Updates binding to pass the new extension mode argument. |
| python_bindings/python/tsalign/_types.py | Renames parsed field from equal_cost_range to uncertainty_range. |
| python_bindings/Cargo.toml | Bumps Python binding crate + deps to 6.0.0. |
| lib_tsshow/src/ts_arrangement/template_switch.rs | Renames stored range field/type to uncertainty range. |
| lib_tsshow/src/ts_arrangement/source.rs | Updates optional-source modelling to track “increases_inner” for uncertainty rendering. |
| lib_tsshow/src/ts_arrangement/inner.rs | Extends inner arrangement to represent increasing/decreasing uncertainty segments. |
| lib_tsshow/src/ts_arrangement.rs | Threads uncertainty range mode through arrangement and adds helpers for rendering bounds. |
| lib_tsshow/src/svg.rs | Implements updated uncertainty range rendering + legend changes. |
| lib_tsshow/Cargo.toml | Bumps lib_tsshow + lib_tsalign dependency version to 6.0.0. |
| lib_tsalign/src/tests.rs | Updates internal tests to pass the new extension mode argument. |
| lib_tsalign/src/a_star_aligner/template_switch_distance/display.rs | Renames display formatting from equal-cost range to uncertainty range. |
| lib_tsalign/src/a_star_aligner/template_switch_distance/alignment_type/tsm_uncertainty_range.rs | Adds new TSMUncertaintyRange + extension mode enum. |
| lib_tsalign/src/a_star_aligner/template_switch_distance/alignment_type/equal_cost_range.rs | Removes old EqualCostRange type. |
| lib_tsalign/src/a_star_aligner/template_switch_distance/alignment_type.rs | Switches AlignmentType entrance payload to uncertainty range. |
| lib_tsalign/src/a_star_aligner/template_switch_distance.rs | Re-exports new types and initializes uncertainty ranges as invalid. |
| lib_tsalign/src/a_star_aligner/configurable_a_star_align/tests.rs | Updates tests to include new parameter. |
| lib_tsalign/src/a_star_aligner/configurable_a_star_align.rs | Extends aligner API to accept uncertainty-range extension mode. |
| lib_tsalign/src/a_star_aligner/alignment_result/alignment/template_switch_specifics.rs | Adds cost computation variants to support “ignore geometry” cost comparisons. |
| lib_tsalign/src/a_star_aligner/alignment_result.rs | Renames/extends postprocessing to compute uncertainty ranges with mode parameter. |
| lib_tsalign/src/a_star_aligner.rs | Plumbs extension mode through top-level A* align API and logs chosen behavior. |
| lib_tsalign/Cargo.toml | Bumps lib_tsalign + deps to 6.0.0. |
| lib_ts_chainalign/src/chain_align.rs | Renames range type in chained alignment entrance events. |
| lib_ts_chainalign/Cargo.toml | Bumps lib_ts_chainalign + deps to 6.0.0. |
| generic_a_star/Cargo.toml | Bumps generic_a_star version to 6.0.0. |
| Cargo.lock | Updates lockfile versions for the workspace bump. |
Suppressed comments (3)
lib_tsshow/src/ts_arrangement/source.rs:1044
SourceChar::make_copy()turnsOptionalSourceintoSource, which drops the optional/uncertainty-range state (includingincreases_inner). This likely breaks uncertainty-range visualisation when optional chars are copied (e.g., due to TS copy-depth rendering). PreserveOptionalSourceand carryincreases_innerthrough when making a copy.
This issue also appears on line 1067 of the same file.
} => Self::Source {
column: *column,
lower_case: false,
copy_depth: Some(copy_depth.map(|copy_depth| copy_depth + 1).unwrap_or(0)),
},
lib_tsshow/src/ts_arrangement/source.rs:1071
SourceChar::make_visible_copy()also turnsOptionalSourceintoSource, dropping uncertainty-range metadata (increases_inner) and removing optional styling. PreserveOptionalSourcewhen copying so the SVG can keep rendering optional chars correctly.
} => Self::Source {
column: *column,
lower_case: false,
copy_depth: Some(copy_depth.map(|copy_depth| copy_depth + 1).unwrap_or(0)),
},
lib_tsshow/src/svg.rs:285
- Similarly, the commented-out SP4 shift logic should be removed or turned into an explicit TODO. As-is it reads like partially reverted logic and makes future maintenance harder.
/*let descendant_sp4 = if config.uncertainty_range_mode == UncertaintyRangeMode::Full {
descendant_sp4 + usize::try_from(uncertainty_range.max_end).unwrap()
} else {
descendant_sp4
};*/
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
sebschmi
enabled auto-merge
August 31, 2026 08:30
sebschmi
deleted the
204-add-separate-equal-cost-range-mode-that-ignores-geometric-tsm-constraints
branch
August 31, 2026 08:32
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.