Skip to content

Preserve current NASE input and score references when loading digests - #10909

Merged
poshul merged 2 commits into
developfrom
codex/nase-stack/03-cache-references
Nov 17, 2026
Merged

poshul merged 2 commits into
developfrom
codex/nase-stack/03-cache-references

Conversation

@poshul

@poshul poshul commented Nov 15, 2026 •

Copy link
Copy Markdown
Collaborator

Written by an AI agent using GPT-6.

Cached input names and score types can sort before the current run's entries. Pass explicitly registered input/score references into post-processing so observations and scores retain their current-run meaning. Check a later-sorting input path and fresh-versus-cached HyperScore/MVH results using the existing search fixture.

Validation: NASEDigestion_test and ModifiedNASequenceGenerator_test pass. This fix is exercised without graph or route candidate modes.

Supersedes the corresponding portion of #10906.

  • Substantial AI assistance is disclosed. Human review remains pending.

Summary by CodeRabbit

  • Bug Fixes
    • Corrected search results when reusing cached digestion data: observations now reflect the input file used for the current search.
    • Results now retain scores from the selected scoring method, including MVH and hyperscore, rather than incorrectly using a fixed score type.
    • Cached-digestion searches now preserve the current run’s input provenance and scoring information across repeated searches.

@poshul
poshul marked this pull request as ready for review November 15, 2026 17:52
@poshul

poshul commented Nov 15, 2026

Copy link
Copy Markdown
Collaborator Author

Looks good.

@coderabbitai

coderabbitai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The search engine now passes the current run’s input-file and configured score references to post-processing. Cached-digest tests check that replayed searches retain the replay input’s provenance and the fresh search’s score type and top-hit score.

Changes: Cached Search Metadata

Layer / File(s) Summary
Current-run references and cached-search regression coverage
src/topp/NucleicAcidSearchEngine/NucleicAcidSearchEngine.cpp, src/topp/NucleicAcidSearchEngine/test/NASEDigestion_test.cpp
Post-processing uses the current run’s input-file and search-score references. Cached-digest tests check replay input provenance and compare score type and top-hit score for hyperscore and MVH.

Suggested reviewers: timosachsenberg

Change: Bug fix

Merge Risk: Minimal · up to 08f08

The change makes cached-digest searches keep the current run's input and score references. It is covered by new cached-digest tests, and no merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: the NASE post-processing now receives the current run's input-file and score-type references when loading cached digests, instead of picking the first entries in Ident…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: the NASE post-processing now receives the current run's input-file and score-type references when loading cached digests, instead of picking the first entries in IdentificationData. The raw summary confirms this change in postProcessHits_ and the registered search score. The title is specific and matches the changeset, so it passes.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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 scores at dawn
And tracks the file the search ran on
MVH and hyperscore align
The cached results keep their sign
Then hops away through fields of green

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 69466577-28ce-4f9a-a129-6cf7a2163f92
Commits

Reviewing files that changed from the base of the PR and between 294dd35 and 08f08a0.

Files selected for processing: 1

  • src/topp/NucleicAcidSearchEngine/NucleicAcidSearchEngine.cpp

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

@poshul poshul self-assigned this Nov 15, 2026

@timosachsenberg timosachsenberg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

AI-generated initial review

This is an automated, AI-generated first review. It looks only for high- and medium-priority issues (no nits) and checks whether the PR has tests and measurements. Please double-check anything before acting on it; a maintainer will follow up. I reviewed 294dd354 against develop (65851d70). The PR's base is b6341626; it merges cleanly into the current develop.

What I ran:

  • Build: current develop with the whole NASE stack merged on top (#10909–#10913, which merge cleanly). Release, Linux, GCC 13.3, OPENMS_USE_VCPKG=OFF with system packages (Arrow 24 from the Apache apt repo, libxml2 2.15.4 from source), Thermo RAW and OpenTIMS off.

    • For comparisons I also built two NASE binaries against the same libOpenMS: develop alone, and develop + #10911 only. Develop alone cannot write the real-data output (see #10911).
  • Tests: NASEDigestion_test, ModifiedNASequenceGenerator_test, RNASpectrumGraph_test, RNASensitivity_test, SpectrumAnnotator_test and all 15 TOPP_NucleicAcidSearchEngine* tests pass.

  • CI: Linux (gcc, clang, arm), macOS, wheels and cppcheck pass. build-and-test (windows-2025, cl.exe) fails before OpenMS itself is compiled: vcpkg's boost-locale configure stops at libs/locale/CMakeLists.txt:236 (source_group) with CMake 4.5. That is the known runner issue that #10904 fixes, and it has nothing to do with this PR.

  • Real data (PXD016328, HAP1 tRNA, HAP1_tRNA_clone1_rep1, RT 35–39 min, 943 MS2, the target/decoy FASTA from the same PRIDE project):

    • Settings: RNase T1, 2 missed cleavages, 3 ppm precursor and fragment tolerance, 13 variable modifications (D m1A m5C m7G Cm Gm Um m1G m2G t6A I m5U i6A), fdr:decoy_pattern DECOY_.
    • Step 1: a fresh MVH search with -digest_out.
    • Step 2: a HyperScore search of a copy of the mzML (z_replay.mzML, which sorts after the original) with -digest.
    develop + #10911 this PR (whole stack)
    idXML score_type MVH score (but the values are HyperScores) hyperscore
    q-values none: 0 spectra have one, because FDR looks up hyperscore 611 spectra
    OSM spectra_ref all 4,309 rows point to ms_run[1], the digest producer's file all point to ms_run[2], the searched file
    target PSMs at q ≤ 1 / 5 / 10 % 0 / 0 / 0 109 / 143 / 154
    • The PR's cached search reproduces the fresh HyperScore search: the NUC/OLI/OSM rows are identical once ms_run[2] is mapped to ms_run[1].

Verdict:

  • High priority: none.
  • Medium priority: none.
  • Checked and fine:
    • Why develop picked the wrong entries: ScoreType sorts by CV accession first. Both search scores have an empty accession, so "MVH score" sorts before "hyperscore". getScoreTypes().begin() therefore returned the cached MVH type whenever the digest came from an MVH run. InputFiles are ordered by name, so a cached input file that sorts first won the same way.
    • The refs stay valid: OMSFile::load adds to the existing IdentificationData and doesn't replace it. The references registered before the load point into node-based containers, so later inserts don't invalidate them.

Outside this PR (for information)

  • The digest producer's input file is still listed as ms_run[1] in the mzTab of a cached search, although no spectrum refers to it. This is pre-existing, and the PR only makes sure observations no longer point there. If it bothers downstream tools, a follow-up could drop input files that no observation references before export.

Tests

  • You added: a replay input whose name sorts after the cached one, and cached-vs-fresh checks of score type and value for both HyperScore and MVH. They pass here. I didn't run them against develop, but the real-data replay above shows the develop behaviour they guard against.
  • Missing: nothing I would require.

Measurements

  • You provided: none (a correctness fix).
  • Added above: the real-data replay. It shows the develop failure (no q-values, wrong run) and that the fix reproduces a fresh search exactly.

Description

  • The AI use is disclosed, and the commit carries a Co-authored-by: trailer. The template's confirmation box ("I have read the OpenMS AI Policy, and I understand, have reviewed and tested every change …") is not in the description yet. The description says human review is still pending.

Generated by Claude Code

@poshul
poshul disabled auto-merge November 16, 2026 21:03
@poshul
poshul merged commit 340e615 into develop Nov 17, 2026
31 of 32 checks passed
@poshul
poshul deleted the codex/nase-stack/03-cache-references branch November 17, 2026 11:35
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.

2 participants