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
)
Seurat object name.
whether to plot a pie chart or bar chart; value must be one of "bar"
or "pie"
. Default
is "bar"
whether to plot bar chart as total cell counts or percents, value must be one of "percent"
or
"count"
. Default is "percent"
.
meta data column to classify samples (default = "ident" and will use active.ident
.
meta data variable to use to split plots. Default is NULL which will plot across entire object.
number of columns in plot. Only valid if split.by
is not NULL.
Rotate x-axis labels 45 degrees (Default is FALSE). Only valid if plot_type = "bar"
.
color palette to use for plotting.
logical. If colors_use = NULL
, Whether or not to return plot using
default ggplot2 "hue" palette instead of default "polychrome" or "varibow" palettes.
random seed for the "varibow" palette shuffle if colors_use = NULL
and number of
groups plotted is greater than 36. Default = 123.
ggplot2 or patchwork object
#' library(Seurat)
Proportion_Plot(seurat_object = pbmc_small)