Plots the proportion of cells belonging to each identity in active.ident of Seurat object. Can plot either the totals or split by a variable in meta.data.

Proportion_Plot(
  seurat_object,
  plot_type = "bar",
  plot_scale = "percent",
  group_by_var = "ident",
  split.by = NULL,
  num_columns = NULL,
  x_lab_rotate = FALSE,
  colors_use = NULL,
  ggplot_default_colors = FALSE,
  color_seed = 123
)

Arguments

seurat_object

Seurat object name.

plot_type

whether to plot a pie chart or bar chart; value must be one of "bar" or "pie". Default is "bar"

plot_scale

whether to plot bar chart as total cell counts or percents, value must be one of "percent" or "count". Default is "percent".

group_by_var

meta data column to classify samples (default = "ident" and will use active.ident.

split.by

meta data variable to use to split plots. Default is NULL which will plot across entire object.

num_columns

number of columns in plot. Only valid if split.by is not NULL.

x_lab_rotate

Rotate x-axis labels 45 degrees (Default is FALSE). Only valid if plot_type = "bar".

colors_use

color palette to use for plotting.

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.

Value

ggplot2 or patchwork object

Examples

#' library(Seurat)
Proportion_Plot(seurat_object = pbmc_small)