![]() |
PeakML integration for XCMS
With the introduction of the PeakML file format, it has become possible to share data between software produced by different vendors and laboratories. To illustrate the point we provide a working example of integration of the commonly use XCMS and mzMatch. For this reason an R-library is provided, which extends the XCMS library with PeakML read and write functionality. In this tutorial a working example is given on how to use the library.
Download and install R. R is an integrated suite of software facilities for data manipulation, calculation and graphical display. R can be obtain from CRAN servers. If you are unfamiliar with R syntax and commands, it is recommended to read an introduction to R document. The mzmatch.R depends on the following libraries, which need to be installed on your R-system:
XCMS
faahKO
rJava
XML
snow
caTools
bitops
ptw
These packages can be installed from the R commandline:
source("http://bioconductor.org/biocLite.R") biocLite(c("faahKO", "xcms", "multtest")) install.packages(c("rJava","XML","snow","caTools","bitops","ptw")) As a last step the mzmatch.R library needs to be installed. source ("http://puma.ibls.gla.ac.uk/mzmatch.R/install_mzmatch.R")Before the package can be used, it needs to be loaded into the R-environment. This can be achieved with the following command (the second command for faahKO is only required for this tutorial): require (mzmatch.R) require (faahKO) mzmatch.init ()
PeakML Viewer
require (mzmatch.R) PeakML.Viewer ()
The following code has been taken from the XCMS manual and extracts the peaks from the faahKO dataset, groups them and stores the result in the xset object: cdfpath <- system.file("cdf", package = "faahKO") cdffiles <- list.files(cdfpath, recursive = TRUE, full.names = TRUE)[c(3,4,7,8)] xset <- xcmsSet(cdffiles) xset <- group(xset) xset <- retcor(xset, family = "symmetric", plottype = "mdevden") xset <- group(xset, bw = 10) xset <- fillPeaks(xset)
The data stored in the xset object can now be written with the following function call: PeakML.xcms.write(xset, "XCMS_out.peakml",ionisation="positive")This file can now be read into the xset_new object with the following function call. The xset_new can now be used in the further XCMS toolchain. xset_new <- PeakML.xcms.read ("XCMS_out.peakml",ionisation="positive")Original data set structure is restored and object can be used to apply commands from the XCMS package. For example report generation: xset_f <- fillPeaks (xset_new) diffreport(xset_f, "WT", "KO", "example", 10, metlin = 0.15, h = 480, w = 640)Plot extracted ion chromatograms: gt <- groups(xset_f) groupidx1 <- which(gt[, "rtmed"] > 2600 & gt[, "rtmed"] < 2700)[1] eicraw <- getEIC(xset_f, groupidx = c(groupidx1), rt = "raw") plot(eicraw, xset_f, groupidx = 1)
The results stored in the PeakML file can now be read in the application PeakML Viewer, of which an example is shown below:
![]()
|
Design based on the SWT pages. |
|