library(CAMERA)
file <- system.file('mzdata/MM14.mzdata', package = "CAMERA");
xs <- xcmsSet(file, method="centWave", ppm=30, peakwidth=c(5, 10));
an <- xsAnnotate(xs);
an.group <- groupFWHM(an);
an.iso <- findIsotopes(an.group); #optional step for using isotope information
an.grp.corr <- groupCorr(an.iso, calcIso=TRUE);
#For csv output
# write.csv(file="peaklist_with_isotopes.csv",getPeaklist(an))
#Multiple sample
library(faahKO)
xs.grp <- group(faahko)
#With selected sample
xsa <- xsAnnotate(xs.grp, sample=1)
xsa.group <- groupFWHM(xsa)
xsa.iso <- findIsotopes(xsa.group) #optional step
xsa.grp.corr <- groupCorr(xsa.iso, calcIso=TRUE)
#With automatic selection
xsa.auto <- xsAnnotate(xs.grp)
xsa.grp <- groupFWHM(xsa.auto)
xsa.iso <- findIsotopes(xsa.grp) #optional step
index <- c(1,4) #Only group one and four will be calculate
#We use also correlation across sample
xsa.grp.corr <- groupCorr(xsa.iso, psg_list=index, calcIso=TRUE, calcCaS=TRUE)
#Note: Group 1 and 4 have no subgroups
Run the code above in your browser using DataLab