Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example results in error #52

Open
LLautenbacher opened this issue Jan 27, 2025 · 0 comments
Open

Example results in error #52

LLautenbacher opened this issue Jan 27, 2025 · 0 comments

Comments

@LLautenbacher
Copy link

Hi, thank you for preparing this package! When I tried to use the example from https://rustyms.readthedocs.io/en/stable/. It results in this error. I used version rustyms==0.9.0.

import rustyms

# Create a new spectrum
raw_spectrum = rustyms.RawSpectrum(
    title="spectrum_1",
    num_scans=6,
    rt=10,
    precursor_mass=436.12634,
    precursor_charge=2,
    mz_array=[72.04444, 148.06048, 175.05362, 263.08742, 290.08056, 366.09661],
    intensity_array=[100, 600, 300, 400, 500, 200],
)

# Create a new peptide from a ProForma 2.0 string
peptide = rustyms.LinearPeptide("ACDE/2")

# Annotate the spectrum with the peptide
annotated_spectrum = raw_spectrum.annotate(peptide, "cid_hcd")
TypeError                                 Traceback (most recent call last)
Cell In[3], [line 18](vscode-notebook-cell:?execution_count=3&line=18)
     [15](vscode-notebook-cell:?execution_count=3&line=15) peptide = rustyms.LinearPeptide("ACDE/2")
     [17](vscode-notebook-cell:?execution_count=3&line=17) # Annotate the spectrum with the peptide
---> [18](vscode-notebook-cell:?execution_count=3&line=18) annotated_spectrum = raw_spectrum.annotate(peptide, "cid_hcd")

TypeError: argument 'peptide': 'LinearPeptide' object cannot be converted to 'CompoundPeptidoform'
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

No branches or pull requests

1 participant