Draws a violin plot of single cell data (gene expression, metrics, PC scores, etc.)
VlnPlot( object, features, cols = NULL, pt.size = NULL, idents = NULL, sort = FALSE, assay = NULL, group.by = NULL, split.by = NULL, adjust = 1, y.max = NULL, same.y.lims = FALSE, log = FALSE, ncol = NULL, slot = "data", split.plot = FALSE, stack = FALSE, combine = TRUE, fill.by = "feature", flip = FALSE, add.noise = TRUE, raster = NULL )
Features to plot (gene expression, metrics, PC scores, anything that can be retreived by FetchData)
Colors to use for plotting
Point size for geom_violin
Which classes to include in the plot (default is all)
Sort identity classes (on the x-axis) by the average expression of the attribute being potted, can also pass 'increasing' or 'decreasing' to change sort direction
Name of assay to use, defaults to the active assay
Group (color) cells in different ways (for example, orig.ident)
A variable to split the violin plots by,
Adjust parameter for geom_violin
Maximum y axis value
Set all the y-axis limits to the same values
plot the feature axis on log scale
Number of columns if multiple plots are displayed
Slot to pull expression data from (e.g. "counts" or "data")
plot each group of the split violin plots by multiple or single violin shapes.
Horizontally stack plots for each feature
Combine plots into a single
ggplot object. If
FALSE, return a list of ggplot
Color violins/ridges based on either 'feature' or 'ident'
flip plot orientation (identities on x-axis)
determine if adding a small noise for plotting
Convert points to raster format. Requires 'ggrastr' to be installed.
patchworked ggplot object if
combine = TRUE; otherwise, a list of ggplot objects
data("pbmc_small") VlnPlot(object = pbmc_small, features = 'PC_1') VlnPlot(object = pbmc_small, features = 'LYZ', split.by = 'groups') #> The default behaviour of split.by has changed. #> Separate violin plots are now plotted side-by-side. #> To restore the old behaviour of a single split violin, #> set split.plot = TRUE. #> #> This message will be shown once per session.