readMSData and netCDF files, how to set polarity ?
1
1
Entering edit mode
@julienkermorvant-23634
Last seen 4.5 years ago

Hello,

I have XMS data files from a Scion GC-MS that I converted in netCDF. I would like to do some data preprocessing before any statistical analysis by using MSnbase and XCMS libraries.

When I use the readMSData from MSnbase on my CDF files, I get this warning: "Polarity can not be extracted from netCDF files, please set manually the polarity with the 'polarity' method." I thought at first that I could set the polarity in the object afterwards but the function get stuck at this step.

If someone have a solution for that or to convert my XMS files into the recommended mzXML format, thank you.

Best regards, Julien Kermorvant

MSnbase • 2.6k views
ADD COMMENT
4
Entering edit mode
Johannes Rainer ★ 2.1k
@johannes-rainer-6987
Last seen 8 weeks ago
Italy

Dear Julien,

firstly, polarity is not really required for xcms data analysis, you should just make sure to just analyze samples measured with the same polarity. If you want to set the polarity you could do that with:

fData(data)$polarity <- 0L

Where data is the object you got from readMSData. The polarity encoding is 0L for negative polarity, 1L for positive polarity.

cheers, jo

ADD COMMENT
0
Entering edit mode

Dear Johannes,

Thank you for your quick answer.

I tried to read only one of my files and it is working fine, it took about 10 or 15 minutes though. I'm currently trying to read all my 50 files and it is not finished yet, I checked the performances of my computer and it use only a third of it's capacity and I still have free memory.

Is there any parameter to accelerate the reading ? I'm already using the "inMemory" mode.

Best regards, Julien Kermorvant

ADD REPLY
2
Entering edit mode

Note that xcms does not support analyzing in-memory data. If you plan to use xcms I suggest you use the mode = "onDisk" - which is also much faster because it does not import all the spectra data into memory (and later xcms will allow you to process the files in parallel).

ADD REPLY
0
Entering edit mode

Thank you a lot, it does work a lot faster. I can finally start working on my data.

Best regards, Julien

ADD REPLY
1
Entering edit mode

In addition to Jo's comment regarding in-memory vs on-disk reading times, you can find a short benchmark here and a more extensive one in the latest MSnbase pre-print.

ADD REPLY
0
Entering edit mode

Thank you, it's very interesting!

Best regards, Julien

ADD REPLY

Login before adding your answer.

Traffic: 535 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6