Skip to contents

Without from and to, every cell is shown, coloured by its cell type. With them, the density of all cells is shown in blue, with the from and to cells on top. With r, a circle of radius r is drawn around each to cell: the from cells inside the circles are those that spicyR counts. Several images are drawn side by side, on the same scale.

Usage

plotImage(
  cells,
  imageToPlot,
  from = NULL,
  to = NULL,
  imageID = "imageID",
  cellType = "cellType",
  spatialCoords = c("x", "y"),
  r = NULL
)

Arguments

cells

A SummarizedExperiment object.

imageToPlot

The ID of the image to plot, or several IDs.

from

The "from" cell type. Optional, with to.

to

The "to" cell type. Optional, with from.

imageID

The name of the imageID column in the SummarizedExperiment object.

cellType

The name of the cellType column in the SummarizedExperiment object.

spatialCoords

The names of the spatialCoords column if using a SingleCellExperiment.

r

Optional radius: draw a circle of this radius around each to cell.

Value

A ggplot object.

Examples

data("diabetesData")
plotImage(diabetesData, "A09")

plotImage(diabetesData, "A09", from = "acinar", to = "alpha")

plotImage(diabetesData, "A09", from = "acinar", to = "alpha", r = 50)

plotImage(diabetesData, c("A09", "A11"), from = "acinar", to = "alpha")