Skip to content

[FIX] MapAlignerIdentification: align to the best-overlapping input run when no reference is given - #10316

Merged
timosachsenberg merged 5 commits into
developfrom
claude/eloquent-euler-rtesvj
Sep 29, 2026
Merged

timosachsenberg merged 5 commits into
developfrom
claude/eloquent-euler-rtesvj

Conversation

@timosachsenberg

@timosachsenberg timosachsenberg commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Description

Fixes #2541. Without a reference, MapAlignmentAlgorithmIdentification aligned every run to per-peptide median RTs over all runs. That target is not one consistent RT scale: which run supplies a peptide's median depends on which runs identified it, so a run's trafo data points split into parallel bands. The run being aligned is also part of every median it is compared against, so it pulls the target towards itself. In simulations, one pass left about 10% of the RT offset between runs uncorrected (details, figures and scripts in this comment).

ProteomicsLFQ (default alignment_order=star) and MS1LabeledWorkflow use this code path, and their docs already say they align to a single reference run. This PR makes that true:

  • New default (best_run): without a reference file or index, the input that shares the most identified sequences with every other input becomes the reference. That is the input whose smallest overlap with any other input is largest, counting only sequences that pass min_run_occur; ties go to the input with the most identified sequences, then to the first. Every other run is fitted against a single consistent scale that it doesn't contribute to.
  • Fallback to the consensus: it is used if no input shares at least two sequences with every other input.
  • Too few alignment points: the new parameter auto_reference_min_points sets how many alignment points the reference should give every other input, counted after the max_rt_shift outlier filter. The default, 11, is the smallest number of points to which ProteomicsLFQ and MS1LabeledWorkflow fit an RT model. If the first choice leaves inputs short, and one of them shares at least that many sequences with other inputs, every input and the consensus are tried as the reference. The choice that gives the most inputs enough points is used; the reference counts. On ties, the first choice is kept, then the one whose weakest covered input has the most points, and an input is preferred over the consensus. A run with few IDs overall, e.g. a failed injection, can't reach the threshold with any reference, so it doesn't trigger this search.
  • Old behaviour kept: the consensus is still available as the new parameter auto_reference = consensus (default best_run). Both new parameters are advanced in ProteomicsLFQ and MS1LabeledWorkflow.
  • Leftover reference: a reference taken from the input maps is cleared after align(), so it no longer leaks into later calls as if it were an external reference.
  • Docs: class docs, the pyOpenMS docstring and user guide, the map alignment overview, and a BREAKING entry in the CHANGELOG.

Simulation: 5 runs with RT shifts of ±180 s, run through the patched MapAlignerIdentification.

  • With -algorithm:auto_reference consensus it reproduces the nightly's result exactly: 35 s RT spread left between runs.
  • The new default leaves 1.7 s, the noise floor of the simulation.

Tests:

  • MapAlignmentAlgorithmIdentification_test covers the new default: a tie picks the first map, a map with more IDs wins, and the picked reference doesn't carry over into the next call. The consensus part now sets auto_reference explicitly.
  • A second class section covers the overlap pattern from the review below. The input with the most IDs shares nothing with one of the others, so another input becomes the reference and every run gets its alignment points. If no input shares two sequences with every other input, the runs fall back to the consensus.
  • A third class section covers auto_reference_min_points:
    • Four runs where each pair shares four sequences fall back to the consensus: 12 points per run instead of 4. With a threshold of 4 they keep the first choice.
    • A run with only three IDs doesn't change the reference.
    • A sparse run doesn't hide another run that a different reference can recover. This is the fixture from the second review: C instead of A, so that B gets 32 points instead of 7.
    • A run shifted beyond max_rt_shift for the first choice makes the central run the reference: every run gets 100 points, instead of 0 for one.
  • TOPP_MapAlignerIdentification_1 and _5 set -algorithm:auto_reference consensus and keep their reference files, so the consensus mode stays covered and is shown to be unchanged.
  • The new TOPP_MapAlignerIdentification_9 runs without a reference and must reproduce test 3, which sets the same input as reference explicitly.
  • 11 ProteomicsLFQ reference files are updated. I checked every changed file against its old version:
    • Only aligned retention times, the linker's consensus quality values and, in the untargeted tests 3 and 3_seedRT, the grouping of unidentified features changed.
    • Feature, peptide and protein intensities, and the sets of identified features and PSMs, are identical.
    • Tests 3 and 3_seedRT keep all 304/279 features and link more unidentified ones across all three runs (unlinked: 130 → 121 and 111 → 104).
    • Tests 2 and 5 have at most 10 alignment points per run, so no RT model is fitted. There, only the linking tolerance and with it the quality values changed; the tolerance is now derived from deviations to the reference instead of to the consensus.
  • MS1LabeledWorkflow outputs are unchanged.

