Creates SpatialDimPlot with some of the settings modified from their Seurat defaults (colors_use).

SpatialDimPlot_scCustom(
  seurat_object,
  group.by = NULL,
  images = NULL,
  colors_use = NULL,
  crop = TRUE,
  label = FALSE,
  label.size = 7,
  label.color = "white",
  label.box = TRUE,
  repel = FALSE,
  ncol = NULL,
  pt.size.factor = 1.6,
  alpha = c(1, 1),
  image.alpha = 1,
  stroke = 0.25,
  interactive = FALSE,
  combine = TRUE,
  ggplot_default_colors = FALSE,
  color_seed = 123,
  ...
)

Arguments

seurat_object

Seurat object name.

group.by

Name of meta.data column to group the data by

images

Name of the images to use in the plot(s)

colors_use

color palette to use for plotting. By default if number of levels plotted is less than or equal to 36 it will use "polychrome" and if greater than 36 will use "varibow" with shuffle = TRUE both from DiscretePalette_scCustomize.

crop

Crop the plot in to focus on points plotted. Set to FALSE to show entire background image.

label

Whether to label the clusters

label.size

Sets the size of the labels

label.color

Sets the color of the label text

label.box

Whether to put a box around the label text (geom_text vs geom_label)

repel

Repels the labels to prevent overlap

ncol

Number of columns if plotting multiple plots

pt.size.factor

Scale the size of the spots.

alpha

Controls opacity of spots. Provide as a vector specifying the min and max for SpatialFeaturePlot. For SpatialDimPlot, provide a single alpha value for each plot.

image.alpha

Adjust the opacity of the background images. Set to 0 to remove.

stroke

Control the width of the border around the spots

interactive

Launch an interactive SpatialDimPlot or SpatialFeaturePlot session, see ISpatialDimPlot or ISpatialFeaturePlot for more details

combine

Combine plots into a single gg object; note that if TRUE; themeing will not work when plotting multiple features/groupings

ggplot_default_colors

logical. If colors_use = NULL, Whether or not to return plot using default ggplot2 "hue" palette instead of default "polychrome" or "varibow" palettes.

color_seed

random seed for the "varibow" palette shuffle if colors_use = NULL and number of groups plotted is greater than 36. Default = 123.

...

Extra parameters passed to DimPlot.

Value

A ggplot object

References

Many of the param names and descriptions are from Seurat to facilitate ease of use as this is simply a wrapper to alter some of the default parameters https://github.com/satijalab/seurat/blob/master/R/visualization.R (License: GPL-3).

Examples

if (FALSE) {
SpatialDimPlot_scCustom(seurat_object = seurat_object)
}