sneumann / xcms

This is the git repository matching the Bioconductor package xcms: LC/MS and GC/MS Data Analysis
Other
183 stars 80 forks source link

Polarity cannot be extracted #686

Open crestre opened 1 year ago

crestre commented 1 year ago

Please I need some help. I am learning xcms through your vignette (LCMS data preprocessing and analysis with xcms) using version 3.22. When I run the readMSData I get a message "Polarity cannot be extracted from netCDF files, please set manually the 'polarity method. Please could you indiate 1) how to do so and 2) what is the polarity of the data?

Thanks

crestre commented 1 year ago

I am curious about something. You use the faahko data (.cdf). What would you use to convert it mzXML to use with your tutorials?

jorainer commented 1 year ago

Regarding the message "Polarity cannot be extracted ..." - that is not an error but a simple information message. In fact polarity is not stored in CDF files, but usually, this information is also not required for xcms-based data analysis.

jorainer commented 1 year ago

to convert CDF to mzML files - you could do that directly in R: the code below converts the CDF files from the faahKO package to files in mzML format (same file name, but with mzML file ending):

library(Spectra)
library(faahKO)
cdf <- dir(system.file("cdf", package = "faahKO"), recursive = TRUE, full.names = TRUE)
s <- Spectra(cdf)
## Define new file names
newf <- basename(dataOrigin(s))
newf <- sub("CDF", "mzML", newf)
export(s, backend = MsBackendMzR(), file = newf)