Code for creating stacked violin plot gene expression.
Stacked_VlnPlot(
seurat_object,
features,
group.by = NULL,
split.by = NULL,
idents = NULL,
x_lab_rotate = FALSE,
plot_legend = FALSE,
colors_use = NULL,
color_seed = 123,
ggplot_default_colors = FALSE,
plot_spacing = 0.15,
spacing_unit = "cm",
vln_linewidth = NULL,
pt.size = NULL,
raster = NULL,
add.noise = TRUE,
...
)
Seurat object name.
Features to plot.
Group (color) cells in different ways (for example, orig.ident).
A variable to split the violin plots by,
Which classes to include in the plot (default is all).
logical or numeric. If logical whether to rotate x-axis labels 45 degrees (Default is FALSE). If numeric must be either 45 or 90. Setting 45 is equivalent to setting TRUE.
logical. Adds plot legend containing idents
to the returned plot.
specify color palette to used in VlnPlot
. 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
.
random seed for the "varibow" palette shuffle if colors_use = NULL
and number of
groups plotted is greater than 36. Default = 123.
logical. If colors_use = NULL
, Whether or not to return plot using
default ggplot2 "hue" palette instead of default "polychrome" or "varibow" palettes.
Numerical value specifying the vertical spacing between each plot in the stack.
Default is 0.15 ("cm"). Spacing dependent on unit provided to spacing_unit
.
Unit to use in specifying vertical spacing between plots. Default is "cm".
Adjust the linewidth of violin outline. Must be numeric.
Adjust point size for plotting. Default for Stacked_VlnPlot
is 0 to avoid issues with
rendering so many points in vector form. Alternatively, see raster
parameter.
Convert points to raster format. Default is NULL which will rasterize by default if greater than 100,000 total points plotted (# Cells x # of features).
logical, determine if adding a small noise for plotting (Default is TRUE).
Extra parameters passed to VlnPlot
.
A ggplot object