I need to know the positions of the MS/MS precursors found in a mzML file, using pymzml as a parser. Looking at the precursors with this code:
import pymzml
file = '/homes/ndeklein/EP-B1.mzML'
msrun = pymzml.run.Reader(file)
for spectrum in msrun:
if spectrum['ms level'] == 2:
print spectrum["precursors"].keys()
sys.exit()
only gives 'charge' and 'mz' as keys. Looking at the spectra:
file = '/homes/ndeklein/EP-B1.mzML'
msrun = pymzml.run.Reader(file)
for spectrum in msrun:
if spectrum['ms level'] == 2:
print spectrum.keys()
sys.exit()
gives the following keys:
'no compression', 'total ion current', 'scan time', 'filter string', 'PY:0000000', 'precursors', 'MS:1000041', 'id', 'MS:1000285', 'MS:1000512', 'MS:1000511', 'MS:1000576', 'collision-induced dissociation', 'MS:1000744', 'MS:1000514', '64-bit float', 'defaultArrayLength', 'MS:1000127', 'm/z array', 'MS:1000515', 'centroid mass spectrum', 'None', 'ms level', 'intensity array', 'BinaryArrayOrder', '32-bit float', 'MS:1000016', 'encodedData', 'MS:1000523', 'MS:1000521', 'MS:1000133', 'charge state'
At none of these can I find the retention time. Where can I get this from?
Thanks, Niek
The update is the right answer.