spectrum_utils icon indicating copy to clipboard operation
spectrum_utils copied to clipboard

loading spectrum by usi can't find m/z

Open wsnoble opened this issue 2 years ago • 0 comments

I am loading a spectrum by USI like this

usi = "mzspec:PXD031817:MSB19717Trypsin021915:scan:1930"
spectrum = spectrum_utils.spectrum.MsmsSpectrum.from_usi(usi)

but I get this error:

Traceback (most recent call last):
  File "./plot-annotated-spectrum.py", line 30, in <module>
    spectrum = spectrum_utils.spectrum.MsmsSpectrum.from_usi(usi)
  File "/net/noble/vol1/home/noble/miniconda3/envs/spectrum_utils/lib/python3.8\
/site-packages/spectrum_utils/spectrum.py", line 345, in from_usi
    raise ValueError(
ValueError: Unknown precursor m/z from USI. Specify the precursor m/z directly.

If I download the file and convert to MGF, that spectrum looks like this:

BEGIN IONS
TITLE=controllerType=0 controllerNumber=1 scan=1930
SCANS=1930
RTINSECONDS=769.87164
PEPMASS=384.879058837891
CHARGE=3+
101.0714035 1807.1617431641
110.0717926 183053.5468750000
111.0751266 8941.6181640625
112.0874252 1604.1121826172
...

It has the peptide mass and the charge. Why can't it figure out the m/z?

wsnoble avatar Oct 21 '22 02:10 wsnoble