compomics / ms2pip

MS²PIP: Fast and accurate peptide spectrum prediction for multiple fragmentation methods, instruments, and labeling techniques.
https://ms2pip.readthedocs.io
Apache License 2.0
35 stars 18 forks source link

No plot while using ms2pip-single-prediction due to some spectrum_utils.spectrum issue #182

Closed MatteoLacki closed 1 year ago

MatteoLacki commented 1 year ago

Hi!

Just trying to run the standard example, but likely there is some incompatibilty between versions

ms2pip-single-prediction -o prediction.png PGAQANPYSR "-" 3
Downloading model_20210416_HCD2021_B.xgboost to /home/matteo/.ms2pip/model_20210416_HCD2021_B.xgboost...
Downloading model_20210416_HCD2021_Y.xgboost to /home/matteo/.ms2pip/model_20210416_HCD2021_Y.xgboost...
Traceback (most recent call last):
  File "/home/matteo/Projects/MIDIA/veMIDIA/bin/ms2pip-single-prediction", line 8, in <module>
    sys.exit(_main())
  File "/home/matteo/Projects/MIDIA/veMIDIA/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/home/matteo/Projects/MIDIA/veMIDIA/lib/python3.10/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/home/matteo/Projects/MIDIA/veMIDIA/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/matteo/Projects/MIDIA/veMIDIA/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/home/matteo/Projects/MIDIA/veMIDIA/lib64/python3.10/site-packages/ms2pip/single_prediction.py", line 308, in _main
    ms2pip_sp.plot_prediction(
  File "/home/matteo/Projects/MIDIA/veMIDIA/lib64/python3.10/site-packages/ms2pip/single_prediction.py", line 191, in plot_prediction
    sus_annotation = self._get_sus_annotation(mz, annotation)
  File "/home/matteo/Projects/MIDIA/veMIDIA/lib64/python3.10/site-packages/ms2pip/single_prediction.py", line 255, in _get_sus_annotation
    return [
  File "/home/matteo/Projects/MIDIA/veMIDIA/lib64/python3.10/site-packages/ms2pip/single_prediction.py", line 256, in <listcomp>
    sus.PeptideFragmentAnnotation(1, mz, annotation[0], annotation[1:])
AttributeError: module 'spectrum_utils.spectrum' has no attribute 'PeptideFragmentAnnotation'

Here is the pip freeze from my virtualenv:

appdirs==1.4.4
biopython==1.79
click==8.1.3
contourpy==1.0.5
cycler==0.11.0
fastobo==0.12.1
fonttools==4.37.4
greenlet==1.1.3
kiwisolver==1.4.4
lark==1.1.2
llvmlite==0.39.1
matplotlib==3.6.1
ms2pip==3.9.0
numba==0.56.2
numexpr==2.8.3
numpy==1.23.3
packaging==21.3
pandas==1.5.0
Pillow==9.2.0
pyparsing==3.0.9
pyteomics==4.5.5
python-dateutil==2.8.2
pytz==2022.4
scipy==1.9.2
six==1.16.0
spectrum-utils==0.4.0
SQLAlchemy==1.4.41
tables==3.7.0
tomlkit==0.11.5
tqdm==4.64.1
xgboost==1.6.2
RalfG commented 1 year ago

Hi @MatteoLacki,

This issue arises due to changes in the latest 0.4.0 version of spectrum_utils. You can fix it by downgrading spectrum_utils to 0.3.5:

pip install spectrum-utils==0.3.5

In the upcoming version of MS²PIP we have pinned the spectrum_utils version requirement (part of PR #186), until we can implement its latest changes.

Best, Ralf