Skip to main content
Topic: xcmsSet Usage in xMSanalyzer Package  (Read 3899 times) previous topic - next topic

xcmsSet Usage in xMSanalyzer Package

Hello! So I am using other packages that make use of XCMS's wrapper function xcmsSet, but unfortunately I'm getting every time.

For example, when using the package xMSanalyzer, the first step is to use XCMS.align.centWave, which involves multiple uses of xcmsSet, with differing parameters for step, mzdiff, default values, snthresh, and max # of peaks per EIC. Now:

#this works just fine
xset <- xcms::xcmsSet("E:/AK/stellaPOS", method = "centWave",...)

#this gives an error:
xMSanalyzer::XCMS.align.centWave(cdfloc = "E:/AK/StellaPOS", XCMS.outloc = "stella_An")

The error is " No NetCDF/mzXML/mzData/mzML files were found." Which is so strange because I'm using the exact same directory!!! What gives?

The traceback() gives:
3: stop("No NetCDF/mzXML/mzData/mzML files were found.\n")
2: xcmsSet(cdf_files, method = "centWave", ppm = p, snthresh = t,
       mzdiff = m, peakwidth = peakwidth, prefilter = prefilter.list,
       integrate = 1, verbose.columns = TRUE, fitgauss = FALSE,
       nSlaves = nSlaves)
1: XCMS.align.centWave(cdfloc = "E:/AK/StellaPOS", XCMS.outloc = "stella_An")

Any help would be appreciated. Thank you!

 

Re: xcmsSet Usage in xMSanalyzer Package

Reply #1
I am checking the source code of xcms and might tell you the solutions.

For xcmsSet, in their source code, the path was treated as:

Code: [Select]
listed <- list.files(files[info$isdir], pattern = filepattern, recursive = TRUE, full.names = TRUE)
However, in the xMSanalyzer package, they directly set the path as:

Code: [Select]
cdf_files=list.files(cdfloc,".cdf|.mzxml|mXML",ignore.case=TRUE)

which is actually wrong. You could either add
Code: [Select]
 recursive = TRUE, full.names = TRUE
in the cdf_files or just change the cdf_files into cdfloc in the XCMS.align.matchedFilter.R and recompiled that package from sources.