Metabolomics Society Forum

Software => R => XCMS => Topic started by: allend on July 10, 2014, 09:40:16 AM

Title: How to access data returned by getEIC?
Post by: allend on July 10, 2014, 09:40:16 AM
I am a dill and a dodo with failing Google fu,

I can open a data file in R with
Code: [Select]
filename <- "#4606.mzXML"
xraw <- xcmsRaw(filename)
and get an extracted ion chromatogram with
Code: [Select]
mzr <- cbind(179.9,180.3)
rtr <- cbind(397,1560.3)
eicm <- getEIC(xraw, mzrange = mzr, rtrange = rtr)
but for further processing I would now like to access the values for 'rt' and 'intensity' as displayed by
Code: [Select]
> attr(eicm,"eic")
$xcmsRaw
$xcmsRaw[[1]]
              rt  intensity
  [1,]  397.022      1425
  [2,]  397.241      13700
...
[5510,] 1560.069          0
[5511,] 1560.288      36000
Could somebody please help with the required voodoo?

TIA
Title: Re: How to access data returned by getEIC?
Post by: allend on July 11, 2014, 12:58:52 AM
I have answered my own question after a good night's sleep.
Code: [Select]
temp <- attr(eicm,"eic")
rtime <- temp$xcmsRaw[[1]][,1] # get rt's
intensity <- temp$xcmsRaw[[1]][,2] # get intensities
Sorry for the noise.