Metabolomics Society Forum

Software => R => CAMERA => Topic started by: tanus on December 04, 2012, 04:40:16 PM

Title: how to plot EICs for multiple samples overlayed ?
Post by: tanus on December 04, 2012, 04:40:16 PM
Hi ,

I want to know how to plot EICs for each peak after annotation for multiple samples overlayed
Title: Re: how to plot EICs for multiple samples overlayed ?
Post by: Carsten on December 05, 2012, 06:54:15 AM
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
Title: Re: how to plot EICs for multiple samples overlayed ?
Post by: tanus on December 05, 2012, 01:27:09 PM
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
Title: Re: how to plot EICs for multiple samples overlayed ?
Post by: Carsten on December 06, 2012, 09:41:10 AM
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