G'day,
I was experimenting earlier today with using findPeaks.centWave on a single chromatogram.
The chromatogram was stored in a CSV file (RT, I) and I passed it to findPeaks.centWave thus:
require(xcms)
data <- read.csv(file="chrom.csv", header=TRUE, sep=",")
numPoints <- length(data$I)
raw <- new("xcmsRaw")
raw@tic <- data$I
raw@scantime <- data$RT
raw@scanindex <- 1:numPoints
raw@env$mz <- rep(136.061, numPoints)
raw@env$intensity <- data$I
peaks <- findPeaks.centWave(raw, peakwidth=c(0,100))
Actually, it must have been
something like the above because it worked - it detected a peak in precisely the right spot - but now that I try the above again it fails to find a single ROI and so bails out.
Is the above (or something similar) the correct approach for passing a single chromatogram to findPeaks.centWave?
I've attached chrom.csv.
Thanks,
Chris.
Here's the chromatogram data: [attachment=0:2sfz8o3s]chrom.zip[/attachment:2sfz8o3s]
[attachment deleted by admin]
You can either
- build an xcmsRaw object using the data from your "chromatograms". But then you do need m/z values. Or
- bypass the ROI detection. Generate "featlist" (list of ROI's) using your chromatograms and feed that into centWave.
G'day,
Thanks for your response Ralf.
Is that why the approach I used above failed - because I fudged the m/z values (all set to 136.061)?
Could you provide an example of this please - I read the documentation and searched the forum but couldn't find information about passing a "featlist" to findPeaks.centWave.
Thanks,
Chris.
peakwidth=c(0,100) could be the problem. A minimum peak width of 0 does not make sense.
I would not recommend going below 10 or 20 for HPLC data, you risk picking up a lot of noise.
It is not supported by the current centWave implementation.
But instead of calling
featlist <- findmzROI(object,scanrange=scanrange,dev=dev,minCentroids=minCentroids, prefilter=prefilter, noise=noise)
within findPeaks.centWave() you can call your own function that gives a list of ROI
or comment it out and pass featlist as a parameter to centWave.
featlist (the list of ROI's) is simply an R list, where each list element
defines {"mz", "mzmin", "mzmax", "scmin", "scmax", "length", "intensity"}
where "mzmin", "mzmax" are the boundaries in m/z
and "scmin", "scmax" are the boundaries in time (as scan number).
G'day,
I got this working - turns out all that was needed was to supply ppm=0 for the ROI detection to work :D
Setting mzdiff=0 also helps.
So, I'm now using
peaks <- findPeaks.centWave(raw, peakwidth=c(10,100), ppm=0, mzdiff=0)
Regards,
Chris.