pymzml / pymzML

pymzML - an interface between Python and mzML Mass spectrometry Files
https://pymzml.readthedocs.io/en/latest/
MIT License
163 stars 92 forks source link

centroidedPeaks() throws an IndexError with some mzML files #18

Closed ajmazurie closed 10 years ago

ajmazurie commented 10 years ago

I've been using pymzML extensively over the last few months without problems. Recently I have been processing mzML files converted from data collected on an older machine (Agilent 6430, from 2009) and got the following when attempting to extract centroided peaks:

Traceback (most recent call last):
  File "../../../tools/rtms-extract-masses", line 182, in <module>
    for mz, intensity in spectrum.centroidedPeaks:
  File "/Users/ajmazurie/.pyenv/versions/2.7.6/lib/python2.7/site-packages/pymzml/spec.py", line 420, in centroidedPeaks
    self._centroidedPeaks = self._centroid_peaks()
  File "/Users/ajmazurie/.pyenv/versions/2.7.6/lib/python2.7/site-packages/pymzml/spec.py", line 474, in _centroid_peaks
    x3  = mz_array[pos+7]
IndexError: tuple index out of range

The same code works flawlessly with data obtained from a more recent machine (e.g., Agilent 6520). Is there anything that could be done to fix this issue?

Best, Aurelien

fu commented 10 years ago

Fixed this error. Thanks for the feedback!

ajmazurie commented 10 years ago

Ouch. It seems that I get a similar error in the same place:

Traceback (most recent call last):
  File "/Volumes/Magenta/workspace/BrianBothner_FlowSpectrometry/Runs/tools/rtms-extract-masses", line 200, in <module>
    for mz, intensity in spectrum.centroidedPeaks:
  File "/Users/ajmazurie/.pyenv/versions/2.7.6/lib/python2.7/site-packages/pymzml/spec.py", line 428, in centroidedPeaks
    self._centroidedPeaks = self._centroid_peaks()
  File "/Users/ajmazurie/.pyenv/versions/2.7.6/lib/python2.7/site-packages/pymzml/spec.py", line 490, in _centroid_peaks
    x3  = mz_array[ upper_pos ]
IndexError: tuple index out of range
fu commented 10 years ago

Hmm worked with me. I'll check if I have commit everything:) ups otherwise

Cheers

C

On 24.05.2014, at 07:35, Aurélien Mazurie, Ph.D. notifications@github.com wrote:

Ouch. It seems that I get a similar error in the same place:

Traceback (most recent call last): File "/Volumes/Magenta/workspace/BrianBothner_FlowSpectrometry/Runs/tools/rtms-extract-masses", line 200, in for mz, intensity in spectrum.centroidedPeaks: File "/Users/ajmazurie/.pyenv/versions/2.7.6/lib/python2.7/site-packages/pymzml/spec.py", line 428, in centroidedPeaks self._centroidedPeaks = self._centroid_peaks() File "/Users/ajmazurie/.pyenv/versions/2.7.6/lib/python2.7/site-packages/pymzml/spec.py", line 490, in _centroid_peaks x3 = mz_array[ upper_pos ] IndexError: tuple index out of range — Reply to this email directly or view it on GitHub.

fu commented 10 years ago

Hmm,

Is that the same mzml? If not can you mail/post me the file?

Cheers C

On 24.05.2014, at 07:35, Aurélien Mazurie, Ph.D. notifications@github.com wrote:

Ouch. It seems that I get a similar error in the same place:

Traceback (most recent call last): File "/Volumes/Magenta/workspace/BrianBothner_FlowSpectrometry/Runs/tools/rtms-extract-masses", line 200, in for mz, intensity in spectrum.centroidedPeaks: File "/Users/ajmazurie/.pyenv/versions/2.7.6/lib/python2.7/site-packages/pymzml/spec.py", line 428, in centroidedPeaks self._centroidedPeaks = self._centroid_peaks() File "/Users/ajmazurie/.pyenv/versions/2.7.6/lib/python2.7/site-packages/pymzml/spec.py", line 490, in _centroid_peaks x3 = mz_array[ upper_pos ] IndexError: tuple index out of range — Reply to this email directly or view it on GitHub.

ajmazurie commented 10 years ago

No, it's a different .mzML file. I'll send it to you by email today. Aurélien

fu commented 10 years ago

Hi Aurélien,

I am in a conference right now, but I'll be back @ Friday.

Let me get back to you then, ok?

Cheers,

.c

On 03.06.2014, at 21:19, Aurélien Mazurie, Ph.D. notifications@github.com wrote:

No, it's a different .mzML file. I'll send it to you by email today. Aurélien

— Reply to this email directly or view it on GitHub.

fu commented 10 years ago

Fixed it now :) Thanks for the feedback!

ajmazurie commented 10 years ago

Thanks! It appears to work perfectly now. Aurélien