Modern, interactive visualizations for XCMS metabolomics data using ggplot2.
xcmsVis provides ggplot2 implementations of XCMS plotting functions, enabling:
- Modern, publication-ready visualizations
- Interactive plots through plotly integration
- Consistent styling across all plots
- Full compatibility with both XCMSnExp and XcmsExperiment objects
This package complements the XCMS package by reimplementing its base graphics plots using ggplot2.
# Install from GitHub (development version)
# devtools::install_github("yourusername/xcmsVis")gplotAdjustedRtime()- ggplot2 version ofplotAdjustedRtime()gplotChromPeaks()- ggplot2 version ofplotChromPeaks()gplotChromPeakImage()- ggplot2 version ofplotChromPeakImage()gplot()- ggplot2 version ofplot()for XChromatogram objectsghighlightChromPeaks()- ggplot2 version ofhighlightChromPeaks()
Future releases will include ggplot2 versions of:
plotQC()plotChromPeakDensity()- And more!
library(xcmsVis)
library(xcms)
# Works with XcmsExperiment (XCMS v4+)
xdata <- readMsExperiment(files = mzml_files)
# ... perform peak detection, alignment, etc.
# Create retention time adjustment plot
p <- gplotAdjustedRtime(xdata, color_by = sample_group)
print(p)
# Make it interactive
library(plotly)
ggplotly(p, tooltip = "text")
# Also works with XCMSnExp (XCMS v3)
xdata_v3 <- readMSData(files = mzml_files, mode = "onDisk")
# ... perform XCMS workflow
p <- gplotAdjustedRtime(xdata_v3, color_by = sample_group)This package addresses the need discussed in XCMS issue #551 for ggplot2-based visualizations that can be easily made interactive using plotly.
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License - see LICENSE file for details