How this was tested:

  • Before the change, all 167 affected tests passed on the unchanged code in the same local build. That build is Linux, gcc 13, with Arrow 25, Boost 1.83 and Qt 6.4 from apt.
  • With the change, all 170 affected tests pass: the MapAligner*, ProteomicsLFQ and MS1LabeledWorkflow TOPP tests and the two alignment class tests.
  • In the existing ProteomicsLFQ, MS1LabeledWorkflow and MapAligner* tests, some inputs get fewer than 11 points, but none shares enough sequences to be recovered. So the search never runs there, and no reference file changes for it.
  • In the simulation every run shares over 1,100 sequences with the first choice, so the search isn't needed and the results are unchanged.
  • Not run locally: the full test suite and pyOpenMS. pyOpenMS only gets a docstring change here.

Checklist

  • Make sure that you are listed in the AUTHORS file
  • Add relevant changes and new features to the CHANGELOG file
  • I have commented my code, particularly in hard-to-understand areas
  • New and existing unit tests pass locally with my changes (the 170 affected tests; the full suite was not run locally)
  • Updated or added python bindings for changed or new classes (only the align() docstring changed; the new parameters are set through Param)

How can I get additional information on failed tests during CI

Click to expand If your PR is failing you can check out

Advanced commands (admins / reviewer only)

Click to expand
  • /reformat (experimental) applies the clang-format style changes as additional commit. Note: your branch must have a different name (e.g., yourrepo:feature/XYZ) than the receiving branch (e.g., OpenMS:develop). Otherwise, reformat fails to push.
  • setting the label "NoJenkins" will skip tests for this PR on jenkins (saves resources e.g., on edits that do not affect tests)
  • commenting with rebuild jenkins will retrigger Jenkins-based CI builds

🤖 Generated with Claude Code

https://claude.ai/code/session_01Gk4HywNyfqiiq6gFZxUafB

Summary by CodeRabbit

  • New Features
    • Automatic retention-time alignment now selects the input with the strongest minimum sequence overlap across all other inputs. Ties are resolved by identification count, then input order.
    • If no input has sufficient overlap, alignment uses a consensus time scale. If the selected reference leaves inputs below the configurable alignment-point threshold, the tool can compare other inputs and a consensus to improve coverage.
    • The automatic reference strategy and minimum alignment-point threshold can be configured.
  • Documentation
    • Updated alignment guidance for ProteomicsLFQ, MS1LabeledWorkflow, and map-alignment tools.

…o reference is given

Without a reference, MapAlignmentAlgorithmIdentification aligned every run to
per-peptide median RTs over all runs. Which run supplies a peptide's median
changes from peptide to peptide, and the run being aligned is one of the
candidates, so the trafo data points split into parallel bands and larger RT
shifts between runs were only partly corrected (#2541; in simulations about a
tenth of the offset between runs remained after one pass).

Now the input with the most identified sequences becomes the reference (the
first one on ties), as ProteomicsLFQ ('star' alignment) and MS1LabeledWorkflow
already documented. The consensus remains available as the new parameter
'auto_reference' = 'consensus'. A reference taken from the inputs no longer
carries over into later align() calls.

Fixes #2541

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Gk4HywNyfqiiq6gFZxUafB
- TOPP_MapAlignerIdentification_1 and _5 run with
  '-algorithm:auto_reference consensus' and keep their reference files, so
  the consensus mode stays covered and is shown to be unchanged.
- New TOPP_MapAlignerIdentification_9: without a reference, the first of two
  inputs with equally many identified sequences becomes the reference; the
  output equals test 3, which sets that input as reference explicitly.
