Hello,
I'm using find xcms::findChromPeaks with centwave algorithm to extract XICs for which I need to input a roilist, I was testing using just one ROI or m/z Trypto<-data.frame("mz"=216.1341,"rtmin"= 50, "rtmax"= 900,"mz"=216.1341,"scmin"=51,"scmax"=800,"mzmin"=216.1321,"mzmax"=216.1361,"length"=20,"intensity"=1000)
but I keep getting the following error...Error in validObject(.Object) : invalid class “CentWaveParam” object: 'roiList' does not provide all required fields!
I don't know what I am missing! please help
Thank you Johannes. The ROIlist error is gone after using a list as you suggested! but for some reason is not finding the ROIs (which are definitely in there)...I have also tried using chromatogram to extract the ion of interest, but I decided to go with findChrompeaks/centwave so that I could run multiple files "onDisk" and also be able to plot multiple XICs or extract multiple m/z s in one chromatogram window, which it seems is not possible using the chromatogram function...do you know if it is possible to extract multiple XICs in one window using Chromatogram? Any suggestions are appreciated !
The
findChromPeaks
function is really only intended to identify chromatographic peaks - not to extract ion chromatograms. To extract ion chromatograms you have to use thechromatogram
function on the on disk data. It will extract the chromatogram for each file in your data. If you callplot
on the object returned bychromatogram
(which in fact is aChromatograms
object), it will plot the ion chromatogram of every file into the same plot (one line for each file). Have a look at xcms vignette for an example how to use it.Right, I'm trying to do something similar to what this vignette shows : https://bioconductor.org/packages/release/bioc/vignettes/xcms/inst/doc/xcms.html , something like this below, which was working OK, but I figured I needed to use the ROIlist to make "targeted peak detection" , perhaps I need to make a ROIlist from the chromatogram object?
chrraw <- chromatogram(rawdata, mz = mzr, rt = rtr)
xchr <- findChromPeaks(chr_raw, param = CentWaveParam(snthresh = 2))
plot(xchr, col = samplecolors, peakBg = samplecolors[chromPeaks(xchr)[, "column"]])
Thanks!
Note that you can also provide a
matrix
with argumentsmz
andrt
(two columns with lower and upper boundary, each row defining the region in wich you expect the data from one ion). With that you could extract multiple XIC at once and you could also run thefindChromPeaks
on all of them. That might be an alternative to theROIlist
.