Skip to content

Separate costs for inter and intra TS#165

Merged
sebschmi merged 1 commit intomainfrom
160-allow-to-disable-forward-jumps-in-rr-and-qq-tsms
May 7, 2026
Merged

Separate costs for inter and intra TS#165
sebschmi merged 1 commit intomainfrom
160-allow-to-disable-forward-jumps-in-rr-and-qq-tsms

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 07:46
@sebschmi sebschmi linked an issue May 7, 2026 that may be closed by this pull request
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 splits template-switch “offset/jump” costs into separate functions for inter-template-switches (RQ/QR) vs intra-template-switches (RR/QQ), updating both the lib_tsalign config format and the lib_ts_chainalign compatibility layer accordingly.

Changes:

  • Replace single Offset cost function with RQQROffset and RRQQOffset across sample/test .tsa configs and TemplateSwitchConfig parsing/printing.
  • Update tsalign runtime logic to select the appropriate offset cost function based on template-switch primary/secondary.
  • Update ts-chainalign limits (TsLimits) and tests to model separate inter vs intra 12-jump ranges.

Reviewed changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test_files/config/small/config.tsa Update jump-cost section to use RQQROffset and RRQQOffset.
test_files/config/range/config.tsa Update jump-cost section to use RQQROffset and RRQQOffset.
test_files/config/indel/config.tsa Update jump-cost section to use RQQROffset and RRQQOffset.
test_files/config/experiments/config.tsa Update jump-cost section to use RQQROffset and RRQQOffset.
test_files/config/chainalignn/config.tsa Update jump-cost section to use RQQROffset and RRQQOffset.
test_files/config/chainalign/config.tsa Update jump-cost section to use RQQROffset and RRQQOffset.
test_files/config/bench/config.tsa Update jump-cost section to use RQQROffset and RRQQOffset.
sample_tsa_config/config.tsa Update documented sample config to the new offset cost names.
lib_tsalign/src/error.rs Split offset V-shape validation errors into RQ/QR vs RR/QQ variants.
lib_tsalign/src/config/io.rs Parse/print RQQROffset and RRQQOffset instead of Offset.
lib_tsalign/src/config.rs Replace offset_costs field with two fields + add selector method offset_costs(primary, secondary).
lib_tsalign/src/a_star_aligner/template_switch_distance/lower_bounds/template_switch.rs Propagate both offset cost functions into lower-bound config generation.
lib_tsalign/src/a_star_aligner/template_switch_distance/lower_bounds/template_switch_alignment.rs Disable both offset cost functions in the alignment lower-bound config.
lib_tsalign/src/a_star_aligner/template_switch_distance/context.rs Use appropriate offset cost function based on TS primary/secondary when updating entrance offsets.
lib_tsalign/src/a_star_aligner/template_switch_distance.rs Thread both offset-cost-at-zero values into initial TS-entrance successor generation.
lib_tsalign/src/a_star_aligner/alignment_result/alignment/template_switch_specifics.rs Use (primary, secondary)-selected offset costs when reconstructing costs; update tests/config construction.
lib_ts_chainalign/src/exact_chaining/ts_34_jump/tests.rs Update tests for renamed/split TsLimits 12-jump fields.
lib_ts_chainalign/src/exact_chaining/ts_12_jump/tests.rs Update tests for renamed/split TsLimits 12-jump fields.
lib_ts_chainalign/src/costs/compat.rs Map tsalign’s two offset cost functions to chainalign’s inter/intra 12-jump limits.
lib_ts_chainalign/src/costs.rs Split jump_12 into inter_jump_12 and intra_jump_12 in TsLimits.
lib_ts_chainalign/src/chaining_lower_bounds/ts_jump/tests.rs Update tests for renamed/split TsLimits 12-jump fields.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib_ts_chainalign/src/costs.rs
Comment thread lib_tsalign/src/config.rs
@sebschmi sebschmi merged commit 7d00736 into main May 7, 2026
33 checks passed
@sebschmi sebschmi deleted the 160-allow-to-disable-forward-jumps-in-rr-and-qq-tsms branch May 7, 2026 08:02
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 disable forward jumps in RR and QQ TSMs

2 participants