Morph any metabolomics figure into any journal's house style.
plotmorph is an R package that adapts metabolomics and lipidomics figures to journal-specific publication requirements — fonts, colors, dimensions, line weights, caption format, MSI confidence reporting — via a parameterized style schema. Add a new journal by editing one YAML file.
Adapting a figure to a journal's house style is one of the most-repeated tasks in scientific publishing. It is also one of the most often skipped: papers ship with mixed fonts across panels, red-green volcano plots that fail accessibility, missing MSI confidence levels in captions, and color schemes that drift between subfigures of the same composite. plotmorph exists to make journal-style compliance the default, not an afterthought.
v0.1.0 — early release. Public-from-day-one. The internals will move quickly. The output contract (the JournalStyle schema) will evolve under additive rules — additions are safe, renames are deprecated through one release cycle.
- Style schema (
JournalStyle) — ~30 parameters that fully specify a journal's figure requirements. - One hand-encoded style — ACS family (covers Analytical Chemistry, Journal of Proteome Research, ACS Omega, Journal of the American Society for Mass Spectrometry in one spec).
- Three primitive renderers —
render_volcano(),render_heatmap(),render_bar(). - A multi-panel composer (
compose_panels()) — the signature feature. Builds composite figures from primitives while enforcing typography, palette, and panel-label consistency that is routinely broken in real publications. - A mechanical compliance checker (
compliance_check()) — audits a rendered figure against its target journal's spec and returns a structured pass/fail report. - Export to PDF / EPS / PNG at journal-spec dimensions and DPI.
v0.2 — Nature, Springer, and MDPI journal families. Pathway diagrams, lipid-class chain plots, ChemRICH-style networks. URL-based style ingestion: paste a journal's Author Information page, get a draft template auto-extracted.
v0.3 — community-contributed templates accumulating in inst/styles/. Benchmark suite reproducing 20 published figures from primary data on MetaboLights / MassIVE.
# install.packages("remotes")
remotes::install_github("othmanalaa/plotmorph")For the interactive demo (optional):
install.packages(c("shiny", "bslib", "DT"))plotmorph::run_app()This opens a browser window where you can upload a CSV, see the default ggplot2 rendering side-by-side with the journal-styled rendering, customize the font / palette / size / thresholds live, run a mechanical compliance check, and export to PDF / PNG / EPS.
Don't have data to hand? Click Use example data in the sidebar.
library(plotmorph)
# Synthetic volcano data (or load your own)
set.seed(42)
data <- data.frame(
feature_id = paste0("L", seq_len(100)),
log2FC = c(rnorm(80, 0, 0.5), rnorm(20, 2, 0.5)),
pvalue = c(runif(80, 0.05, 1), runif(20, 0, 0.05))
)
data$padj <- p.adjust(data$pvalue, method = "BH")
# Load the ACS family style
style <- load_acs_style()
# Render
p <- render_volcano(data, style)
# Audit compliance
report <- compliance_check(p, style)
print(report)
# Export to journal spec
export_figure(p, style, path = "volcano.pdf", width_mode = "single")- One YAML per journal. The style spec is the contract. Adding journal #50 is the same effort as adding journal #1.
- Compliance is mechanical, not aspirational.
compliance_check()returns structured pass/fail, not advice. - Multi-panel consistency by construction. The composer applies one theme across all panels — the most common failure mode in real composites is impossible by design.
- Metabolomics-specific defaults. Colorblind-safe palettes, MSI confidence reporting in captions, log₂ fold-change axis labels with proper subscripts.
Developed with AI-assisted coding at FGCZ (Functional Genomics Center Zurich, ETH / UZH).
MIT. See LICENSE.md.
See CITATION.cff or run citation("plotmorph") after install.