Metabolomics Society Forum

Software => R => XCMS => Topic started by: eroden on March 29, 2016, 09:40:48 AM

Title: Overlapping EIC plots
Post by: eroden on March 29, 2016, 09:40:48 AM
Hi All,

New to the forum so apologies if I'm not formatting this question correctly, but what I'd like to do is plot two EICs in the same space to get a result similar to this: http://http://acdlabs.typepad.com/.a/6a00d834fe3a5753ef01630624cec6970d-pi

I can get one plot to generate successfully using the plotEIC() method and the XCMS documentation says that there should be a parameter to this function called add which lets you add an EIC to an already existing EIC, but I get an unused argument error when I try this. Is there a way to accomplish what I'm trying to do?

Thanks in advance!
Title: Re: Overlapping EIC plots
Post by: Jan Stanstrup on May 05, 2016, 08:39:22 AM
Seems to work?
Can you produce an example where it does not?

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

cdfpath <- file.path(find.package("faahKO"), "cdf")
files <- list.files(cdfpath, recursive = TRUE)

xraw <- xcmsRaw(paste0(cdfpath,"/",files[1]))
xraw2 <- xcmsRaw(paste0(cdfpath,"/",files[2]))

plotEIC(xraw, add=FALSE)
plotEIC(xraw2, add=FALSE)

plotEIC(xraw, add=FALSE)
plotEIC(xraw2, add=TRUE,col="red")