Repository navigation
refactor: split IMFormat into IMFormat + IMPeakType (data layout vs processing state) - #9007
Conversation
Add new IMPeakType enum (IM_PROFILE, IM_CENTROIDED, UNKNOWN) to separate IM processing state from data layout. Store on SpectrumSettings alongside existing IMFormat. Mark IMFormat::CENTROIDED as deprecated. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Move centroided-rejection check from IMFormat switch to IMPeakType check. Output marking now uses setIMPeakType(IM_CENTROIDED). Remove CENTROIDED branches from TOPP tool (both high-memory and streaming paths). Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
All consumers have been migrated to IMPeakType::IM_CENTROIDED. Remove the deprecated CENTROIDED value from IMFormat enum. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Add IMPeakType nanobind enum, getter/setter on MSSpectrum, string conversion static methods and __static_* wrappers. Update stale pxd. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Check IMPeakType before calling centroidPASEFData_(). When input has been pre-processed by PeakPickerIM (IM_CENTROIDED), skip the internal PASEF/TIMS centroiding step. UNKNOWN and IM_PROFILE proceed to centroiding as before (safe default). Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
MzMLHandler sets IMPeakType::IM_PROFILE on spectra with IM float data arrays when no MS:1003441 (centroided) CV term is present. BrukerTimsFile sets IM_PROFILE on all raw TIMS frames and IM_CENTROIDED on internally centroided MS1 frames. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR replaces Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 7
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
src/topp/PeakPickerIM.cpp (1)
247-274:⚠️ Potential issue | 🟠 MajorMove IM format validation out of the OpenMP parallel loop.
The in-memory path (lines 247–280) checks only for
IMFormat::NONEbefore entering the#pragma omp parallel forregion, then defers validation of unsupported formats tovalidateIMFormatForPicking()called inside each worker thread. That method throwsException::InvalidValuefor centroided, UNKNOWN, or unsupported formats—causing hard termination from within the parallel region instead of clean error reporting. The low-memory path (lines 195–206) validatesIM_SPECTRUMandMIXEDformats upfront withOPENMS_LOG_ERRORandreturn ILLEGAL_PARAMETERS. Apply the same validation before the parallel loop in the in-memory path.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/topp/PeakPickerIM.cpp` around lines 247 - 274, The in-memory branch currently defers IM format validation to validateIMFormatForPicking() inside each thread, which can throw inside the OpenMP loop; move the validation out of the parallel region by calling IMTypes::determineIMFormat(exp) (already present) and then perform the same check used in the low-memory path: if im_format is neither IMFormat::IM_SPECTRUM nor IMFormat::MIXED, log an OPENMS_LOG_ERROR with a clear message and return ILLEGAL_PARAMETERS before entering the `#pragma` omp parallel for so picker.pickIMTraces, picker.pickIMCluster, and picker.pickIMElutionProfiles are only called when the format is supported and no exceptions are thrown inside worker threads.src/openms/source/PROCESSING/CENTROIDING/PeakPickerIM.cpp (1)
969-976:⚠️ Potential issue | 🟠 MajorAlso stamp the output layout as
IMFormat::IM_PEAK.These paths only update
IMPeakType. If the incoming metadata is stillIMFormat::UNKNOWN, the centroided result staysUNKNOWNafter the settings copy/in-place rewrite even though the output still stores per-peak IM data. That leaves the new layout/state split inconsistent and can still trip callers that readgetIMFormat()directly.🩹 Proposed fix
removeAllFloatDataArraysExcept(centroided_frame, Constants::UserParam::ION_MOBILITY_CENTROID); + centroided_frame.setIMFormat(IMFormat::IM_PEAK); centroided_frame.setIMPeakType(IMPeakType::IM_CENTROIDED);spectrum.getFloatDataArrays()[im_data_index].setName(Constants::UserParam::ION_MOBILITY_CENTROID); + spectrum.setIMFormat(IMFormat::IM_PEAK); spectrum.setIMPeakType(IMPeakType::IM_CENTROIDED); removeAllFloatDataArraysExcept(spectrum, Constants::UserParam::ION_MOBILITY_CENTROID);input.getFloatDataArrays()[im_data_index].setName(Constants::UserParam::ION_MOBILITY_CENTROID); + input.setIMFormat(IMFormat::IM_PEAK); input.setIMPeakType(IMPeakType::IM_CENTROIDED); removeAllFloatDataArraysExcept(input, Constants::UserParam::ION_MOBILITY_CENTROID);Also applies to: 1221-1226, 1316-1321
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/openms/source/PROCESSING/CENTROIDING/PeakPickerIM.cpp` around lines 969 - 976, The centroiding path currently only sets the IM peak type (via centroided_frame.setIMPeakType(IMPeakType::IM_CENTROIDED)) but does not update the container layout/format, leaving getIMFormat() as IMFormat::UNKNOWN; after copying SpectrumSettings into centroided_frame and before moving it back into spectrum, also set the IM format to IMFormat::IM_PEAK (e.g., centroided_frame.setIMFormat(IMFormat::IM_PEAK)) so the per-peak IM layout/state is consistent; apply the same change in the other centroiding branches that mirror this logic (the similar blocks around the other centroiding paths that set IMPeakType).
🧹 Nitpick comments (3)
src/pyOpenMS/bindings/bind_kernel.cpp (1)
153-167: Keep newIMTypes.hbindings inbind_misc.cpp.Lines 153-167 add another symbol from
OpenMS/IONMOBILITY/IMTypes.htobind_kernel.cpp. Since the conversion helpers forIMPeakTypealready live inbind_misc.cpp, moving the enum there keeps the IMTypes API together instead of deepening the current split.As per coding guidelines, "Choose binding files based on C++ header module path: KERNEL/* → bind_kernel.cpp, MSSpectrum.h → bind_spectrum.cpp, MSChromatogram.h → bind_chromatogram.cpp, MSExperiment.h → bind_experiment.cpp, FORMAT/* → bind_format.cpp, ANALYSIS/* → bind_analysis.cpp, CHEMISTRY/* → bind_chemistry.cpp, METADATA/* → bind_metadata.cpp, PROCESSING/* → bind_processing.cpp, FEATUREFINDER/* → bind_featurefinder.cpp, DATASTRUCTURES/MATH/CONCEPT/* → bind_datastructures.cpp, ML/* → bind_ml.cpp, all others → bind_misc.cpp"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/pyOpenMS/bindings/bind_kernel.cpp` around lines 153 - 167, The IMPeakType enum binding added to bind_kernel.cpp should be moved into bind_misc.cpp so the IMTypes.h API and its conversion helpers remain together; remove the nb::enum_<OpenMS::IMPeakType> block from bind_kernel.cpp and re-add the same enum registration in bind_misc.cpp alongside the existing conversion helpers for IMPeakType, ensuring you import or include OpenMS/IONMOBILITY/IMTypes.h where needed and call .value(...)/.export_values() exactly as before so the binding API remains identical.src/tests/class_tests/openms/source/IMTypes_test.cpp (1)
168-178: Make this test fixture explicit with one real IM peak.Right now the assertion is based on an empty spectrum + empty IM array. Adding one peak and one IM value makes the behavior under test unambiguous.
Proposed test setup tweak
START_SECTION(determineIMFormat returns IM_PEAK for centroided IM data) { MSSpectrum s; + Peak1D p; + p.setMZ(500.0); + p.setIntensity(100.0); + s.push_back(p); MSSpectrum::FloatDataArray fda; fda.setName("Ion Mobility"); + fda.push_back(1.0f); s.getFloatDataArrays().push_back(fda); s.setIMPeakType(IMPeakType::IM_CENTROIDED); TEST_EQUAL(IMTypes::determineIMFormat(s), IMFormat::IM_PEAK) } END_SECTION🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/tests/class_tests/openms/source/IMTypes_test.cpp` around lines 168 - 178, The test uses an empty MSSpectrum and empty IM float array which makes determineIMFormat's behavior ambiguous; modify the fixture to add a real peak and a matching IM value: create a Peak1 (e.g., MSSpectrum::PeakType with m/z and intensity) and push it into the MSSpectrum via push_back, then add a single float IM value into the FloatDataArray obtained from s.getFloatDataArrays() (or use fda.push_back(value) before pushing fda into the spectrum), keep the call to s.setIMPeakType(IMPeakType::IM_CENTROIDED) and assert IMTypes::determineIMFormat(s) == IMFormat::IM_PEAK so the test is explicit about having one centroided IM peak.src/openms/include/OpenMS/IONMOBILITY/IMTypes.h (1)
77-84: Add full Doxygen blocks for the new public conversion helpers.
toIMPeakTypeandimPeakTypeToStringare public header APIs, but the new comments stop short of the repo-standard@brief,@param[in],@return, and@throwsdocumentation.As per coding guidelines, "Document all method parameters with
@param[in],@param[out], or@param[in,out]tags; use@briefas required first line; document return values with@return."🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/openms/include/OpenMS/IONMOBILITY/IMTypes.h` around lines 77 - 84, Add full Doxygen blocks for the public conversion helpers: expand the brief single-line comments above NamesOfIMPeakType, toIMPeakType, and imPeakTypeToString into repo-standard Doxygen blocks that include `@brief`, `@param`[in] for im_peak_type (for toIMPeakType) and im_peak_type (for imPeakTypeToString), `@return` describing the returned value/reference, and `@throws` describing the behavior when an invalid/unknown peak type string or enum value is passed; reference the existing symbols NamesOfIMPeakType, toIMPeakType, and imPeakTypeToString so the docs are clearly tied to those declarations.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/openms/include/OpenMS/METADATA/SpectrumSettings.h`:
- Around line 106-110: Add full Doxygen comments for the two new public
accessors: for void setIMPeakType(IMPeakType im_peak_type) add a `@brief`
describing that it sets the IM peak type and a `@param`[in] im_peak_type
describing the allowed values/semantics; for IMPeakType getIMPeakType() const
add a `@brief` describing that it returns the current IM peak type and a `@return`
describing what is returned. Ensure the first line uses `@brief`, use `@param`[in]
for the setter parameter name im_peak_type, and include `@return` on the getter so
the documentation matches the rest of SpectrumSettings' public API.
- Line 170: SpectrumSettings gained the member im_peak_type_ but equality and
hashing were not updated; update SpectrumSettings::operator== to include
comparison of im_peak_type_ (so two SpectrumSettings differ when im_peak_type_
differs) and update the std::hash<OpenMS::SpectrumSettings> specialization to
mix in the hash of im_peak_type_ (use the existing hash-combine pattern used
elsewhere in OpenMS to incorporate im_peak_type_ into the final size_t). Ensure
you reference the im_peak_type_ field in both places so
MSSpectrum/SpectrumSettings objects with different IM peak types no longer
compare or hash identically.
In `@src/openms/source/FEATUREFINDER/Biosaur2Algorithm.cpp`:
- Around line 259-286: The current loop over groups may break out early even if
no concrete IMPeakType was found; adjust the control flow in the groups ->
group_exp loops so you only stop scanning further groups after you actually log
a non-UNKNOWN IMPeakType. Concretely, in the outer loop that iterates over
groups (group_pair / group_exp) keep the any_im_array detection but introduce a
boolean like found_concrete (or reuse any_im_array differently) that is set only
when spec.getIMPeakType() yields a non-UNKNOWN and you call
imPeakTypeToString(...) and log it; only then break out of the outer loop —
otherwise continue to the next group to keep searching for a concrete
IMPeakType.
- Around line 1213-1234: The current loop sets im_already_centroided if any
spectrum in group_exp has IMPeakType::IM_CENTROIDED, which wrongly skips
centroiding for mixed groups; change the logic to set im_already_centroided true
only when all IM spectra in group_exp are IMPeakType::IM_CENTROIDED (e.g.,
assume true and mark false on seeing any spectrum where spec.getIMPeakType() !=
IMPeakType::IM_CENTROIDED or only consider spectra with IM data), so the
subsequent check that gates internal PASEF/TIMS centroiding uses a “all
centroided” guard rather than an “any centroided” one.
In `@src/openms/source/FORMAT/HANDLERS/MzMLHandler.cpp`:
- Around line 1288-1292: The fallback to set IM peak type to
IMPeakType::IM_PROFILE is being checked via spec_.containsIMData() before the
binary IM arrays are materialized, so containsIMData() returns false and IM
frames remain UNKNOWN; move this fallback logic to after
populateSpectraWithData_() where spec_ binary arrays exist, or alternatively
detect IM presence directly from bin_data_ in this location (e.g., check
bin_data_ for IM arrays) and only then call
spec_.setIMPeakType(IMPeakType::IM_PROFILE) when spec_.getIMPeakType() ==
IMPeakType::UNKNOWN; update references to containsIMData(), getIMPeakType(),
setIMPeakType(), populateSpectraWithData_(), and bin_data_ accordingly.
In `@src/pyOpenMS/bindings/bind_kernel.cpp`:
- Around line 157-167: The enum binding for OpenMS::IMPeakType is calling
.export_values(), which exports its members (including UNKNOWN) into the module
namespace and shadows the existing module-level UNKNOWN from IMFormat; remove
the .export_values() call on the nb::enum_<OpenMS::IMPeakType>(...) binding so
the enum remains scoped (access via pyopenms.IMPeakType.UNKNOWN) and do not
export its values into the parent module namespace; verify no other enum class
bindings use .export_values() for strongly typed enums.
In `@src/pyOpenMS/pxds/IMTypes.pxd`:
- Around line 18-38: The enums DriftTimeUnit, IMFormat, and IMPeakType declare
unscoped members (e.g., NONE, UNKNOWN) that collide; change each declaration
from "cdef enum EnumName:" to "cdef enum class EnumName:" so their enumerators
are scoped and no longer conflict (update DriftTimeUnit, IMFormat, IMPeakType
declarations accordingly and recompile to verify).
---
Outside diff comments:
In `@src/openms/source/PROCESSING/CENTROIDING/PeakPickerIM.cpp`:
- Around line 969-976: The centroiding path currently only sets the IM peak type
(via centroided_frame.setIMPeakType(IMPeakType::IM_CENTROIDED)) but does not
update the container layout/format, leaving getIMFormat() as IMFormat::UNKNOWN;
after copying SpectrumSettings into centroided_frame and before moving it back
into spectrum, also set the IM format to IMFormat::IM_PEAK (e.g.,
centroided_frame.setIMFormat(IMFormat::IM_PEAK)) so the per-peak IM layout/state
is consistent; apply the same change in the other centroiding branches that
mirror this logic (the similar blocks around the other centroiding paths that
set IMPeakType).
In `@src/topp/PeakPickerIM.cpp`:
- Around line 247-274: The in-memory branch currently defers IM format
validation to validateIMFormatForPicking() inside each thread, which can throw
inside the OpenMP loop; move the validation out of the parallel region by
calling IMTypes::determineIMFormat(exp) (already present) and then perform the
same check used in the low-memory path: if im_format is neither
IMFormat::IM_SPECTRUM nor IMFormat::MIXED, log an OPENMS_LOG_ERROR with a clear
message and return ILLEGAL_PARAMETERS before entering the `#pragma` omp parallel
for so picker.pickIMTraces, picker.pickIMCluster, and
picker.pickIMElutionProfiles are only called when the format is supported and no
exceptions are thrown inside worker threads.
---
Nitpick comments:
In `@src/openms/include/OpenMS/IONMOBILITY/IMTypes.h`:
- Around line 77-84: Add full Doxygen blocks for the public conversion helpers:
expand the brief single-line comments above NamesOfIMPeakType, toIMPeakType, and
imPeakTypeToString into repo-standard Doxygen blocks that include `@brief`,
`@param`[in] for im_peak_type (for toIMPeakType) and im_peak_type (for
imPeakTypeToString), `@return` describing the returned value/reference, and
`@throws` describing the behavior when an invalid/unknown peak type string or enum
value is passed; reference the existing symbols NamesOfIMPeakType, toIMPeakType,
and imPeakTypeToString so the docs are clearly tied to those declarations.
In `@src/pyOpenMS/bindings/bind_kernel.cpp`:
- Around line 153-167: The IMPeakType enum binding added to bind_kernel.cpp
should be moved into bind_misc.cpp so the IMTypes.h API and its conversion
helpers remain together; remove the nb::enum_<OpenMS::IMPeakType> block from
bind_kernel.cpp and re-add the same enum registration in bind_misc.cpp alongside
the existing conversion helpers for IMPeakType, ensuring you import or include
OpenMS/IONMOBILITY/IMTypes.h where needed and call .value(...)/.export_values()
exactly as before so the binding API remains identical.
In `@src/tests/class_tests/openms/source/IMTypes_test.cpp`:
- Around line 168-178: The test uses an empty MSSpectrum and empty IM float
array which makes determineIMFormat's behavior ambiguous; modify the fixture to
add a real peak and a matching IM value: create a Peak1 (e.g.,
MSSpectrum::PeakType with m/z and intensity) and push it into the MSSpectrum via
push_back, then add a single float IM value into the FloatDataArray obtained
from s.getFloatDataArrays() (or use fda.push_back(value) before pushing fda into
the spectrum), keep the call to s.setIMPeakType(IMPeakType::IM_CENTROIDED) and
assert IMTypes::determineIMFormat(s) == IMFormat::IM_PEAK so the test is
explicit about having one centroided IM peak.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 34d29cfb-6b74-477c-bae7-7be8f0aa7c01
📒 Files selected for processing (18)
src/openms/include/OpenMS/IONMOBILITY/IMTypes.hsrc/openms/include/OpenMS/METADATA/SpectrumSettings.hsrc/openms/source/FEATUREFINDER/Biosaur2Algorithm.cppsrc/openms/source/FEATUREFINDER/FeatureFinderAlgorithmMetaboIdent.cppsrc/openms/source/FEATUREFINDER/FeatureFinderIdentificationAlgorithm.cppsrc/openms/source/FORMAT/BrukerTimsFile.cppsrc/openms/source/FORMAT/HANDLERS/MzMLHandler.cppsrc/openms/source/IONMOBILITY/IMTypes.cppsrc/openms/source/METADATA/SpectrumSettings.cppsrc/openms/source/PROCESSING/CENTROIDING/PeakPickerIM.cppsrc/pyOpenMS/bindings/bind_kernel.cppsrc/pyOpenMS/bindings/bind_misc.cppsrc/pyOpenMS/bindings/bind_spectrum.cppsrc/pyOpenMS/pxds/IMTypes.pxdsrc/pyOpenMS/tests/unittests/test_api_missing_enums.pysrc/tests/class_tests/openms/source/IMTypes_test.cppsrc/tests/class_tests/openms/source/MSSpectrum_test.cppsrc/topp/PeakPickerIM.cpp
- MzMLHandler: move IM_PROFILE annotation to after populateSpectraWithData_() so containsIMData() sees materialized float arrays - PeakPickerIM: explicitly set IMFormat::IM_PEAK on output alongside IMPeakType::IM_CENTROIDED for consistent metadata - Biosaur2: require ALL IM spectra centroided (not just any) before skipping internal PASEF/TIMS centroiding, to handle mixed groups correctly - bind_kernel.cpp: remove .export_values() from IMPeakType to avoid UNKNOWN namespace collision with IMFormat.UNKNOWN Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
There was a problem hiding this comment.
♻️ Duplicate comments (1)
src/openms/source/FEATUREFINDER/Biosaur2Algorithm.cpp (1)
259-285:⚠️ Potential issue | 🟡 MinorDon’t stop scanning groups before a concrete
IMPeakTypeis found.Line 283 still breaks after the first group that merely has IM data. If that group only contains
IMPeakType::UNKNOWN, later groups withIM_PROFILEorIM_CENTROIDEDnever get logged.Minimal control-flow fix
- // Log IM peak type if IM data is present. - for (const auto& group_pair : groups) + // Log the first concrete IM peak type if IM data is present. + bool logged_im_peak_type = false; + for (const auto& group_pair : groups) { const MSExperiment& group_exp = group_pair.second; bool any_im_array = false; @@ if (any_im_array) { for (const auto& spec : group_exp) { IMPeakType pt = spec.getIMPeakType(); if (pt != IMPeakType::UNKNOWN) { OPENMS_LOG_INFO << "IM peak type: " << imPeakTypeToString(pt) << endl; + logged_im_peak_type = true; break; } } - break; // Only need to report once + if (logged_im_peak_type) + { + break; // Only need to report once + } } }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/openms/source/FEATUREFINDER/Biosaur2Algorithm.cpp` around lines 259 - 285, The current loop over groups stops after the first group that has any IM data (any_im_array) even if that group's IMPeakType is IMPeakType::UNKNOWN; update the control flow in the grouping scan so you continue scanning subsequent groups until you find a concrete IMPeakType (pt != IMPeakType::UNKNOWN) before breaking. Concretely, in the loop over groups/group_pair/group_exp, remove the unconditional outer break after checking any_im_array and only break out of both loops when you log a non-UNKNOWN IMPeakType (i.e., when pt != IMPeakType::UNKNOWN after calling spec.getIMPeakType() and logging imPeakTypeToString(pt)); keep the early break inside the inner loop to stop scanning specs in that group once a concrete type is found.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In `@src/openms/source/FEATUREFINDER/Biosaur2Algorithm.cpp`:
- Around line 259-285: The current loop over groups stops after the first group
that has any IM data (any_im_array) even if that group's IMPeakType is
IMPeakType::UNKNOWN; update the control flow in the grouping scan so you
continue scanning subsequent groups until you find a concrete IMPeakType (pt !=
IMPeakType::UNKNOWN) before breaking. Concretely, in the loop over
groups/group_pair/group_exp, remove the unconditional outer break after checking
any_im_array and only break out of both loops when you log a non-UNKNOWN
IMPeakType (i.e., when pt != IMPeakType::UNKNOWN after calling
spec.getIMPeakType() and logging imPeakTypeToString(pt)); keep the early break
inside the inner loop to stop scanning specs in that group once a concrete type
is found.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 99809a28-5dc8-43b9-ad5a-acfa2d2900f9
📒 Files selected for processing (4)
src/openms/source/FEATUREFINDER/Biosaur2Algorithm.cppsrc/openms/source/FORMAT/HANDLERS/MzMLHandler.cppsrc/openms/source/PROCESSING/CENTROIDING/PeakPickerIM.cppsrc/pyOpenMS/bindings/bind_kernel.cpp
🚧 Files skipped from review as they are similar to previous changes (2)
- src/pyOpenMS/bindings/bind_kernel.cpp
- src/openms/source/PROCESSING/CENTROIDING/PeakPickerIM.cpp
…troiding After centroidPASEFData_() completes, set IMPeakType::IM_CENTROIDED on all IM_PEAK spectra so the skip logic is self-consistent and downstream consumers see accurate metadata. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
The pxd file was accidentally added. pyOpenMS uses nanobind bindings (bind_kernel.cpp, bind_misc.cpp), not Cython pxd stubs. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Add @brief, @PARAM[in], @return, @throws tags to toIMPeakType(), imPeakTypeToString(), setIMPeakType(), and getIMPeakType(). Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Add missing changelog entries for commits after the 2026-03-26 sync: - #9019: OpenSwathWorkflow direct Bruker .d (TDF) file input - #9018: IM_PEAK format checks in Resampler, FeatureFinderCentroided, FeatureFinderMultiplex, PeakPickerHiRes - #9003: TMT 32-plex and 35-plex quantitation support - #9007: IMPeakType enum added, IMFormat::CENTROIDED deprecated - #9011: BREAKING IMFormat::MIXED removed; determineIMFormat requires ms_level Co-authored-by: Copilot <[email protected]>
Add missing changelog entries for commits after the 2026-03-26 sync: - #9019: OpenSwathWorkflow direct Bruker .d (TDF) file input - #9018: IM_PEAK format checks in Resampler, FeatureFinderCentroided, FeatureFinderMultiplex, PeakPickerHiRes - #9003: TMT 32-plex and 35-plex quantitation support - #9007: IMPeakType enum added, IMFormat::CENTROIDED deprecated - #9011: BREAKING IMFormat::MIXED removed; determineIMFormat requires ms_level Co-authored-by: GitHub Copilot <[email protected]> Co-authored-by: Copilot <[email protected]>
Summary
Splits the
IMFormatenum into two orthogonal enums:IMFormat(data layout):NONE,IM_PEAK,IM_SPECTRUM,MIXED,UNKNOWNIMPeakType(IM processing state):IM_PROFILE,IM_CENTROIDED,UNKNOWNThis separates "where is IM data stored?" from "has IM been centroided in the IM dimension?", analogous to how
SpectrumSettings::SpectrumType(PROFILE/CENTROID) is separate from m/z data layout.Key changes
IMPeakTypeadded toIMTypes.h, stored onSpectrumSettingsalongsideIMFormatIMPeakType::IM_CENTROIDEDto reject re-picking; setsIM_CENTROIDEDon outputMS:1003441maps toIMPeakType::IM_CENTROIDED; raw IM data defaults toIM_PROFILEIM_PROFILEon raw TIMS frames,IM_CENTROIDEDon internally centroided MS1centroidPASEFData_()when input isIM_CENTROIDED(avoids redundant re-centroiding)IMPeakTypeenum, getter/setter, string conversions exposedBug fix
Previously, algorithms checking
== IMFormat::IM_PEAK(Biosaur2, FeatureFinders) would silently skip data that had been centroided by PeakPickerIM (which setIMFormat::CENTROIDED). Now centroided IM data retainsIMFormat::IM_PEAK(correct layout) and is processed correctly.Design principle
Only
IM_CENTROIDEDis special.UNKNOWNandIM_PROFILEare both treated as raw/profile data by consumers (safe default).Test plan
IMTypes_test-- all sections pass (new IMPeakType tests + updated IMFormat tests)MSSpectrum_test-- getter/setter tests passPeakPickerIM_test-- passesIMFormat::CENTROIDEDreferences remain🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Bug Fixes
Refactor