Metabolomics Society Forum

Software => R => XCMS => Topic started by: Tony on March 27, 2019, 07:25:14 AM

Title: findChromPeaks-centWave {xcms} - Prefilter Settings and Code Documentation
Post by: Tony on March 27, 2019, 07:25:14 AM
Dear Forum,

I would like to inquire about the prefilter setting for the function findChromPeaks-centWave {xcms}.

I am using R 3.5.3. under Windows7 (64bit) with packageVersion("MSnbase") ‘2.8.3’ and packageVersion("xcms") ‘3.4.4’.

Concerning the prefilter-parameter, here the code documentation says:

 CentWaveParam(ppm = 25, peakwidth = c(20, 50), snthresh = 10,
  prefilter = c(3, 100), mzCenterFun = "wMean", integrate = 1L,
  mzdiff = -0.001, fitgauss = FALSE, noise = 0,
  verboseColumns = FALSE, roiList = list(),
  firstBaselineCheck = TRUE, roiScales = numeric())

prefilter
numeric(2): c(k, I) specifying the prefilter step for the first analysis step (ROI detection). Mass traces are only retained if they contain at least k peaks with intensity >= I.

For this documentation/explanation, is the term "peak" right here, or is rather "scans" the more adequate word.
From my understanding of the documentation of the prefilter, a peak (consisting of several(10-20) scan points) has to have more than k scans of intensity I.

Is that right?

thanks
Tony
Title: Re: findChromPeaks-centWave {xcms} - Prefilter Settings and Code Documentation
Post by: CoreyG on March 28, 2019, 08:07:00 PM
Hi Tony,

Yes, I do believe you are correct with your interpretation of the documentation.
It looks like the prefilter check is done here: do_findChromPeaks-functions.R (https://github.com/sneumann/xcms/blob/372aa0f62c18b17f9fa317f6186a7d6a6cb36c33/R/do_findChromPeaks-functions.R#L3604). The vapply iterates over each ROI index list and counts the number of scans with intensity above the prefilter threshold (I). If this is above 'k', the ROI is kept.

Also, 'scans' would probably be a better word to use  :)
Title: Re: findChromPeaks-centWave {xcms} - Prefilter Settings and Code Documentation
Post by: Tony on April 01, 2019, 04:48:21 AM
Hello Corey,

understood. All right.  Thanks!

kind regards
Tony