Skip to main content
Topic: Not able to read a write.cdf() written NetCDF file (Read 8081 times) previous topic - next topic

Not able to read a write.cdf() written NetCDF file

Dear XCMS team,

first - thanks a lot for maintaining and further pushing this great piece of software!

However, I have ran into a problem regarding the compatibility of written CDF files, using the function write.cdf() .

If I read a file into an xcmsRaw object and output it via write.cdf() like
Code: [Select]
write.cdf(xcmsRaw("AnyFile.CDF"),file="AnyFile_2.CDF") 

I am able to read it back into xcms, plot it, peak pick it, etc. But I am not able to read it into any other programme such as ADMIS ("Cannot read header record in GC/MS data file"), ChemStation (... is not a compatible AIA file).

Using NetCDF as file format is vital as I need to read files into AMDIS (which doesn't support any XML formats). - Do you have any suggestions?

Many thanks,


Florian

Re: Not able to read a write.cdf() written NetCDF file

Reply #1
As far as I know, the cdf object written by write.cdf() can be read again only by xcms itself.
Other programs like AMDIS or OpenMS fails, because they have additional requirements for the generated cdf.

I'm not sure, if there was some progress in the xcms development, since the last time I checked.

Re: Not able to read a write.cdf() written NetCDF file

Reply #2
Hi Florian,

Quote from: "florian.geier"
...But I am not able to read it into any other programme such as ADMIS ("Cannot read header record in GC/MS data file"), ChemStation (... is not a compatible AIA file)"

I have extended the CDF export in xcms, could you try http://msbi.ipb-halle.de/~sneumann/ko16-xcms.cdf
and report if that works ? It loads in AMDIS without error, but doesn't look great. Can you check other programs ?

Yours,
Steffen
--
IPB Halle                          Mass spectrometry & Bioinformatics
Dr. Steffen Neumann         http://www.IPB-Halle.DE
Weinberg 3 06120 Halle     Tel. +49 (0) 345 5582 - 1470
sneumann(at)IPB-Halle.DE

Re: Not able to read a write.cdf() written NetCDF file

Reply #3
Dear Carsten, Dear Steffen,

thanks for helping!

@ Carsten: I already feared that. I had a look into the write.cdf() code and it writes much less variables than I would see via
Code: [Select]
cdf <- open.ncdf("ko16-xcms.cdf"); 

@ Steffen: I updated to 1.33.9 and even tried the SVN checkout. However, AMDIS will still not load created files. As I wrote above, I inspected the code and the only variables written into the new cdf are  "scan_acquisition_time, total_intensity, scan_index, total_intensity, mass_values, intensity_values". Have I missed something or is it possible that I still not have the "latest" release. 

Thanks so much for helping with this!

All the best from London,


Florian

Re: Not able to read a write.cdf() written NetCDF file

Reply #4
Hi Florian,

no, I hadn't committed the code before it worked with AMDIS,
(which I discovered runs under wine), but I have now as 1.33.10.

You get a very strange straight linear TIC. If you have any idea what's
wrong with the written CDF, I am all ears.

Yours,
Steffen
--
IPB Halle                          Mass spectrometry & Bioinformatics
Dr. Steffen Neumann         http://www.IPB-Halle.DE
Weinberg 3 06120 Halle     Tel. +49 (0) 345 5582 - 1470
sneumann(at)IPB-Halle.DE

Re: Not able to read a write.cdf() written NetCDF file

Reply #5
Hi Florian,

did you check, and do you have an idea what's missing ?

Yours,
Steffen
--
IPB Halle                          Mass spectrometry & Bioinformatics
Dr. Steffen Neumann         http://www.IPB-Halle.DE
Weinberg 3 06120 Halle     Tel. +49 (0) 345 5582 - 1470
sneumann(at)IPB-Halle.DE

Re: Not able to read a write.cdf() written NetCDF file

Reply #6
Hi Florian,

I have now committed xcms-1.33.13 which should fix the CDF export
so that AMDIS can read it. At least it works for

Code: [Select]
library(xcms)
xr <- xcmsRaw("ko16.cdf")
write.cdf(xr, file="ko16-xcms.cdf")

which you also find at http://msbi.ipb-halle.de/~sneumann/ko16-xcms.cdf

Does it work for you now ?

Yours,
Steffen
--
IPB Halle                          Mass spectrometry & Bioinformatics
Dr. Steffen Neumann         http://www.IPB-Halle.DE
Weinberg 3 06120 Halle     Tel. +49 (0) 345 5582 - 1470
sneumann(at)IPB-Halle.DE