pymzml / pymzML

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

Issue with Adding Spectra #274

Closed fa-2000 closed 2 years ago

fa-2000 commented 2 years ago

`import pymzml

s = pymzml.spec.Spectrum()

file_to_read = r'C:\file'

run = pymzml.run.Reader( file_to_read, MS1_Precision = 5e-6 , MSn_Precision = 20e-6 )

for spec in run: s += spec`

When I try to run the above code, I get an error : AttributeError: 'numpy.ndarray' object has no attribute 'items'

The file I am working with contains forty individual scans that I want to average into one spectrum.

MKoesters commented 2 years ago

Hi @fa-2000 .

Thnaks for using pymzML! I just tried your code with one of our example files and could not reproduce the error.

Could you give me some information about your mzML file? What instrument are you using and do you have centroided or profile data? If you would be able upload the mzML, that would help a lot, else I'll try to reproduce the issue locally somehow.

Best, Manuel

MKoesters commented 2 years ago

Closing for now, if this is still an issue, feel free to reopen