Fifteen GPU- and canvas-accelerated visualization widgets for bioinformatics, built on a shared JavaScript core and exposed to R through htmlwidgets. Every widget renders in the RStudio Viewer, R Markdown, Quarto and Shiny, and each ships a matching *Output() / render*() pair for Shiny apps.
The same core drives the Python and JavaScript packages, so a widget looks and behaves identically wherever it ships.
Installation
install.packages("plotomics")For the development version, from r-universe or GitHub:
install.packages("plotomics", repos = "https://samuelbharti.r-universe.dev")
# install.packages("pak")
pak::pak("samuelbharti/plotomics/pkg-r")Quick start
library(plotomics)
# Differential expression
volcano(data.frame(
x = res$log2FoldChange,
y = -log10(res$padj),
gene = rownames(res)
))
# A single-cell embedding: a factor pins the legend order and keeps
# unused levels, the way drop = FALSE does in ggplot2
embedding(data.frame(
x = umap[, 1],
y = umap[, 2],
color = factor(cell_type)
))
# Kaplan-Meier, straight from a survfit object
km(survival::survfit(survival::Surv(time, status) ~ sex, data = lung))Components
| Area | Functions |
|---|---|
| Expression and abundance |
volcano(), bioheatmap(), clustermap(), dotplot(), violin()
|
| Single-cell and spatial |
embedding(), spatial()
|
| Cohort and variant |
oncoplot(), lollipop(), km(), bioprofile()
|
| Sets, hierarchies, networks |
upset(), treemap(), network()
|
| Genome and chromatin | hic() |
The Python and JavaScript packages ship two more: igv() and gosling(), both genome browsers. They came out of the R package before the CRAN submission, because their bundles push the installed size past CRAN’s 5 MB limit. Whether they return is open.
Helpers: oncoplot_memo_sort() for the conventional oncoplot column order, upset_intersections() for exclusive set intersections, and violin_density() for densities computed in R.
Two names differ from the obvious choice, so that attaching the package masks nothing in base or the recommended packages: bioheatmap() rather than heatmap(), and bioprofile() rather than profile(). Both have *_plotomics() aliases (heatmap_plotomics(), profile_plotomics()).
Shiny
Every widget has a Shiny pair. The network and embedding widgets also report selections back to the server:
ui <- fluidPage(networkOutput("net"))
server <- function(input, output) {
output$net <- renderNetwork(network(nodes, edges))
# clicking a node sets input$net_selected
observeEvent(input$net_selected, print(input$net_selected))
}Built for large data
Numeric columns reach the browser as a binary buffer rather than JSON, which is what keeps several hundred thousand points interactive rather than merely drawable.
Documentation
- Reference for every function
- Changelog
-
Project overview: why the package exists, the Python and JavaScript packages, and when an established package such as
ComplexHeatmaporsurvmineris the better choice
License
MIT. See LICENSE.