Learn R Programming

Seurat (version 3.1.4)

VlnPlot: Single cell violin plot

Description

Draws a violin plot of single cell data (gene expression, metrics, PC scores, etc.)

Usage

VlnPlot(
  object,
  features,
  cols = NULL,
  pt.size = 1,
  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",
  multi.group = FALSE,
  combine = TRUE
)

Arguments

object

Seurat object

features

Features to plot (gene expression, metrics, PC scores, anything that can be retreived by FetchData)

cols

Colors to use for plotting

pt.size

Point size for geom_violin

idents

Which classes to include in the plot (default is all)

sort

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

assay

Name of assay to use, defaults to the active assay

group.by

Group (color) cells in different ways (for example, orig.ident)

split.by

A variable to split the violin plots by,

adjust

Adjust parameter for geom_violin

y.max

Maximum y axis value

same.y.lims

Set all the y-axis limits to the same values

log

plot the feature axis on log scale

ncol

Number of columns if multiple plots are displayed

slot

Use non-normalized counts data for plotting

multi.group

plot each group of the split violin plots by multiple or single violin shapes see FetchData for more details

combine

Combine plots into a single patchworked ggplot object. If FALSE, return a list of ggplot objects

Value

A patchworked ggplot object if combine = TRUE; otherwise, a list of ggplot objects

See Also

FetchData

Examples

Run this code
# NOT RUN {
VlnPlot(object = pbmc_small, features = 'PC_1')
VlnPlot(object = pbmc_small, features = 'LYZ', split.by = 'groups')

# }

Run the code above in your browser using DataLab