Skip to contents

Automatically select the appropriate plotting function based on the number of rows in the catalog.

Usage

plot_guess(catalog, ...)

plot_guess_pdf(catalog, filename, ...)

Arguments

catalog

Numeric vector, single-column data.frame, matrix, tibble, or data.table. The number of rows (or length) determines which plotting function is used:

The column names of catalog are used as plot titles.

...

Additional arguments passed to the underlying plotting function.

filename

Character. Path to the output PDF file (plot_guess_pdf only).

Value

plot_guess() returns a ggplot object. plot_guess_pdf() returns NULL invisibly (called for side effect of creating a PDF file).

Details

plot_guess() plots a single sample. plot_guess_pdf() creates a multi-page PDF file containing plots for multiple samples, arranged with 5 samples per page (except heatmap types: 1 per page). Uses Cairo for high-quality PDF rendering.

Examples

# Auto-detect a 96-channel catalog and dispatch to plot_SBS96
set.seed(1)
sig <- runif(96)
sig <- sig / sum(sig)
names(sig) <- catalog_row_order()$SBS96
plot_guess(sig, plot_title = "Auto-detected SBS96")


if (FALSE) { # \dontrun{
sig <- matrix(runif(96 * 3), nrow = 96)
rownames(sig) <- catalog_row_order()$SBS96
colnames(sig) <- paste0("Sig", 1:3)
plot_guess_pdf(sig, filename = "auto_detected.pdf")
} # }