Skip to content

Fix spurious "Cannot determine terminus type" debug message for asymmetric paired hits#73

Merged
Adamtaranto merged 6 commits into
mainfrom
copilot/fix-debug-message-unpaired-hit
Apr 20, 2026
Merged

Fix spurious "Cannot determine terminus type" debug message for asymmetric paired hits#73
Adamtaranto merged 6 commits into
mainfrom
copilot/fix-debug-message-unpaired-hit

Conversation

Copilot AI commented Apr 20, 2026

Copy link
Copy Markdown
Contributor

In multi-pair --pairing-map runs, writeFlanks iterates over all models in hitIndex (which contains hits from every pair), but each call receives only the current pair's PairingConfig. For models belonging to other pairs, _determine_terminus_type correctly returns None — but this incorrectly triggered the misleading debug message and silently skipped hits that are classifiable, just in their own pair's context.

Changes

  • src/tirmite/tirmitetools.py — In writeFlanks, precompute config_models (the set of left_model/right_model for the current asymmetric config) before the unpaired hits loop. Models not in this set are silently skipped; they will be processed with the correct config in their own pair's writeFlanks call.
# Only built for asymmetric configs; symmetric configs continue to use
# strand-based classification for all models as before.
config_models: Optional[Set[str]] = None
if config is not None and config.is_asymmetric:
    config_models = {m for m in (config.left_model, config.right_model) if m is not None}

if write_all:
    for model in hitIndex.keys():
        if config_models is not None and model not in config_models:
            continue  # foreign model — silently skip
        ...
  • tests/test_flank_extraction.py — Added test_asymmetric_config_skips_foreign_models_silently: builds a hitIndex with models from two asymmetric pairs, calls writeFlanks with one pair's config, and asserts that (a) only that pair's models produce flank files and (b) no "Cannot determine terminus type" log messages are emitted for the foreign models.

Copilot AI and others added 2 commits April 20, 2026 13:11
Copilot AI changed the title [WIP] Fix debug message for unpaired hit in asymmetrical pair Fix spurious "Cannot determine terminus type" debug message for asymmetric paired hits Apr 20, 2026
Copilot AI requested a review from Adamtaranto April 20, 2026 13:14
@Adamtaranto

Copy link
Copy Markdown
Owner

@copilot fix failing tests

@Adamtaranto Adamtaranto marked this pull request as ready for review April 20, 2026 14:01
@Adamtaranto Adamtaranto merged commit c38bb1e into main Apr 20, 2026
6 checks passed
@Adamtaranto Adamtaranto deleted the copilot/fix-debug-message-unpaired-hit branch April 20, 2026 14:01
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.

Bug: Debug msg "Cannot determine terminus type for unpaired hit" when pair is asymmetrical

2 participants