sneumann / xcms

This is the git repository matching the Bioconductor package xcms: LC/MS and GC/MS Data Analysis

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Polarity cannot be extracted

crestre opened this issue · comments

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

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

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.

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)