TIL_barplot: Barplot of abundance estimates

Description Usage Arguments Value Examples

View source: R/TIL_barplot.R

Description

Draw barplot of the "betas" from a decon fit

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
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)

SpatialDecon documentation built on Nov. 8, 2020, 6 p.m.