Metabolomics Society Forum

Software => XCMS => R => XCMS - Cookbook => Topic started by: hpbenton on August 11, 2011, 07:28:24 AM

Title: Peak Picked TIC
Post by: hpbenton on August 11, 2011, 07:28:24 AM
You want to create a TIC of the peaks that were picked. Either that or you don't have the original files to reload.
The code below allows you to take an xcmsSet object or xsAnnotate object and create the peak picked EIC.

Code: [Select]
xcmsSet.TIC<-function(object,...){
if(class(object) == "xsAnnotate"){
object<-object@xcmsSet
}
Intensity<-rowMeans(groupval(object, "medret", "maxo"))
rt<-object@groups[,"rtmed"]
idx<-order(rt)

plot(x=rt[idx], y=Intensity[idx], type="b",
ylab="Intensity", xlab="Retention time (sec)",
main="Peak picked TIC", ...)
}