Repository navigation
Expose getPeptideResults and getProteinResults in pyOpenMS - #8543
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Comment |
|
@copilot don’t change the c++ api! Why should this be necessary? Perform a deeper research how this works in OpenMS |
You're right! I've reverted the C++ API changes. The solution now follows the existing pattern used in OpenMS (like ConsensusMap.getColumnHeaders):
No C++ changes needed. Commit: 7f13831 |
|
@copilot Shouldn't using strings a key already work in autowrap 0.24 ? |
You're absolutely right! I've updated the implementation to use autowrap 0.24's native support for
Much cleaner approach. Commit: 8e83b43 |
|
What happened with the autowrap PR for maps of wrapped classes? The only problem was missing hashes or warnings if a custom hash does not exist and I think you fixed most of that. |
|
I think it already works |
|
Yeah and you can merge it but you don't want to do this for every map manually of it comes up again. |
|
Aaah sorry. There is no pyx. Then the OP description is just outdated |
|
Ah ok I updated the the comment on the top. |
441d571 to
09c3da1
Compare
09c3da1 to
4b3626b
Compare
…bind bindings Add nanobind bindings for PeptideAndProteinQuant methods: - getPeptideResults(): returns dict mapping AASequence to PeptideData - getProteinResults(): returns dict mapping protein accession to ProteinData - No-arg quantifyPeptides() and quantifyProteins() overloads Includes comprehensive Python tests with FeatureMap and ConsensusMap input data. Resolves #5657. Co-Authored-By: Claude Opus 4.6 <[email protected]>
4b3626b to
f752952
Compare
nanobind's String type caster converts OpenMS::String to Python str, not bytes. Fix all dict key lookups and setValue calls accordingly. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Add missing changelog entries for changes merged in the past 7 days: - PyOpenMS: PeptideAndProteinQuant.getPeptideResults/getProteinResults exposed (#8543) - PyOpenMS BREAKING: zero-copy _mv methods renamed to _view (#8857) - TOPP BREAKING: FeatureFinderMultiplex/MultiplexResolver parameter missed_cleavages renamed to max_nr_labelled_aas (#8911) - TOPP: MaRaClusterAdapter annotates consensus spectra with native IDs and cluster metadata (#8864) - TOPP: MetaboliteAdductDecharger adds multimer detection (#8888) - OpenMS Library BREAKING: ChromatogramPeak::IntensityType changed double -> float (#8857) - Build: CMake 4.x compat fix for Windows packaging (#8880) - Build: Fix pyOpenMS dev build RPATH (#8892) - Build: Correctly locate locally installed nanobind (#8874) Co-authored-by: Copilot <[email protected]>
Add missing changelog entries for changes merged in the past 7 days: - PyOpenMS: PeptideAndProteinQuant.getPeptideResults/getProteinResults exposed (#8543) - PyOpenMS BREAKING: zero-copy _mv methods renamed to _view (#8857) - TOPP BREAKING: FeatureFinderMultiplex/MultiplexResolver parameter missed_cleavages renamed to max_nr_labelled_aas (#8911) - TOPP: MaRaClusterAdapter annotates consensus spectra with native IDs and cluster metadata (#8864) - TOPP: MetaboliteAdductDecharger adds multimer detection (#8888) - OpenMS Library BREAKING: ChromatogramPeak::IntensityType changed double -> float (#8857) - Build: CMake 4.x compat fix for Windows packaging (#8880) - Build: Fix pyOpenMS dev build RPATH (#8892) - Build: Correctly locate locally installed nanobind (#8874) Co-authored-by: Copilot <[email protected]> Co-authored-by: Copilot <[email protected]>
This pull request adds and tests support for automatic conversion of C++ STL container types (such as
libcpp_map,libcpp_vector, andlibcpp_set) in the pyOpenMS Python bindings, specifically for thePeptideAndProteinQuantclass. The main focus is enabling direct access to peptide and protein quantification results as Python dictionaries, with proper object wrapping for both keys and values. Comprehensive unit tests and sample input files are also introduced to ensure correctness and address a previously reported issue.Container Type Support and PyOpenMS API Improvements:
README_WRAPPING_NEW_CLASSES) to describe new autowrap support for automatic conversion of STL containers, allowing methods returninglibcpp_map,libcpp_vector, andlibcpp_setto be exposed as native Python types (dict, list, set). This also documents support for maps with OpenMS class keys and values, requiring no manual addon code.PeptideAndProteinQuant.pxdCython declaration to exposegetPeptideResults()andgetProteinResults()as returninglibcpp_map[AASequence, PeptideData]andlibcpp_map[String, ProteinData]respectively, enabling their direct use as Python dictionaries with appropriate key and value types. [1] [2]Testing and Validation:
test_PeptideAndProteinQuant.pythat verifies the correct exposure and behavior ofgetPeptideResults()andgetProteinResults(), including checking key types, value contents, and statistics. This ensures that the new container conversion functionality works as expected and resolves GitHub issue 'pyopenms.pyopenms_4.PeptideAndProteinQuant' object has no attribute 'getPeptideResults' #5657.ProteinQuantifier_input.featureXMLandProteinQuantifier_input.consensusXML) for use in the unit tests, providing realistic data for peptide and protein quantification scenarios. [1] [2]