Skip to contents

Generate visualizations of CytoSPACER cell assignment results.

Usage

plot_cytospace(
  results,
  type = c("cell_types", "by_spot", "density"),
  coordinates = NULL,
  point_size = 1,
  alpha = 0.8,
  jitter = 0,
  max_cells = 50000,
  ncol = 3,
  colors = NULL,
  title = NULL
)

Arguments

results

Results from run_cytospace.

type

Type of plot to generate:

"cell_types"

Cell type spatial distribution (default)

"by_spot"

Cell counts per spot, faceted by cell type

"density"

Density of cell assignments

coordinates

Optional coordinates data.frame.

point_size

Size of points. Default is 1.

alpha

Point transparency. Default is 0.8.

jitter

Amount of jitter to add. Default is 0.

max_cells

Maximum cells to plot. Default is 50000.

ncol

Number of columns for faceted plots. Default is 3.

colors

Named vector of colors per cell type.

title

Plot title.

Value

A ggplot2 object.

Examples

if (FALSE) { # \dontrun{
results <- run_cytospace(...)
plot_cytospace(results, type = "cell_types")
plot_cytospace(results, type = "cell_types", jitter = 0.3)
} # }