- ProteomicsLFQ reference files ('star' alignment now aligns to the run with
  most IDs, as documented). Only aligned retention times, the linker's
  consensus quality values and, in the untargeted tests 3/3_seedRT, the
  grouping of unidentified features changed. Feature, peptide and protein
  intensities and the sets of identified features and PSMs are unchanged;
  tests 3/3_seedRT keep all 304/279 features and link more unidentified ones
  across all three runs (unlinked: 130 -> 121, 111 -> 104). Tests 2 and 5 have
  at most 10 alignment points per run, so no RT model is fitted there; only
  the linking tolerance (deviations from the reference instead of from the
  consensus) and with it the quality values changed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Gk4HywNyfqiiq6gFZxUafB
@coderabbitai

coderabbitai Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 0ee4b013-ce88-494e-8b87-2bfdb6f47c5b

📥 Commits

Reviewing files that changed from the base of the PR and between c30617f and 5381c9e.

📒 Files selected for processing (4)
  • CHANGELOG
  • src/openms/include/OpenMS/ANALYSIS/MAPMATCHING/MapAlignmentAlgorithmIdentification.h
  • src/openms/source/ANALYSIS/MAPMATCHING/MapAlignmentAlgorithmIdentification.cpp
  • src/tests/class_tests/openms/source/MapAlignmentAlgorithmIdentification_test.cpp
🚧 Files skipped from review as they are similar to previous changes (1)
  • CHANGELOG

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.


📝 Walkthrough

Walkthrough

MapAlignerIdentification now selects an input map by shared-sequence overlap when no reference is supplied. It retains consensus alignment as an option and uses it under specified overlap and alignment-point conditions. Tool documentation, tests, and ProteomicsLFQ expected outputs are updated.

Changes

Identification-Based RT Alignment

Layer / File(s) Summary
Reference selection and transformation logic
src/openms/include/OpenMS/ANALYSIS/MAPMATCHING/MapAlignmentAlgorithmIdentification.h, src/openms/source/ANALYSIS/MAPMATCHING/MapAlignmentAlgorithmIdentification.cpp
The default best_run mode selects the map with the greatest minimum eligible-sequence overlap across other maps. Ties use identified-sequence count and input order. When the selected reference leaves inputs below the configured point threshold, the algorithm can compare other maps and consensus as references.
Tool and API integration
CHANGELOG, doc/openms/docs/getting-started/types-of-topp-tools/map-alignment.md, doc/pyopenms/docs/source/user_guide/map_alignment.rst, src/pyOpenMS/bindings/bind_misc.cpp, src/topp/MS1LabeledWorkflow/MS1LabeledWorkflow.cpp, src/topp/ProteomicsLFQ.cpp
Tool and API descriptions document automatic selection and consensus options. ProteomicsLFQ and MS1LabeledWorkflow describe the shared-identification rule and list the automatic-reference parameters as advanced options.
Alignment tests and expected outputs
src/tests/class_tests/openms/source/MapAlignmentAlgorithmIdentification_test.cpp, src/tests/topp/CMakeLists.txt, src/tests/topp/ProteomicsLFQ_*
Tests cover selection, tie-breaking, consensus use, point-threshold fallback, candidate switching, and repeated calls. ProteomicsLFQ expected outputs contain revised alignment values and build metadata.

Sequence Diagram(s)

sequenceDiagram
  participant Aligner as MapAlignmentAlgorithmIdentification
  participant Maps as Input maps
  participant Consensus as Consensus reference
  Aligner->>Maps: Compare shared identified sequences
  Aligner->>Maps: Compute transformations with selected map
  Aligner->>Aligner: Check alignment-point threshold
  Aligner->>Consensus: Retry consensus when needed
  Consensus-->>Aligner: Return consensus-based transformations
Loading

Priority: ➖ Normal

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 5381c

No actionable issue remains from this review. The PR is mergeable after normal checks.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 5381c

The revised policy can change alignment results across workflows, but the review found no demonstrated expansion of access or authority. Evidence about deployment exposure and recovery after failures remains limited.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The observable influence is bounded to reference choice and transformation results for input runs in an alignment invocation. Evidence does not establish how externally supplied runs are isolated in a deployment.

