Metabolomics Society Forum

Software => R => CAMERA => Topic started by: lhemivw on March 12, 2012, 10:03:32 PM

Title: How to integrate the reporttab(xcms) and getPeaklist(CAMERA)
Post by: lhemivw on March 12, 2012, 10:03:32 PM
Hello, I find the the serial number of reporttab(xcms) is difference
from that of getPeaklist(CAMERA). Is there code to integrate? the code "cbind" could not solve this problem.
    Thank you very much!
 
scincerely yours,
HEMI
Title: Re: How to integrate the reporttab(xcms) and getPeaklist(CAM
Post by: Carsten on March 17, 2012, 12:26:57 PM
Hi Hemi,

I assume with reporttab you mean the outcome of diffreport(xcms) function?

For combining both results, it's very important that the diffreport result is not sorted after p-value.
Because then both tables have the same order and can be easily combined.
I show you an easy adoptable example with the faaKO data set.

Code: [Select]
library(faahKO)
library(CAMERA)

xs.grp  <- group(faahko)
xs.fp  <- fillPeaks(xs.grp)
#do not sort after pval
reporttab <- diffreport(xs.fp, sortpval=FALSE)

xsa        <- xsAnnotate(xs.fp)
xsa.grp  <- groupFWHM(xsa)
peaklist  <- getPeaklist(xsa.grp)

#combine
reporttab.combine <- cbind(reporttab, peaktable[, c("isotopes", "adduct", "pcgroup")])

Carsten