Skip to main content
Topic: Isotope extraction (Read 5458 times) previous topic - next topic

Isotope extraction

Hi, I'm playng for the first time with the metabolomics and I have some doubt about the metabolite identification (herehttp://http://metabolomics-forum.com/viewtopic.php?f=8&t=187&sid=0f294f5a8bf7f8474256f8b0649aea2e). After the anlysis with only xcms I would like to go further using CAMERA to try to better understand the data obtained with xcms.

So, after the xcms and CAMERA workflow I tryed the getIsotopeCluster function to work only with the molecular ion.

Code: [Select]
xsa <- xsAnnotate(xset)
xsaF <- groupFWHM(xsa)
xsaC <- groupCorr(xsaF)
xsaI <- findIsotopes(xsaC)
data.set <- getPeaklist(xsaI)
isolist <- getIsotopeCluster(xsaI, value="into")

My question is about the usage of the getIsotopeCluster function, in particular how can I extrapolate only the information about the $peak slot of all my sample and collect them into a data frame??

Best

Re: Isotope extraction

Reply #1
Hi Ricca,

Does the following do what you want?  :)

Code: [Select]
# Just a small backup
iso <- isolist
# Remove $charge so as to easily append to data.frame
iso <- lapply(iso,function(x) { x$charge <- NULL; return(x) })
# Create the data.frame
d <- do.call("rbind",lapply(iso,data.frame))
Panos

Re: Isotope extraction

Reply #2
Hi, thanks for your precious suggestion, I completely ignores the existence of the do.call function. :D

I have a further question: I can I get the intensities of my isotopes across each sample??

Best
Riccardo

Re: Isotope extraction

Reply #3
Quote from: "Ricca"
I have a further question: I can I get the intensities of my isotopes across each sample??

Best
Riccardo

Not until now, but I just committed 1.11.1 into the Bioconductor devel tree. The build should be available tomorrow.

With the new parameter sampleIndex you can now select from which sample the intensities are retrieved. Multiple selection is also possible.

Example with faahKO:

  library(faahKO)
  xs <- group(faahko)
  xs <- fillPeaks(xs)
  an  <- xsAnnotate(xs)
  an  <- groupFWHM(an)
  an  <- findIsotopes(an)
  isolist <- getIsotopeCluster(an) #do the same as before

  isolist <- getIsotopeCluster(an, sampleIndex=c(1:12)) #select the intensity from all samples (faahKO has 12)

Output looks like:

> isolist
[[1]]
[[1]]$peaks
          mz    ko15    ko16    ko18  ko19  ko21  ko22    wt15    wt16    wt18  wt19  wt21  wt22
[1,] 480.1633 1373184 1301504 1179136 816000 820864 749312 1310720 1398784 1137664 797952 869632 742848
[2,] 481.1582  348928  336192  307328 214784 219264 198144  338048  363392  297472 219584 223488 189824

[[1]]$charge
[1] 1

The snippet from Panos works also perfect with the new output.

Carsten