G'day,
We've been using findPeaks.centWave to process individual chromatograms, see this thread. We use this script:
require(xcms)
xdata <- read.csv(file="chrom.csv", header=TRUE, sep=",")
rtSec <- xdata$RT
numPoints <- length(xdata$I)
xraw <- new("xcmsRaw")
xraw@tic <- xdata$I
xraw@scantime <- rtSec
xraw@scanindex <- 1:numPoints
xraw@env$mz <- rep(130.61, numPoints)
xraw@env$intensity <- xdata$I
xpeaks <- findPeaks.centWave(xraw, peakwidth=c(10,200), ppm=0, mzdiff=0, snthresh=0, integrate=1, prefilter=c(0,0), verbose=TRUE)
plot(xdata$RT, xdata$I, type='l')
for (i in 1:nrow(xpeaks)) {
lines(xdata[findInterval(xpeaks[i,'rtmin'],rtSec):findInterval(xpeaks[i,'rtmax'],rtSec), c('RT','I')], col=rainbow(16)[i], type='h')
}
prmatrix(xpeaks)
When processing a single chromatogram, all points are given the same m/z value, in the example above it's 130.61.
However, I noticed that if you change this value you get different results. This seems to arise from the ROI detection step, which can produce different numbers of ROI depending on the m/z value of the chromatogram. For example, for the attached data and m/z of 136.01 it finds 12 ROIs. If the m/z is changed to 13.061 then it finds 23 ROIs.
I don't understand why this should be; if all the m/z values of a chromatogram are identical then they should form the same set of ROIs regardless of the m/z value.
I've looked at the source code for findmzROI and I can't see any problem (but haven't the capacity to debug it).
Is the behaviour I'm observing correct?
Thanks,
Chris.
[attachment deleted by admin]