SingleImagePlot: Single Spatial Plot

View source: R/visualization.R

SingleImagePlotR Documentation

Single Spatial Plot

Description

Single Spatial Plot

Usage

SingleImagePlot(
  data,
  col.by = NA,
  col.factor = TRUE,
  cols = NULL,
  shuffle.cols = FALSE,
  size = 0.1,
  molecules = NULL,
  mols.size = 0.1,
  mols.cols = NULL,
  mols.alpha = 1,
  alpha = molecules %iff% 0.3 %||% 0.6,
  border.color = "white",
  border.size = NULL,
  na.value = "grey50",
  dark.background = TRUE,
  ...
)

Arguments

data

A data frame with at least the following columns:

  • x”: Spatial-resolved x coordinates, will be plotted on the y-axis

  • y”: Spatially-resolved y coordinates, will be plotted on the x-axis

  • cell”: Cell name

  • boundary”: Segmentation boundary label; when plotting multiple segmentation layers, the order of boundary transparency is set by factor levels for this column

Can pass NA to data suppress segmentation visualization

col.by

Name of column in data to color cell segmentations by; pass NA to suppress coloring

col.factor

Are the colors a factor or discrete?

cols

Colors for cell segmentations; can be one of the following:

  • NULL for default ggplot2 colors

  • A numeric value or name of a color brewer palette

  • Name of a palette for DiscretePalette

  • A vector of colors equal to the length of unique levels of data$col.by

shuffle.cols

Randomly shuffle colors when a palette or vector of colors is provided to cols

size

Point size for cells when plotting centroids

molecules

A data frame with spatially-resolved molecule coordinates; should have the following columns:

  • x”: Spatial-resolved x coordinates, will be plotted on the y-axis

  • y”: Spatially-resolved y coordinates, will be plotted on the x-axis

  • molecule”: Molecule name

mols.size

Point size for molecules

mols.cols

A vector of color for molecules. The "Set1" palette from RColorBrewer is used by default.

mols.alpha

Alpha value for molecules, should be between 0 and 1

alpha

Alpha value, should be between 0 and 1; when plotting multiple boundaries, alpha is equivalent to max alpha

border.color

Color of cell segmentation border; pass NA to suppress borders for segmentation-based plots

border.size

Thickness of cell segmentation borders; pass NA to suppress borders for centroid-based plots

na.value

Color value for NA segmentations when using custom scale

...

Ignored

Value

A ggplot object


Seurat documentation built on Nov. 18, 2023, 1:10 a.m.