pymzML icon indicating copy to clipboard operation
pymzML copied to clipboard

How to retrieve 'inverse reduced ion mobility' info?

Open patrick-willems opened this issue 2 years ago • 3 comments

Best,

I just started to use pymzml to retrieve spectral info, I find it a great tool!

I only do not manage to easily extract ion mobility from the data, for me this is for instance present as follows in the mzML file:

      <scanList count="1">
        <scan>
          <cvParam cvRef="MS" accession="MS:1000016" name="scan start time" value="0.01271000038832426" unitCvRef="UO" unitAccession="UO:0000031" unitName="minute"/>
          <cvParam cvRef="MS" accession="MS:1002815" name="inverse reduced ion mobility" value="1.0686218738555908"/>

How can I extract this when looping over the spectra (i.e. 'for index, spectrum in enumerate(data):' ) ?

Many thanks in advance, Patrick

patrick-willems avatar Oct 15 '23 19:10 patrick-willems

Hi Patrick,

Can you try something like this:

for index, spectrum in enumerate(data):
    im = spectrum['inverse reduced ion mobility']

You could also have a look if the get_tims_tof_ion_mobility or get_array method of the spectrum class would be helpfull, for this you would need the IM array in the spectrum, I think you can achieve this while converting to mzML.

Best, Manu

MKoesters avatar Oct 16 '23 19:10 MKoesters

Just as a quick addition: There were some issues with using the GO terms, so if 'inverse reduced ion motility' is not recognized, you might want to try using the accession number, i.e. spectrum['MS:1002815'] to access that information.

StSchulze avatar Oct 16 '23 19:10 StSchulze

Thanks!

patrick-willems avatar Oct 19 '23 11:10 patrick-willems