TIL_barplot: Barplot of abundance estimates

View source: R/TIL_barplot.R

TIL_barplotR Documentation

Barplot of abundance estimates

Description

Draw barplot of the "betas" from a decon fit

Usage

TIL_barplot(mat, draw_legend = FALSE, main = "", col = NULL, ...)

Arguments

mat

Matrix of cell proportions or abundances, in the same dimensions output by spatialdecon (cells in rows, observations in columns). User is free to re-order columns/observations in whatever order is best for display.

draw_legend

Logical. If TRUE, the function draws a legend in a new plot frame.

main

Title for barplot

col

Vector of colors for cell types. Defaults to pre-set colors for the safeTME cell types.

...

Arguments passed to barplot()

Value

Draws a barplot.

Examples

data(mini_geomx_dataset)
data(safeTME)
# estimate background:
mini_geomx_dataset$bg <- derive_GeoMx_background(
  norm = mini_geomx_dataset$normalized,
  probepool = rep(1, nrow(mini_geomx_dataset$normalized)),
  negnames = "NegProbe"
)
# run basic decon:
res0 <- spatialdecon(
  norm = mini_geomx_dataset$normalized,
  bg = mini_geomx_dataset$bg,
  X = safeTME
)
# run barplot:
TIL_barplot(mat = res0$beta)
# run barplot and draw a color legend
TIL_barplot(mat = res0$beta, draw_legend = TRUE)

Nanostring-Biostats/SpatialDecon documentation built on Jan. 26, 2024, 8:20 p.m.