mhoopmann / mstoolkit

Automatically exported from code.google.com/p/mstoolkit
27 stars 11 forks source link

FR: Ion mobility support? #22

Open rickhelmus opened 8 months ago

rickhelmus commented 8 months ago

Hello,

While looking for options to load mzML files from C/C++ I stumbled upon MSToolKit :-)

There seems some ion mobility support in mzParser, but his seems unused at the moment in MSToolKit. I was wondering if adding support to load IMS data is something on the radar?

Thanks, Rick

mhoopmann commented 8 months ago

Hi Rick,

I can certainly help build out that support. Do you have some example mzML data to share and an idea of what you need parsed out from it?

Cheers, Mike

rickhelmus commented 8 months ago

Hi Mike,

Thanks for your quick reply, and great to hear you want to help out.

Currently, I'm mainly interested in processing timsTOF data. Here a typical file seems to add a third binary data array (MS:1003006), which represents the mobility for each mass peak. Normally the files are huge, but I made a small subset here: 20220923_TIMS03_PaSk_SA_4prot_200fmol_Evo05_3min_IM0713_classical_SyS_4MS_wCE_S4-G3_1_32594.mzML.gz (the original file comes from here, which I converted with msConvert).

Later on I would also be able to handle IMS data from other instruments. I don't have much experience with that yet, but looking at an Agilent file it seems each spectrum is tagged with a mobility (MS:1002476) instead of adding an extra dimension. An example file can be found here: https://massive.ucsd.edu/ProteoSAFe/dataset_files.jsp?task=749e436db868410383159b450b470eff#%7B%22table_sort_history%22%3A%22main.collection_asc%22%7D

It would be great if it would be possible to load the raw MS spectra with mobility data from both formats.

Thanks, Rick

mhoopmann commented 8 months ago

Hi Rick, I put in a small update to get you started. It should work for TimsTOF data. The Spectrum object contains a new function Spectrum::getInverseReducedIonMobility() which should return a non-zero value when the spectrum contains ion mobility data. To get at the ion mobility values, use Spectrum::atIM(size_t index), where the dimensions of the ion mobility array fall under Spectrum::size().

I'll probably need more time to extend the new functionality to non-TimsTOF data. Also, I haven't implemented the ion mobility functionality to mzMLb data yet, but that is also on the list. I'll post another update when these features are finished. Cheers, Mike

rickhelmus commented 8 months ago

Hi Mike,

This is really great, many thanks! All seems to work well with a small toy example. Looking forward to integrate this further later :-) I'm wondering now what the values mean what getInverseReducedIonMobility() return, but this is just a curiousity and maybe only Bruker can answer that.

I hadn't even thought about mzMLb support, but now I'm quite curious how that would perform.

Anyway, thanks again, and looking forward to your next update!