Repository navigation
[FIX] mzML writer: write all scan attributes in the scan, also those kept under their accession - #10323
Conversation
…kept under their accession The mzML reader keeps nine scan attributes with the spectrum, as MSSpectrum has no member for them: dwell time, mass resolution, scan rate, elution time, filter string, analyzer scan offset, preset scan configuration, mass resolving power and interchannel delay. mzML allows them only in a scan, so the writer wrote them as userParams of the spectrum, and other readers lost them once OpenMS had written a file. #10313 fixed this for the mass resolving power; all of them are now written as CV terms in the first scan, in the order the reader handles them. A value of the scan itself takes precedence. Scan terms the reader has no special case for, such as the ion injection time (MS:1000927), are kept with the scan under their accession, which is where QcMLFile and QualityControl look them up. The writer looked meta values up by term name only, so it wrote these as userParams named after the accession. It now also resolves accessions and writes a CV term where the mapping allows one. Files OpenMS wrote before are repaired when they are written again. The in-memory model and the reader are unchanged. Tests: - MzMLFile_test: the resolving power section now covers all nine attributes and the injection time: no userParams, the CV terms (with units) in the scan, schema and semantic validity, values read back. It fails with develop's writer. - TOPP references: 21 mzML outputs (ExternalCalibration, FileConverter, FileFilter, FileMerger, HighResPrecursorMassCorrector) have the attributes in the scan instead of the spectrum, with index offsets recomputed; nothing else changes. Run with the 2026-09-27 nightly tools, all 22 comparisons that use them pass with the new writer; with develop's writer they pass against the old references and fail against the new ones. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Av5w5vHqBTv3wPygrM7FSU
|
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 configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (24)
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review. 📝 WalkthroughWalkthroughThe mzML writer now serializes recognized scan metadata as controlled-vocabulary terms inside scans. The change covers nine scan attributes, accession-keyed terms, unit handling for elution time, and output validation. ChangesScan metadata serialization
Priority: ➖ Normal Change: Bug fix Merge Risk: ⚪ Minimal · up to No actionable merge-blocking issue is established; the scan metadata change is ready for normal validation. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The output format changes in a meaningful way, but the reviewed writer paths do not show a new privilege or input boundary. External consumers and the full security exposure have not been assessed. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. (22 skipped: 22 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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. A rabbit checks each scan at night, Comment |
Description
A follow-up to #10313, which fixed this for the mass resolving power. When OpenMS reads an mzML file and writes it again, CV terms of
<scan>come out as userParams. OpenMS reads them back correctly, but other software looks them up by accession and no longer finds them. This PR fixes the two causes.1. Scan attributes the reader keeps with the spectrum
The reader stores nine scan attributes on the spectrum, because
MSSpectrumhas no member for them:mzML allows them only in
<scan>. So the writer wrote them as userParams of the spectrum:2. Scan terms kept under their accession
Ms2SpectrumStatslook them up there, so the reader stays as it is.<userParam name="MS:1000927" ...>.The in-memory model and the reader are unchanged, so everything reads back as before.
Tests
MzMLFile_test: the section from [FIX] mzML, Thermo and timsTOF readers: keep the mass resolving power; read timsTOF acquisition metadata #10313 now covers all nine attributes and the injection time. It checks that:It fails with develop's writer.
TOPP references: 21 mzML outputs change:
Verification of the references: I ran the 22 comparisons that use these references with the 2026-09-27 nightly tools:
MaRaCluster reference:
THIRDPARTY/MaRaClusterAdapter_1_out_1.part1.mzMLhas these userParams too. MaRaCluster writes that file itself, from test inputs that an older OpenMS wrote, so it does not change.Other class tests: the other mzML class tests in my local build pass with the new writer: CachedMzML*, IndexedMzML*, MSData*Consumer, OnDiscMSExperiment, SpectrumMetaDataLookup and FileHandler.
Compiler warnings: GCC 13 and Clang with
-Wall -Wextrareport no new warnings.Local setup: built against the 2026-09-27 nightly SDK, with the changed source preloaded. Two
MzMLFile_testsections added by #10317 fail in that setup, with develop's writer as well. The SDK predates #10317's library changes.Checklist
How can I get additional information on failed tests during CI
Click to expand
If your PR is failing you can check outIf you click in the column that lists the failed tests you will get detailed error messages.
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.rebuild jenkinswill retrigger Jenkins-based CI builds🤖 Generated with Claude Code
https://claude.ai/code/session_01Av5w5vHqBTv3wPygrM7FSU
Generated by Claude Code
Summary by CodeRabbit