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

pulling spectrum numbers caused a problem, Exception( Exception: Spectrum ID should be between 1 and 1), [Warning] Not index found and build_index_from_scratch is False #358

Closed
mremachine1 opened this issue Apr 8, 2024 · 2 comments

Comments

@mremachine1
Copy link

Describe the bug
first on some random mzml files (i assume it isnt random), i received the following warning upon instantiating a reader object.
[Warning] Not index found and build_index_from_scratch is False
then upon trying to call a particular spectrum id ie object[spectrum id] i received the following exception:
Exception( Exception: Spectrum ID should be between 1 and 1)
the object and the file it came from hold spectrums above one and so i am confused (i have both tried the object intially and with build_index_from_scratch both come up with a 1 to 1 spectrum. any help would be appreciated.

To Reproduce

import pymzml
new_path = "X:\JS\Adductomics\BariatricStudy\DIAumpire\"
new_fh = new_path + "JS-CS_LI_221120_GroopmanJ_JS_PAA_3_P3_C_correct_Q2.mzML"
test_mzml = pymzml.run.Reader(new_fh)
[Warning] Not index found and build_index_from_scratch is False
test_mzml = pymzml.run.Reader(new_fh, build_index_from_scratch=True)
data = test_mzml[1944]
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\Cole Lab\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\pymzml\run.py", line 201, in getitem
spectrum = self.info["file_object"][identifier]
~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
File "C:\Users\Cole Lab\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\pymzml\file_interface.py", line 106, in getitem
return self.file_handler[identifier]
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
File "C:\Users\Cole Lab\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\pymzml\file_classes\standardMzml.py", line 123, in getitem
spectrum = self._binary_search(identifier)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Cole Lab\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\pymzml\file_classes\standardMzml.py", line 155, in _binary_search
raise Exception(
Exception: Spectrum ID should be between 1 and 1

Expected behavior

import pymzml
new_path = "X:\JS\Adductomics\BariatricStudy\DIAumpire\"
new_fh = new_path + "JS-CS_LI_221120_GroopmanJ_JS_PAA_3_P3_C_correct_Q2.mzML"
test_mzml = pymzml.run.Reader(new_fh)
[Warning] Not index found and build_index_from_scratch is False
test_mzml = pymzml.run.Reader(new_fh, build_index_from_scratch=True)
data = test_mzml[1944]

data holds spectrum info

Desktop (please complete the following information):

  • OS: windowss
  • 12
@Schulze-lab
Copy link

This is the same issue as #357 , right?

@mremachine1
Copy link
Author

duplicate

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

2 participants