Trust Boundaries and Controls

  • observed — An explicitly supplied reference remains on the existing path; automatic selection runs only when neither an input index nor a stored reference is present.

Resilience and Maintainability Implications

  • inferred — Repeated candidate trials add state transitions to an existing exception-sensitive alignment path. Normal-return cleanup is visible, but recovery after an interrupted trial is not established by a fault-injection test.

Hardening Proposals

  • proposed — Consider exception-safe restoration of temporary reference state and a repeated-call failure test, particularly now that one invocation may try multiple input references. This addresses an existing failure-containment weakness, not an established new security finding.
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The alignment code, documentation, tests, and RT-dependent expected-output changes support [#2541]. The PR also changes generated ProteomicsLFQ fixture metadata without a connection to reference selec… Remove the unrelated generated-fixture changes. Restore the software build-version metadata and the relative ms_run locations. Keep fixture value changes only when they result from the changed automatic reference behavior.
Docstring Coverage ⚠️ Warning Docstring coverage is 29.41% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 17 functions across 6 files. (1 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR meets the coding objective in [#2541]. When no explicit reference is set, selectReference_ chooses one input by its weakest shared-sequence overlap with the other inputs. The implementation u…
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: selecting the best-overlapping input run as the automatic reference when no reference is provided.
Full details: Out of Scope Changes check

Explanation

The alignment code, documentation, tests, and RT-dependent expected-output changes support [#2541]. The PR also changes generated ProteomicsLFQ fixture metadata without a connection to reference selection. The fixtures change software build-version strings, and src/tests/topp/ProteomicsLFQ_strictly_unique_out.mzTab changes all ms_run locations from relative paths to /home/user/OpenMS/... paths. These changes are unrelated to the linked issue and are not required to validate alignment output.

Full details: Docstring Coverage

Explanation

Docstring coverage is 29.41% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 17 functions across 6 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

A rabbit checks the runs at dawn
And picks the map where IDs meet
If overlaps fade, consensus guides
New points hop into alignment
The tests record each measured turn
Then carrots celebrate the change

Comment @coderabbitai help to get the list of available commands.

timosachsenberg commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor Author

Update: resolved. The Windows tarball was back on the contrib release, the re-run passed, and the wheel builds on the current head (1cb03fa) are green.

build-wheels-windows failed in its Download contrib step, before anything from this PR is built (job log). The step runs gh release download -R OpenMS/contrib --pattern 'contrib_build-Windows.tar.gz', which returned no assets match the file pattern.

This isn't caused by the PR: the same step passed at 15:42–15:54 UTC on other PRs' wheel runs (e.g. #10248, #9966). So the latest OpenMS/contrib release has lacked its Windows tarball since then. Nothing in this diff touches the wheel workflow or contrib.

No fix exists in this repository yet. The job needs the Windows tarball back on the latest contrib release, or the workflow pinned to a release that has it. I'll re-run the failed job once the asset is available again.


Generated by Claude Code

@timosachsenberg timosachsenberg left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Adversarial review of 08ee243, focusing on correctness rather than style. I reproduced one regression in the new automatic reference selection: a connected set of runs can lose all alignment points for one run even though another input would be a usable reference for every run. Details and a reproducible fixture are inline.

Validation: compiled this PR's MapAlignmentAlgorithmIdentification implementation in a local C++ harness against an existing OpenMS build; compared the new default, explicit reference selection, and the retained consensus mode. This was a targeted check, not a full build of the PR.

…e every input can be aligned to

The input with the most identified sequences can share few or no sequences
with another input, e.g. when many of its IDs are its own. That input then
got no alignment points, so fitting its transformation failed
(MapAlignerIdentification aborted with "'b_spline' model requires more
data") or it stayed unaligned (ProteomicsLFQ, MS1LabeledWorkflow), as the
review of #10316 showed.

The automatic reference is now the input whose smallest number of shared
sequences with any other input is largest, counting only the sequences the
alignment uses (min_run_occur); ties go to the input with the most
identified sequences, then to the first. If no input shares at least two
sequences with every other input, the inputs are aligned to the consensus
instead. The unreleased parameter value 'most_ids' is renamed 'best_run'.

A new class test covers both cases, with the overlap pattern from the
review. The ProteomicsLFQ, MS1LabeledWorkflow and MapAligner* TOPP tests
pass unchanged: the new rule picks the same references there.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Gk4HywNyfqiiq6gFZxUafB
@timosachsenberg timosachsenberg changed the title [FIX] MapAlignerIdentification: align to the run with most IDs when no reference is given [FIX] MapAlignerIdentification: align to the best-overlapping input run when no reference is given Sep 29, 2026
… if the automatic reference provides too few alignment points

With 'auto_reference best_run', an input that shares only a few
sequences with the chosen reference gets only a few alignment points,
and ProteomicsLFQ and MS1LabeledWorkflow do not fit an RT model to 10
or fewer. The new parameter 'auto_reference_min_points' (default 11)
sets how many points the chosen input should provide for every other
input, counted after the 'max_rt_shift' outlier filter. If an input
gets fewer, a consensus of all inputs is computed as well and used if
it raises the smallest number of alignment points of any input. A run
with few IDs overall gets no more points from a consensus either, so
it does not pull the other runs back to the consensus.

selectReference_() now only chooses the reference; the new
alignToAutoReference_() aligns to it and falls back if needed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Gk4HywNyfqiiq6gFZxUafB

Copy link
Copy Markdown
Contributor Author

Independent review and simulations of c30617f.

I would request changes for one confirmed regression. The simulations otherwise strongly support the main approach.

1. [P2] A sparse run can prevent recovery of another run

The fallback compares only the smallest point count. An intrinsically sparse run can keep that minimum unchanged even when another run would gain enough points to fit a model.

Reproducer with disjoint sequence sets X (30), Y (5), W (30), Z (2), and U (100):

Run Sequences RT offset
A X + Y + Z + U 0 s
B Y + W + Z 180 s
C X + W + Z 60 s
D Z 90 s

Assign sequence indices X=0–29, Y=30–34, W=35–64, Z=65–66, U=67–166, and RT 300 + 50*(index % 67) + run_offset. Use distinct valid peptide sequences for the indices.

All candidate references have minimum overlap 2 because of D. A wins the ID-count tie-break.

Strategy A points B points C points D points
Automatic reference identity 7 32 2
Consensus / base 37 37 62 2
Explicit reference C 32 32 identity 2

The fallback is attempted but rejected because both minima are 2. ProteomicsLFQ and MS1LabeledWorkflow only fit transformations with more than 10 points, so B remains untransformed and retains its 180-second offset. Explicitly choosing C reduces the spread among A/B/C to below 0.002 seconds at the 95th percentile. D is intrinsically too sparse for the workflow fit under every strategy.

I reproduced the same counts using FeatureMaps with use_feature_rt=true, use_unassigned_peptides=false, and max_rt_shift=0.1. Twenty additional randomized RT/offset fixtures also consistently gave B 7 points automatically versus 32 with C.

Suggested fix: assess recoverable deficiencies per run and try alternative references. An intrinsically sparse run should not mask another run crossing the fitting threshold. Please add a test containing both a sparse run and a second, recoverable under-covered run.

2. Remaining limitation: reference selection ignores RT filtering

The reference ranking counts shared sequences before RT filtering.

A second fixture has four runs containing the same 100 sequences, with RTs evenly spaced from 300 to 3300 seconds and offsets [0, 240, 480, 0] seconds. Set max_rt_shift=0.1, the workflow default, giving a 300-second threshold.

  • Automatic selection chooses the first run: identity / 100 / 0 / 100 points.
  • Consensus has offset 120 seconds, so the run at 480 seconds is still outside the threshold. The fallback minimum remains zero.
  • Explicitly choosing the run at 240 seconds gives 100 / identity / 100 / 100 points. All fits succeed, with median inter-run spread about 0.000005 seconds.
  • Simply moving that central run to the first input position makes automatic alignment succeed.

Fitting all transformations, as MapAlignerIdentification does, throws 'b_spline' model requires more data for the zero-point run. The workflow fit gate instead leaves it untransformed.

Legacy consensus also fails this fixture, so this is a remaining robustness gap, not a newly introduced regression. Evaluating alternative candidates after RT filtering would avoid it.

Independent simulation results

I ran 60 independent five-run synthetic datasets: 20 deterministic seeds each for constant offsets, offsets plus gradient scaling, and additional nonlinear drift. Each dataset has 2,000 possible peptide IDs, independent 60% ID detection per run, and Gaussian RT noise with standard deviation 1 second. Evaluation uses 351 held-out RT grid points per run with independent noise. Both modes use the actual OpenMS default B-spline model.

Mean of the per-dataset median inter-run RT spreads:

Drift Consensus New default
Constant offsets 50.48 s 2.25 s
Offsets + scaling 54.74 s 2.26 s
Additional nonlinear drift 55.17 s 7.94 s

No fitting errors occurred in these 120 head-implementation comparisons. The retained consensus mode matched the separately compiled base implementation's printed transformed values and point counts in the comparisons performed.

Validation scope: compiled the actual head and base alignment implementations against the same existing OpenMS library, with class-symbol renaming to isolate the reviewed implementations. The complete PR alignment class test passed. The workflow fit gate was reproduced in the native harness, including FeatureMap checks. This was a targeted native build, not a full PR/workflow build or real-data feature-linking benchmark.

…e first choice leaves recoverable inputs short

The fallback of c30617f compared only the smallest number of alignment
points, so an input with few IDs overall could hide another input that
a different reference would give enough points: with a sparse run D
and the first choice A leaving run B with 7 points, the consensus was
rejected, although run C as reference gives A and B 32 points each.

Now, if the first choice leaves inputs with fewer than
'auto_reference_min_points' points, and one of them shares at least
that many sequences with other inputs (the most any reference can give
it), every input and a consensus are tried as the reference. The one
that gives the most inputs at least that many points is used (the
reference counts); on ties, the first choice is kept, then the one
whose weakest covered input has the most points, and an input is
preferred over the consensus. The candidates are compared after the
'max_rt_shift' outlier filter, so a run shifted beyond the filter for
the first choice no longer ends up with zero points when another run
would align all of them.

computeTransformations_() gets a 'verbose' switch so that the
candidates are evaluated without log output.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Gk4HywNyfqiiq6gFZxUafB

Copy link
Copy Markdown
Contributor Author

Thanks, both confirmed with your fixtures, which are now class tests, and fixed in 5381c9e.

1. A sparse run hiding a recoverable one. The fallback no longer compares only the smallest point count. If the first choice leaves inputs below auto_reference_min_points, and one of them shares at least that many sequences with other inputs (no reference can give it more points than that), every input and the consensus are tried as the reference. The choice that gives the most inputs at least that many points is used; the reference counts. On ties, the first choice is kept, then the one whose weakest covered input has the most points wins, and an input is preferred over the consensus. In your fixture, A gives 2 of the 4 inputs enough points, while C and the consensus give 3 each, so C is used: A 32, B 32, C identity, D 2.

2. RT filtering. The candidates are compared by their points after the max_rt_shift filter. Your second fixture now uses the run shifted by 240 s: 100 / identity / 100 / 100. So MapAlignerIdentification no longer gets the zero-point run that made the b_spline fit throw.

Some notes on scope and cost:

  • A run like D, with 2 usable sequences, can't reach the threshold with any reference, so it doesn't trigger the search by itself. The search runs only if a short input could be recovered, and then costs one alignment per input.
  • In the existing ProteomicsLFQ, MS1LabeledWorkflow and MapAligner* tests, no short input could be recovered, so the search never runs there and no reference file changes. All 170 affected tests pass locally.
  • The feat_dir tests, which the previous rule moved to the consensus, keep the first choice again, as on 1cb03fa.
  • The MapAlignerIdentification without Reference yields weird transformation #2541 simulation is unchanged: every run shares over 1,100 sequences with the first choice.

Generated by Claude Code

@timosachsenberg
timosachsenberg merged commit 0baa9a5 into develop Sep 29, 2026
33 checks passed
@timosachsenberg
timosachsenberg deleted the claude/eloquent-euler-rtesvj branch September 29, 2026 17:09
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.

MapAlignerIdentification without Reference yields weird transformation

2 participants