Closed sorenwacker closed 1 year ago
Hi, that was my answer, so I approve it :)
The XML parsing API is very simple, you have a single class which by default reads spectra (in this case MzML
), and a workhorse method, iterfind
, which does all the work. When you need to read something that is not part of the spectrum data, you just call it directly with the name of the element that you need.
In this case it will save you a lot of time to pass recursive=False
, because the run
element actually contains all the spectra within it, so you don't want iterfind
to parse all of the spectra and then immediately discard them.
The code above with recursive=False
should be fast enough, and I don't think there is a way to do it faster. In terms of the length of code, there are no shortcuts for this, but you are free to use this code to define your own function.
That is funny, I did not notice it was you. Thank you!
Hi,
I opened this question on bioinformatics.stackexchange and one user suggested
I wonder if there is a better way to extract the datestamp of data acquisition with pyteomics?