You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
importrustyms# Create a new spectrumraw_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 stringpeptide=rustyms.LinearPeptide("ACDE/2")
# Annotate the spectrum with the peptideannotated_spectrum=raw_spectrum.annotate(peptide, "cid_hcd")
TypeErrorTraceback (mostrecentcalllast)
CellIn[3], [line18](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'objectcannotbeconvertedto'CompoundPeptidoform'
The text was updated successfully, but these errors were encountered:
I will update the example, thank you for opening the issue. The issue here is that since 0.9 the spectrum annotation has to be done with a CompoundPeptidoform. To get your code running the easiest is to create one instead on a linear peptide rustyms.CompoundPeptidoform("ACDE/2"). I will look into how I can make the API easier to use, maybe I can make it so that any peptide like object will work.
I am not sure if I can get nice behaviour where the annotate function accepts any of the three peptidoform types. It looks like getting this to work in pyO3 is somewhat more involved then I hoped. I will keep my eyes peeled for a solution though. Otherwise I updated the documentation so with the next release it will be fixed.
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
.The text was updated successfully, but these errors were encountered: