Skip to content

'pyopenms.pyopenms_4.PeptideAndProteinQuant' object has no attribute 'getPeptideResults' #5657

Closed

Description

@zhuchcn

getPeptideResults isn't accessible from PeptideAndProteinQuant, but it seems like a public method.

from pyopenms import PeptideAndProteinQuant
PeptideAndProteinQuant().getPeptideResults()

Error:

AttributeError: 'pyopenms.pyopenms_4.PeptideAndProteinQuant' object has no attribute 'getPeptideResults'

Is it possible to make it available? We would like to only get the peptide quantification but not protein, so if getPeptideResults is available, we can directly call quantifyPeptide from python and save it. Unless there is a better way of doing it. Btw, getProteinResults is also not available from pyopenms.

Activity

  1. timosachsenberg commented on Nov 16, 2021

    @timosachsenberg
    Contributor

    Hi, that would indeed be a good to have in pyOpenMS.

    Looking at the code someone already tried to wrap it:

    # ctypedef libcpp_map<String, ProteinData] ProteinQuant
    # ctypedef libcpp_map<AASequence, PeptideData] PeptideQuant
    # PeptideQuant getPeptideResults() nogil except +
    # ProteinQuant getProteinResults() nogil except +

    I guess it was not successful because the key is a AASequence object which probably needs special treatment on the wrapper side. @hroest can you take a brief look at that?

  2. jpfeuffer commented on Feb 7, 2022

    @jpfeuffer
    Contributor

    Yes, currently not both key and value can be user-defined/wrapped classes.
    We need to investigate why autowrap has this limitation.
    For just outputting to pyopenms we should just write an overload that returns std::strings as keys for those methods

  3. hroest commented on Feb 17, 2022

    @hroest
    Contributor

    @jpfeuffer the limitation is simply that its not implemented:

    https://github.com/OpenMS/autowrap/blob/84e19fb094d628a7446120873c6819e79296bb3c/autowrap/ConversionProvider.py#L787-L790

    what does work is libcpp_map[libcpp_string, ProteinData] while libcpp_map[AASequence, PeptideData] wont work

  4. hroest commented on Feb 17, 2022

    @hroest
    Contributor

    @jpfeuffer this PR fixes this issue and should allow such wrapping of std::map<Widget, Widget>: OpenMS/autowrap#124

  5. jpfeuffer commented on Apr 28, 2022

    @jpfeuffer
    Contributor

    Unfortunately the PR wasn't complete. We need to wait for a fix of OpenMS/autowrap issue 143

  6. github-actions commented on Dec 21, 2025

    @github-actions
    Contributor

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

  7. added a commit that references this issue on Jan 4, 2026
    441d571
  8. timosachsenberg commented on Jan 17, 2026

    @timosachsenberg
    Contributor

    Should be possible noew

  9. added 3 commits that reference this issue on Mar 9, 2026
    09c3da1
    4b3626b
    f752952
  10. added a commit that references this issue on Mar 16, 2026
    819795d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions