Repository navigation
add MEAN_INVERSE_REDUCED_ION_MOBILITY_ARRAY constant - #9181
Conversation
…tend getIMUnit coverage Adds a new UserParam constant for Bruker 'mean inverse reduced ion mobility array' (CV MS:1003006) alongside the existing INVERSE_REDUCED_ION_MOBILITY (MS:1002815). Updates IMDataConverter::getIMUnit to recognise all three IM array name prefixes, ensuring correct unit detection for timsTOF, MSConvert, and Bruker raw data. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
|
@alhigaylan The following names might be missing from the
Please consider applying the following patch: --- AUTHORS 2026-04-17 19:46:30.682970136 +0000
+++ AUTHORS.new 2026-04-17 19:46:35.701828424 +0000
@@ -11,6 +11,7 @@
- Alen Saric
- Alexandra Scherbart
- Alexandra Zerck
+ - alhigaylan
- Amanda Wein
- Andreas Bertsch
- Andreas Simon |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe pull request adds a new Changes
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 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.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
src/openms/source/IONMOBILITY/IMDataConverter.cpp (2)
333-349:⚠️ Potential issue | 🔴 CriticalIncorrect unit inferred for
"mean inverse reduced ion mobility array"(MS:1003006).MS:1003006 is an inverse‑reduced‑ion‑mobility quantity whose unit is volt‑second per square centimeter (MS:1002814), i.e. the same
DriftTimeUnit::VSSCasINVERSE_REDUCED_ION_MOBILITY/ MS:1002815. However, the fallback here only upgrades toVSSCwhen the array name contains the literal substring"MS:1002815". Since an MS:1003006 array name will not contain that substring, this branch will fall through to theelseat Line 347 and classify it asDriftTimeUnit::MILLISECOND, silently producing wrong IM units for every downstream consumer (PeakPickerIM,getIMData(), etc.).You should either (a) key the unit decision on the array name itself rather than an embedded accession substring, or (b) also accept
"MS:1003006"as a VSSC marker. Option (a) is more robust since msconvert does not embed the accession in the FDA name.🐛 Proposed fix
bool IMDataConverter::getIMUnit(const DataArrays::FloatDataArray& fda, DriftTimeUnit& unit) { const auto& cv = ControlledVocabulary::getPSIMSCV(); - if (fda.getName().hasPrefix(Constants::UserParam::ION_MOBILITY) || - fda.getName().hasPrefix(Constants::UserParam::INVERSE_REDUCED_ION_MOBILITY) || - fda.getName().hasPrefix(Constants::UserParam::MEAN_INVERSE_REDUCED_ION_MOBILITY_ARRAY)) - { // fallback for non-standard IM arrays (as created by Mobi-DIK, "Ion Mobility Centroid" from PeakPickerIM, "inverse reduced ion mobility" from MSConvert, or "mean inverse reduced ion mobility array" from Bruker) - if (fda.getName().hasSubstring("MS:1002815")) + const String& name = fda.getName(); + const bool is_inv_reduced = + name.hasPrefix(Constants::UserParam::INVERSE_REDUCED_ION_MOBILITY) || + name.hasPrefix(Constants::UserParam::MEAN_INVERSE_REDUCED_ION_MOBILITY_ARRAY); + if (name.hasPrefix(Constants::UserParam::ION_MOBILITY) || is_inv_reduced) + { // fallback for non-standard IM arrays (Mobi-DIK, PeakPickerIM "Ion Mobility Centroid", + // MSConvert "inverse reduced ion mobility" (MS:1002815), or + // "mean inverse reduced ion mobility array" (MS:1003006) from msconvert on Bruker timsTOF) + if (is_inv_reduced || name.hasSubstring("MS:1002815") || name.hasSubstring("MS:1003006")) { unit = DriftTimeUnit::VSSC; } - else if (fda.getName().hasSubstring("MS:1002954")) + else if (name.hasSubstring("MS:1002954")) { unit = DriftTimeUnit::CCS; }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/openms/source/IONMOBILITY/IMDataConverter.cpp` around lines 333 - 349, The unit selection in IMDataConverter.cpp incorrectly classifies "mean inverse reduced ion mobility array" (MS:1003006) as MILLISECOND because the fallback checks only for substring "MS:1002815"; update the logic in the block that examines fda.getName() (used alongside Constants::UserParam::MEAN_INVERSE_REDUCED_ION_MOBILITY_ARRAY) to treat MS:1003006 as VSSC as well — either by checking for fda.getName().hasSubstring("MS:1003006") in the same branch that sets DriftTimeUnit::VSSC or, preferably, by basing the decision directly on the array identifier/constant (e.g., recognize MEAN_INVERSE_REDUCED_ION_MOBILITY_ARRAY/MS:1003006) instead of relying on embedded accession substrings so that functions like getIMData() and PeakPickerIM get the correct DriftTimeUnit.
330-356:⚠️ Potential issue | 🟡 MinorThe fallback for MS:1003006 appears unnecessary.
MS:1003006 ("mean inverse reduced ion mobility array") is properly defined in the bundled PSI-MS CV with
is_a: MS:1002893andrelationship: has_units MS:1002814. Since FDA names from Bruker and ProteoWizard use the exact CV term name "mean inverse reduced ion mobility array", the normal CV lookup path viacv.getTermByName(fda.getName())should resolve it automatically and extract the correct unit mapping, making the new fallback prefix check redundant. Consider removing theMEAN_INVERSE_REDUCED_ION_MOBILITY_ARRAYcondition from the fallback block (line 333) and letting it use the standard CV resolution.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/openms/source/IONMOBILITY/IMDataConverter.cpp` around lines 330 - 356, In IMDataConverter::getIMUnit, remove the special-case prefix check for Constants::UserParam::MEAN_INVERSE_REDUCED_ION_MOBILITY_ARRAY inside getIMUnit so that names matching the official "mean inverse reduced ion mobility array" are resolved via cv.getTermByName(fda.getName()) and the CV-based unit mapping logic (cv.getTermByName + cv.isChildOf + has_units handling) in IMDataConverter::getIMUnit handles the unit lookup; keep the other user-param fallbacks (ION_MOBILITY and INVERSE_REDUCED_ION_MOBILITY) but delete the MEAN_INVERSE_REDUCED_ION_MOBILITY_ARRAY branch and its associated fallback unit assignments.
🧹 Nitpick comments (1)
src/openms/include/OpenMS/CONCEPT/Constants.h (1)
258-263: Naming inconsistency with sibling IM constants.The sibling constants (
ION_MOBILITY,INVERSE_REDUCED_ION_MOBILITY) omit the_ARRAYsuffix even though their string values are also array names. To keep theUserParamsurface consistent and make the fallback chain inIMDataConverter::getIMUnitread uniformly, consider renaming this toMEAN_INVERSE_REDUCED_ION_MOBILITY(keeping the string value"mean inverse reduced ion mobility array"as-is).Proposed rename
- /** Alternative MetaValue key for ion mobility data (inverse reduced ion mobility). - * Some files store ion mobility data with this prefix instead of "Ion Mobility". - * Unit is typically volt-seconds per square centimeter (Vs/cm^2) also known as 1/k0. - * CV Term MS:1003006 - */ - inline const std::string MEAN_INVERSE_REDUCED_ION_MOBILITY_ARRAY = "mean inverse reduced ion mobility array"; + /** MetaValue key for mean inverse reduced ion mobility array (MS:1003006, e.g. produced by + * Proteowizard msconvert for Bruker timsTOF .d data). Unit is volt-seconds per square + * centimeter (Vs/cm^2), i.e. 1/K0. + */ + inline const std::string MEAN_INVERSE_REDUCED_ION_MOBILITY = "mean inverse reduced ion mobility array";🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/openms/include/OpenMS/CONCEPT/Constants.h` around lines 258 - 263, The constant MEAN_INVERSE_REDUCED_ION_MOBILITY_ARRAY should be renamed to MEAN_INVERSE_REDUCED_ION_MOBILITY to match the naming of sibling constants (ION_MOBILITY, INVERSE_REDUCED_ION_MOBILITY) while keeping its string value "mean inverse reduced ion mobility array" unchanged; update the declaration in Constants.h and replace all references (e.g., usages in IMDataConverter::getIMUnit and any other callers) to use the new identifier to preserve the fallback chain consistency and compilation.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@src/openms/source/IONMOBILITY/IMDataConverter.cpp`:
- Around line 333-349: The unit selection in IMDataConverter.cpp incorrectly
classifies "mean inverse reduced ion mobility array" (MS:1003006) as MILLISECOND
because the fallback checks only for substring "MS:1002815"; update the logic in
the block that examines fda.getName() (used alongside
Constants::UserParam::MEAN_INVERSE_REDUCED_ION_MOBILITY_ARRAY) to treat
MS:1003006 as VSSC as well — either by checking for
fda.getName().hasSubstring("MS:1003006") in the same branch that sets
DriftTimeUnit::VSSC or, preferably, by basing the decision directly on the array
identifier/constant (e.g., recognize
MEAN_INVERSE_REDUCED_ION_MOBILITY_ARRAY/MS:1003006) instead of relying on
embedded accession substrings so that functions like getIMData() and
PeakPickerIM get the correct DriftTimeUnit.
- Around line 330-356: In IMDataConverter::getIMUnit, remove the special-case
prefix check for Constants::UserParam::MEAN_INVERSE_REDUCED_ION_MOBILITY_ARRAY
inside getIMUnit so that names matching the official "mean inverse reduced ion
mobility array" are resolved via cv.getTermByName(fda.getName()) and the
CV-based unit mapping logic (cv.getTermByName + cv.isChildOf + has_units
handling) in IMDataConverter::getIMUnit handles the unit lookup; keep the other
user-param fallbacks (ION_MOBILITY and INVERSE_REDUCED_ION_MOBILITY) but delete
the MEAN_INVERSE_REDUCED_ION_MOBILITY_ARRAY branch and its associated fallback
unit assignments.
---
Nitpick comments:
In `@src/openms/include/OpenMS/CONCEPT/Constants.h`:
- Around line 258-263: The constant MEAN_INVERSE_REDUCED_ION_MOBILITY_ARRAY
should be renamed to MEAN_INVERSE_REDUCED_ION_MOBILITY to match the naming of
sibling constants (ION_MOBILITY, INVERSE_REDUCED_ION_MOBILITY) while keeping its
string value "mean inverse reduced ion mobility array" unchanged; update the
declaration in Constants.h and replace all references (e.g., usages in
IMDataConverter::getIMUnit and any other callers) to use the new identifier to
preserve the fallback chain consistency and compilation.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: fc242666-a1fe-4969-989a-7b93314e2f8b
📒 Files selected for processing (2)
src/openms/include/OpenMS/CONCEPT/Constants.hsrc/openms/source/IONMOBILITY/IMDataConverter.cpp
|
Ok so this really attached to each peak. I saw this term before and assumed it is a mean vague e.g. from merged scans |
|
If there is data that contains this we should handle this |
I agree. I added MS:1003006 check in addition to MS:1002815 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@contrib`:
- Line 1: Revert the accidental contrib submodule pointer change: restore the
contrib pointer from e6fde7cfed8cde73c6625cd493ce3f82e21263cc back to the
original 186aacfbc1157719735b497cd6de1b3e83289eea so no third‑party dependency
versions are changed; update the PR to remove the contrib submodule modification
and re-run the commit (or amend the commit) so only the intended changes (adding
MEAN_INVERSE_REDUCED_ION_MOBILITY_ARRAY and extending
IMDataConverter::getIMUnit) remain—if the submodule bump was intentional,
instead document and justify the bump in the commit message and PR description.
🪄 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: f4582ba0-3dc5-46c9-a16b-245aec69d25d
📒 Files selected for processing (2)
contribsrc/openms/source/IONMOBILITY/IMDataConverter.cpp
🚧 Files skipped from review as they are similar to previous changes (1)
- src/openms/source/IONMOBILITY/IMDataConverter.cpp
b6f278d to
7e57ffc
Compare
Add missing entries for commits since the 2026-04-18 sync: - Constants #9181: new MEAN_INVERSE_REDUCED_ION_MOBILITY_ARRAY constant (CV MS:1003006) + IMDataConverter::getIMUnit extended to cover all three IM array name prefixes - ProSE #9185: calibration in chunked search now uses a strided sample across the full DB; asymmetric calibrated precursor bounds correctly preserved through chunked/multi-file paths; corrects stale 'calibration is skipped in chunked mode' text in the #9177 chunking entry Co-authored-by: Copilot <[email protected]>
Add missing entries for commits since the 2026-04-18 sync: - Constants #9181: new MEAN_INVERSE_REDUCED_ION_MOBILITY_ARRAY constant (CV MS:1003006) + IMDataConverter::getIMUnit extended to cover all three IM array name prefixes - ProSE #9185: calibration in chunked search now uses a strided sample across the full DB; asymmetric calibrated precursor bounds correctly preserved through chunked/multi-file paths; corrects stale 'calibration is skipped in chunked mode' text in the #9177 chunking entry Co-authored-by: GitHub Copilot <[email protected]> Co-authored-by: Copilot <[email protected]>
Proteowizard msconvert is a popular tool to convert .d TimsTOF files to mzML. The algorithm output ion mobility array as 'MEAN_INVERSE_REDUCED_ION_MOBILITY_ARRAY' with the CV term MS:1003006. I updated the Constants.h file and IMDataConverter type to check for this term.
Here is a snippet of mzML file from msconvert
I double checked this controlled term using HUPO-PSI dictionary in this link
IMDataConverter::getIMUnit should now be able to recognize this term among other CVs for ion mobility arrays.
Forr the fallback block aiming to capture unconventional ion mobility array names, we should check for MS:1003006 in addition to MS:1002815. Feedback on this? if you agree, I will add a snippet code to check for this.
Description
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 buildsSummary by CodeRabbit