Skip to main content
Topic: how to plot EICs for multiple samples overlayed ? (Read 7740 times) previous topic - next topic

how to plot EICs for multiple samples overlayed ?

Hi ,

I want to know how to plot EICs for each peak after annotation for multiple samples overlayed

Re: how to plot EICs for multiple samples overlayed ?

Reply #1
Hi Tanus,

CAMERA has the plotEICs function, which plots the peak EICs for each peak group created by CAMERA.
But you want to plot for one peak the EICs from all its samples in one plot.
Did I understand you right?

Carsten

Re: how to plot EICs for multiple samples overlayed ?

Reply #2
Hi Carsten,

You understand it right .I actually want to plot for each peak the EICs from all its samples in one plot .
That means say if i have 1000 peaks after final annotation i want to plot 1000 different plots where each plot would EICs from all its samples .

Thanks
Tanu

Re: how to plot EICs for multiple samples overlayed ?

Reply #3
It exists a method for plotting EICs from a xcmsSet.
You can use this methods for your problem, because the original xcmsSet object is stored within a xsAnnotate object.

So with xs <- object@xcmsSet (object is here the processed xsAnnotate object)
you can retrieve the original xcmsSet object.

Here with an example
Code: [Select]
library(xcms)
library(faahKO)
cdfpath <- system.file("cdf", package = "faahKO")
cdffiles <- list.files(cdfpath, recursive = TRUE, full.names = TRUE)
xset <- xcmsSet(cdffiles)
xset <- group(xset)

xsa <- annotate(xset)
##Only for the case the xset is lost.
xset <- xsa@xcmsSet

##For plotting first fillPeaks your xcmsSet
xset.fill <- fillPeaks(xset)
##Get EICs
xeic <- getEIC(xset.fill, groupidx=1:nrow(xsa@groupInfo))
##Plot EICs for the first peak
plot(xeic, groupidx=1)
## For more information about this function see ?xcms::plot.xcmsEIC

Cheers,
Carsten