Skip to main content
Topic: getEIC plot problems when rt="cor" (Read 1098 times) previous topic - next topic

getEIC plot problems when rt="cor"

Dear XCMS Developers and Users,

We are experiencing problems generating EICs using the getEIC function with xcmsSet objects and group IDs when the "rt" argument is set to "cor".  Recently we upgraded xcms from version 1.26.1 to version 1.40 and began to experience the issue where all of the EICs generated by getEIC do not make sense when rt="cor".  The problem occurs with or without data that has been rt corrected when rt is set to cor.  The EICs look as expected when using rt = raw.  This problem occurs with every independent data set we have evaluated.    I have been able to reproduce the problem with the faahKO package [example code following session info].  I have attached a pdf from the example code below where page 1 and 3 correspond to the same feature.  We have rolled back to version 1.26.1, but would like to use the current version of xcms.  Any information on the origin of this problem and advice on how to solve this problem would be appreciated so that we can evaluate features with RT corrected data using the current builds of xcms and the getEIC fucntion.

The problem described above occurs in both linux under R3.1.1 and windows OS under R3.02.

I often see errors like the following generated in our high res TOF and QTOF data.

In matrix(c(object@scantime, colMax(buf[bufidx[imz[1]:imz[2]],  ... :
  data length [26859] is not a sub-multiple or multiple of the number of rows [13430]

#sessionInfo
R version 3.0.2 (2013-09-25)
Platform: x86_64-w64-mingw32/x64 (64-bit)

locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252 
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                         
[5] LC_TIME=English_United States.1252   

attached base packages:
[1] parallel  stats    graphics  grDevices utils    datasets  methods 
[8] base   

other attached packages:
[1] snow_0.3-13        faahKO_1.2.16      xcms_1.40.0        Biobase_2.22.0   
[5] BiocGenerics_0.8.0 mzR_1.8.1          Rcpp_0.11.3 


########### example #############
library(xcms)
library(faahKO)

cdfpath <- system.file("cdf", package = "faahKO")
list.files(cdfpath, recursive = TRUE)
cdffiles <- list.files(cdfpath, recursive = TRUE, full.names = TRUE)

xset<-xcmsSet(cdffiles,profmethod = "bin", method="centWave", ppm=30, peakwidth=c(5,50), snthresh=10, prefilter=c(7,1000), integrate=1, mzdiff= -0.001, fitgauss=FALSE, scanrange= c(0,500),mzCenterFun="wMean",noise=300,sleep=0, verbose.columns=T,nSlaves=3);
xset2<-retcor(xset, method = "obiwarp",distFunc="cor_opt",profStep=1,plot="deviation",gapInit=0.8, gapExtend=3.3)
gxset2<-group(xset2,method="density", bw=8, minfrac = .5, minsamp = 2, mzwid = .01, max = 50, sleep = 0)
xset3<-fillPeaks(gxset2);

peaktab <-data.frame(ID=groupnames(xset3),peakTable(xset3))

a<-getEIC(xset3,groupidx=c("M205T2790","M392T2927"))
b<-getEIC(xset3,groupidx=c("M205T2790","M392T2927"),rt="raw")
pdf("plot.example.pdf")
plot(a)
plot(b)
dev.off()
sessionInfo()
#####################################################################################################################################


Thank you,
Alan Smith