TIL_barplot {SpatialDecon} | R 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)

[Package SpatialDecon version 1.4.3 Index]