Dear all!
I am a little puzzled by the two methods for xcmsRaw
classes to extract ion chromatograms, namely the rawEIC
and the getEIC
methods. I am most likely mistaken, but I was expecting the function to return comparable data (which they don't do, see code below). The difference is also not explained by the fact that rawEIC
returns the sum of all signals across the m/z range, and the getEIC
(likely) not (I checked for the max signal across the m/z range, but that does also not fit).
I appreciate any help or suggestion on this!
thanks, jo
library(xcms) cdfpath <- system.file("cdf", package="faahKO") cdffiles <- list.files(cdfpath, recursive=TRUE, full.names=TRUE) xraw <- xcmsRaw(cdffiles[1], profmethod="bin", profstep=0.1) ## define the mz and rtrange mzrange <- xraw@mzrange rtrange <- range(xraw@scantim) ## now getting the raw EIC reic <- rawEIC(xraw, mzrange=mzrange, rtrange=rtrange) par(mfrow=c(1, 2)) plot(xraw@scantime[reic$scan], reic$intensity, type="l", main="TIC") ## now using the getEIC... mzrange.m <- matrix(mzrange, nrow=1) colnames(mzrange.m) <- c("mzmin", "mzmax") rtrange.m <- matrix(rtrange, nrow=1) geic <- getEIC(xraw, mzrange=mzrange.m, rtrange=rtrange.m) plot(geic)
My session info:
> sessionInfo() R version 3.2.0 (2015-04-16) Platform: x86_64-apple-darwin14.3.0/x86_64 (64-bit) Running under: OS X 10.10.3 (Yosemite) locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8 attached base packages: [1] parallel stats graphics grDevices utils datasets methods [8] base other attached packages: [1] xcms_1.45.2 ProtGenerics_1.0.0 mzR_2.2.0 [4] Rcpp_0.11.5 ascii_2.1 RColorBrewer_1.1-2 [7] Biobase_2.28.0 BiocGenerics_0.14.0 loaded via a namespace (and not attached): [1] compiler_3.2.0 tools_3.2.0 codetools_0.2-11 grid_3.2.0 [5] lattice_0.20-31
thanks! didn't read careful enough ;)
Unfortunately, that does however not explain the difference! I calculated the eic on the profile matrix too, but the results are different (using the code/objects from the original message):
Apparently (evaluating also the code in xcmsRaw.R) the function extracts only the first 100 bins (rows) in the profile matrix, so does not consider the full m/z range... I'll evaluate the code again but at present I'm afraid that's a bug :(