rformassspectrometry / Spectra

Low level infrastructure to handle MS spectra
https://rformassspectrometry.github.io/Spectra/
34 stars 24 forks source link

Import mspLib format #294

Closed Slycopersicum closed 1 year ago

Slycopersicum commented 1 year ago

Hi, I have some problems importing mspLib format, using the default parameters or adding the flavor "mona", RT and Mzprecursor disapear. I have waters data (mse centroid), I use xcms and after I deconvoluted the ms2 data with RamclustR. My question is that is any possibility to convert the object created (hclust object) to a Spectra object. So I can integrate three 3 packages.

Thanks

jorainer commented 1 year ago

If I understand correctly, this issue seems more related to MsBackendMsp. Note that it is also possible to define your own mapping of fields in the MSP file to spectra variables using the mapping parameter from that backend. Can you eventually provide one of the files you fail to import correctly?

Slycopersicum commented 1 year ago

Hi Johannes, I was playing around with the ramclustr object and I get an msp file with all the info I need. But I lose the first letter o number of each column when I imported with spectra. For example compound C001, get imported as 001 or the precursor Mz goes from 220 to 20. How can I share with you the data?

jorainer commented 1 year ago

hm - it's odd that the first letter does not get correctly imported. For sharing, could you maybe provide a subset of the msp (just maybe data for 1-2 spectra) with this issue here (dragging and dropping the file into the comment should upload it to github).

Slycopersicum commented 1 year ago

Sorry for the late answer. It was a silly error, after each : need a space, so a change the function that write the msp object. Thanks for your time