Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 19, 2025

Add support for ion mobility dimension in float data arrays and mobilogram support

Implementation Complete ✓

Successfully implemented comprehensive support for ion mobility data in openms-python:

Features Implemented

  1. Float Data Arrays in Py_MSSpectrum

    • float_data_arrays property for direct access to float data arrays
    • ion_mobility property for convenient ion mobility access/manipulation
    • drift_time property for spectrum-level drift time
    • ✓ Enhanced to_dataframe() to include float arrays as columns
    • ✓ Enhanced from_dataframe() to create float arrays from DataFrame columns
  2. Py_Mobilogram Class

    • ✓ New wrapper around MSChromatogram for mobilogram support
    • ✓ Pythonic properties: drift_time, intensity, mz, name
    • ✓ Statistical properties: total_ion_current, base_peak_drift_time, base_peak_intensity
    • ✓ Conversion methods: to_dataframe(), from_dataframe(), from_arrays()
    • ✓ Full metadata support via MetaInfoMappingMixin
    • ✓ Documentation note added about native OpenMS Mobilogram class
  3. Testing

    • ✓ 18 new tests covering all functionality
    • ✓ 93 total tests passing with 86% coverage
    • ✓ Tests for edge cases (wrong array length, empty mobilograms, round-trip conversions)
    • ✓ Integration tests verify all features work together
  4. Documentation

    • ✓ Updated README with ion mobility examples
    • ✓ Added Py_Mobilogram to API reference
    • ✓ Updated Py_MSSpectrum API documentation
    • ✓ Comprehensive code examples
    • ✓ Note about native OpenMS Mobilogram class
  5. Code Quality

    • ✓ All code formatted with black
    • ✓ No flake8 warnings
    • ✓ CodeQL security scan: 0 vulnerabilities
    • ✓ No breaking changes to existing API

Files Modified

  • openms_python/py_msspectrum.py - Added float data array and ion mobility support
  • openms_python/py_mobilogram.py - New file with Py_Mobilogram class
  • openms_python/__init__.py - Exported new Py_Mobilogram class
  • tests/test_py_msspectrum.py - Added 8 new tests for ion mobility features
  • tests/test_py_mobilogram.py - New test file with 10 tests for mobilograms
  • README.md - Added documentation and examples

Verification

  • ✓ All 93 tests passing
  • ✓ 86% code coverage
  • ✓ No security vulnerabilities
  • ✓ Integration tests confirm all features work correctly
  • ✓ Backward compatible - no breaking changes

Ready for Review

This PR is complete and ready for review. All requirements from the problem statement have been implemented with comprehensive testing and documentation.

Original prompt

Add support for the ion mobility dimension in the float data array, Add mobilogram support


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI self-assigned this Nov 19, 2025
@coderabbitai
Copy link

coderabbitai bot commented Nov 19, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


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

Copilot AI and others added 2 commits November 19, 2025 11:52
- Added float_data_arrays property to Py_MSSpectrum for accessing/setting float data arrays
- Added ion_mobility property for convenient access to ion mobility data
- Added drift_time property for spectrum-level drift time
- Updated to_dataframe() to include float data arrays as columns
- Updated from_dataframe() to create float data arrays from DataFrame columns
- Created Py_Mobilogram wrapper class for MSChromatogram (mobilograms)
- Added comprehensive tests for all new functionality
- All tests passing (93 tests, 86% coverage)

Co-authored-by: timosachsenberg <5803621+timosachsenberg@users.noreply.github.com>
Co-authored-by: timosachsenberg <5803621+timosachsenberg@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support for ion mobility dimension in float data array Add ion mobility support via float data arrays and mobilogram wrapper Nov 19, 2025
@timosachsenberg
Copy link
Contributor

@copilot add a note that a mobilogram class exists in OpenMS but might not yet be wrapped

@timosachsenberg timosachsenberg marked this pull request as ready for review November 19, 2025 12:03
Added documentation note that OpenMS C++ has a native Mobilogram class
that may not yet be wrapped in pyopenms, and this wrapper uses
MSChromatogram as the underlying representation.

Co-authored-by: timosachsenberg <5803621+timosachsenberg@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 19, 2025

@copilot add a note that a mobilogram class exists in OpenMS but might not yet be wrapped

Added documentation notes in both the module docstring and README explaining that OpenMS C++ has a native Mobilogram class that may not yet be wrapped in pyopenms, and that this wrapper uses MSChromatogram as the underlying representation. (da88471)

@timosachsenberg timosachsenberg merged commit 77f199b into master Nov 19, 2025
3 checks passed
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