Closed fkromer closed 5 years ago
Hey,
thanks for reporting this issue.
I think this feature was developed for mzML files containing only chromatograms, at least it was implemented like this since v0.7.9
Since your files probably contains spectra, _init_iter
finds the spectrum list and then stops parsing, else we would need to parse the whole file down to the chromatogram list.
In files without spectra and only chromatograms this method works fine.
To 'fix' this, I would set the 'chromatogram_count' to None in the beginning and let it be overwritten if the file happens to be a chromatogram only file.
I'll push a fix later this day and may think about a more clever solution to find the chromatogram count without parsing the whole file.
Best, Manuel
Hi Manuel,
thanks for the fast response. The files I will be dealing with won't contain chromatograms. I used the file in the examples for evaluation of and playing around with pymzml functionality. I do not need a fast fix.
Best, Florian
Describe the bug
pymzml.run.Reader.get_chromatogram_count() throws a
KeyError KeyError: 'chromatogram_count'
when I try to get the chromatogram count for the exemplary data tests/data/example.mzML.To Reproduce
With the data file data example.mzML in the same directory as a Jupyter notebook with following cell:
throws
Expected behavior
Either (a) count of chromatograms or (b) human readable exception message about API miss-use.
Screenshots
n.a.
Desktop (please complete the following information):
latest-py3-jupyter
pymzml==2.4.0
Additional context
n.a.