Skip to content

msconvert: representation of ion mobility changed #8732

Closed

Description

@timosachsenberg

Report

ProteoWizard creators have changed the representation of ion mobility in their files, and as a result, NuXL stopped assigning ion mobility from the mzML files (with the same tunings) generated by the new version of MSConvert. Two exemplary mzML files are attached to the zip file to be downloaded. I also included snippets from the mzML files with the difference as a text file. In the new version, CCS is reported instead of 1/K0. This should be accounted for in the web version and in the new versions of OpenMS. Ideally, to save both options, if it's possible.

Activity

  1. coderabbitai commented on Feb 3, 2026

    @coderabbitai
    Contributor

    📝 CodeRabbit Plan Mode

    Generate an implementation plan and prompts that you can use with your favorite coding agent.

    • Create Plan
    Examples

    🔗 Related PRs

    #7851 - feature: split experiments by FAIMS CV [merged]
    #7958 - improve compatibility with mzTabM standard [merged]
    #7981 - refactor: move basename member out of PeptideIdentification into MetaValues [merged]
    #8074 - Up to 40% faster mzML reading [merged]


    🧪 Issue enrichment is currently in open beta.

    You can configure auto-planning by selecting labels in the issue_enrichment configuration.

    To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

    issue_enrichment:
      auto_enrich:
        enabled: false

    💬 Have feedback or questions? Drop into our discord!

  2. timosachsenberg commented on Feb 3, 2026

    @timosachsenberg
    ContributorAuthor

    Analysis and Implementation Plan

    I've analyzed the OpenMS codebase to understand the impact of this change. Here's a comprehensive summary and proposed fix.

    Problem Summary

    Old MSConvert (v3.0.24333) outputs:

    <cvParam cvRef="MS" accession="MS:1002815" name="inverse reduced ion mobility" 
             value="1.1055830536289999" unitCvRef="MS" unitAccession="MS:1002814" 
             unitName="volt-second per square centimeter"/>

    New MSConvert (v3.0.26007) outputs:

    <cvParam cvRef="MS" accession="MS:1002954" name="collisional cross sectional area" 
             value="426.714229261469" unitCvRef="UO" unitAccession="UO:0000324" 
             unitName="square angstrom"/>

    Root Cause

    OpenMS's MzMLHandler.cpp only recognizes these CV terms for ion mobility:

    • MS:1002476 - ion mobility drift time (milliseconds) ✅
    • MS:1002815 - inverse reduced ion mobility (1/K0) ✅
    • MS:1001581 - FAIMS compensation voltage ✅
    • MS:1002954 - collisional cross sectional area (CCS) ❌ NOT PARSED

    When new MSConvert files are loaded, the CCS values are completely ignored, resulting in drift_time_ = -1 (not set).

    Files Requiring Changes

    1. src/openms/include/OpenMS/IONMOBILITY/IMTypes.h

    Add CCS to the DriftTimeUnit enum:

    enum class DriftTimeUnit {
      NONE,
      MILLISECOND,
      VSSC,                       // 1/K0 (volt-second per square centimeter)
      FAIMS_COMPENSATION_VOLTAGE,
      CCS,                        // NEW: Collisional Cross Section (square angstrom)
      SIZE_OF_DRIFTTIMEUNIT
    };

    2. src/openms/source/IONMOBILITY/IMTypes.cpp

    Add string representation:

    const std::string NamesOfDriftTimeUnit[] = {"<NONE>", "ms", "1/K0", "FAIMS_CV", "CCS"};

    3. src/openms/source/FORMAT/HANDLERS/MzMLHandler.cpp

    Reading (2 locations - precursor level ~line 1711 and scan level ~line 2129):

    else if (accession == "MS:1002476" || accession == "MS:1002815" || 
             accession == "MS:1001581" || accession == "MS:1002954")  // ADD MS:1002954
    {
      auto unit = DriftTimeUnit::MILLISECOND;
      if (accession == "MS:1002476") {
        unit = DriftTimeUnit::MILLISECOND;
      }
      else if (accession == "MS:1002815") {
        unit = DriftTimeUnit::VSSC;
      }
      else if (accession == "MS:1001581") {
        unit = DriftTimeUnit::FAIMS_COMPENSATION_VOLTAGE;
      }
      else if (accession == "MS:1002954") {  // ADD THIS BLOCK
        unit = DriftTimeUnit::CCS;
      }
      // ... rest of existing code
    }

    Writing (2 locations - precursor ~line 3872 and spectrum ~line 5211):

    case DriftTimeUnit::CCS:
      os << "\t\t\t\t\t\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1002954\" name=\"collisional cross sectional area\" value=\"" 
         << precursor.getDriftTime()
         << "\" unitAccession=\"UO:0000324\" unitName=\"square angstrom\" unitCvRef=\"UO\" />\n";
      break;

    4. src/openms/include/OpenMS/CONCEPT/CommonEnums.h

    Add CCS dimension unit:

    enum class DIM_UNIT {
      RT = 0,
      MZ,
      INT,
      IM_MS,
      IM_VSSC,
      FAIMS_CV,
      IM_CCS,        // NEW: CCS in square angstrom
      SIZE_OF_DIM_UNITS
    };

    5. src/topp/OpenNuXL.cpp

    Update getMS2IMType() (~line 4555) to recognize CCS:

    // Add CCS as a valid IM type
    if (IM_unit == DriftTimeUnit::CCS) {
      return DriftTimeUnit::CCS;  // Already in CCS format
    }

    Update convertVSSCToCCS() usage (~lines 5199 and 5964):

    // Only convert if input is VSSC (1/K0), skip if already CCS
    if (IM_unit == DriftTimeUnit::VSSC) {
      convertVSSCToCCS(spectra);
    }
    // If IM_unit == DriftTimeUnit::CCS, data is already in correct format

    6. src/openms/source/IONMOBILITY/IMDataConverter.cpp

    Update getIMUnit() to recognize CCS arrays if needed.

    Testing

    Add test cases with mzML files containing both formats:

    • src/tests/topp/ - Add test mzML with MS:1002954 (CCS format)
    • Verify round-trip: read CCS → write CCS → read back

    Backward Compatibility

    This change is fully backward compatible:

    • Existing files with MS:1002815 (1/K0) continue to work unchanged
    • New files with MS:1002954 (CCS) will now be parsed correctly
    • Both formats can coexist in the codebase

    Priority

    High - This affects all users processing data from instruments using newer MSConvert versions (3.0.26007+), particularly Bruker timsTOF users running NuXL cross-linking workflows.


    🤖 Generated with Claude Code

  3. timosachsenberg commented on Feb 3, 2026

    @timosachsenberg
    ContributorAuthor

    Implementation Complete

    I've implemented CCS (collisional cross sectional area) support in OpenMS. Here's a summary of all changes:

    Core Changes (10 files modified)

    1. Enum Definitions

    • IMTypes.h: Added CCS to DriftTimeUnit enum
    • IMTypes.cpp: Added "CCS" string representation and fromIMUnit() conversion
    • CommonEnums.h: Added IM_CCS to DIM_UNIT enum with display names

    2. mzML I/O (MzMLHandler.cpp)

    • Reading: Added parsing of CV term MS:1002954 (collisional cross sectional area) at both precursor and scan levels
    • Writing: Added output of CCS values with proper CV term, unit (UO:0000324 square angstrom), and unit reference

    3. Ion Mobility Data Handling

    • IMDataConverter.cpp: Updated getIMUnit() to recognize CCS from CV terms and unit annotations

    4. NuXL Tool (OpenNuXL.cpp)

    • Modified to skip CCS→CCS conversion when data is already in CCS format (from newer MSConvert)
    • Added log message: "Ion Mobility already in CCS format, no conversion needed."

    5. Python Bindings

    • IMTypes.pxd: Added CCS to Cython enum declaration
    • MSSpectrum.pyx: Updated documentation to include CCS enum value (4)

    6. Parameter Documentation Updates

    • OpenSwathWorkflow.cpp: Updated IM extraction window parameters to mention CCS
    • PeakPickerIM.cpp: Added warnings about tolerance values being in 1/K0 units, with guidance for CCS data

    Backward Compatibility

    All changes are fully backward compatible:

    • Existing files with MS:1002815 (1/K0) continue to work unchanged
    • New files with MS:1002954 (CCS) are now parsed correctly
    • Both formats can coexist

    Testing Notes

    The implementation correctly handles the two sample files provided:

    • Old MSConvert (v3.0.24333): Uses MS:1002815 → parsed as DriftTimeUnit::VSSC
    • New MSConvert (v3.0.26007): Uses MS:1002954 → parsed as DriftTimeUnit::CCS

    Known Limitations (documented for future work)

    • PeakPickerIM: Default tolerances (0.0006 and 0.1) are optimized for 1/K0 values. Users with CCS data need to adjust these manually (documented in parameter descriptions).
    • OpenSWATH: IM extraction windows need to be specified in the appropriate unit for the library being used.

    🤖 Generated with Claude Code

  4. added 2 commits that reference this issue on Feb 3, 2026
    757e57b
    2c125a7
  5. added 2 commits that reference this issue on Feb 4, 2026
    4fb67c5
    298b799
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions