Skip to content

[FIX,IO,TEST] Warn on imzML-dropped integer/string arrays, move the aux snapshot - #10002

Merged
timosachsenberg merged 1 commit into
developfrom
claude/openms-pr-9908-review-c0y9h2
Aug 29, 2026
Merged

timosachsenberg merged 1 commit into
developfrom
claude/openms-pr-9908-review-c0y9h2

Conversation

@timosachsenberg

@timosachsenberg timosachsenberg commented Aug 29, 2026 •

Copy link
Copy Markdown
Contributor

Description

Two cheap follow-ups from the review of #9908 (merged). No behavior change beyond one new warning.

1. imzML export silently dropped per-peak Integer/StringDataArrays. The format stores per-peak data only as FloatDataArrays (written as external .ibd arrays), so an IntegerDataArray such as a "charge array" carried over from mzML vanishes on export. Unnamed and length-mismatched FloatDataArrays already warn, so this was the one silent loss left — users only discovered it downstream. warnOnDroppedDataArrays_ now warns once per store(), not once per pixel (a million-pixel dataset must not emit a million lines), and caps the listed array names at 20 with a , ... marker so the line cannot grow with the dataset — the same bounded-listing shape as the existing duplicate-pixel warning. Nothing is written differently; the arrays are still dropped.

2. The per-spectrum IMS snapshot deep-copied two vectors it could move. ImzMLHandler::onEndElement copied cur_aux_metas_ (three strings per aux array) and cur_inline_aux_names_ into the snapshot, then cleared both unconditionally a few lines later. Moving them — and the snapshot into spec_ims_ — removes a per-spectrum allocation on datasets that have one spectrum per pixel. Nothing reads either vector between the move and the reset, so the moved-from state is never observed.

Testing

Added store drops integer and string data arrays: stores a spectrum carrying an IM FloatDataArray plus an integer and a string array, then asserts both loaders return the peaks and the IM array with zero integer/string arrays. The helper's counting, de-duplication and cap logic was also checked standalone (empty arrays and metadata-only stores produce no warning; duplicate names across spectra are listed once).

The change could not be built in the environment it was written in (no Xerces/Boost, no configured build), so it went to CI unbuilt. CI has since covered that: build-and-test is green on all five platforms (Ubuntu g++/clang++, Ubuntu ARM g++, macOS xcode, Windows cl.exe), along with cppcheck-test and the wheel builds.

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
  • Updated or added python bindings for changed or new classes (Tick if no updates were necessary.)

Remaining follow-ups from the #9908 review (not in this PR)

Left out deliberately — each needs a design decision rather than a cheap fix:

  • MS:1003441 (ion mobility centroid frame) peak type diverges between loaders for third-party files: ImzMLSpectrumIndex records no peak type, so on-disc returns IM_PROFILE where in-memory keeps IM_CENTROIDED.
  • The writer derives units from the CV term only and ignores an existing unit_accession MetaValue, so declared units on multi-unit or MS:1000786 arrays are dropped on imzML export while surviving mzML export.
  • Hybrid spectra (inline peaks + external aux) can misassign per-peak IM when the inline peaks are unsorted and sorting is on.
  • The cvParam name attribute is stored in every CvEntry and forwarded through applyRefGroup_, but handleIMSCvParam_ ignores it.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FHpfx4xEGqkzAr6hhj5GHR

…ux snapshot

imzML stores per-peak data only as FloatDataArrays, so IntegerDataArrays and
StringDataArrays (e.g. a "charge array" carried over from mzML) vanish on export.
Unnamed and length-mismatched FloatDataArrays already warn; these did not, so the
loss was only visible downstream. Warn once per store -- not once per pixel -- and
cap the listed array names so the line cannot grow with the dataset, matching the
duplicate-pixel warning.

The per-spectrum IMS snapshot also deep-copied cur_aux_metas_ and
cur_inline_aux_names_ (three strings per aux array) even though both are cleared
immediately afterwards; move them instead.

Follow-up to #9908.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FHpfx4xEGqkzAr6hhj5GHR
@coderabbitai

coderabbitai Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 2 minutes.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f018beec-d0e0-4c35-8e04-35718cd5817e

📥 Commits

Reviewing files that changed from the base of the PR and between 5618751 and 741a99c.

📒 Files selected for processing (4)
  • CHANGELOG
  • src/openms/source/FORMAT/HANDLERS/ImzMLHandler.cpp
  • src/openms/source/FORMAT/HANDLERS/ImzMLWriter.cpp
  • src/tests/class_tests/openms/source/ImzMLFile_test.cpp

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

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

@timosachsenberg
timosachsenberg merged commit 14da2d0 into develop Aug 29, 2026
36 checks passed
@timosachsenberg
timosachsenberg deleted the claude/openms-pr-9908-review-c0y9h2 branch August 29, 2026 19:05
pull Bot pushed a commit to matchy233/OpenMS that referenced this pull request Aug 30, 2026
- -feat_dir (ProteomicsLFQ) and the imzML dropped-array warning shipped
  without their PR citation (OpenMS#9989, OpenMS#10002).
- The Biosaur2/FAIMS fix entry cited only the tracking issue (OpenMS#9980),
  not the merged PR (OpenMS#9996).
- No entry existed for the NSIS Cfg_Settings.nsh path fix (OpenMS#9978,
  OpenMS#9991) or the multi-arch container deploy race fix (OpenMS#9951, OpenMS#9954).
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