Create violin plot of gene expression data across groups

violinPlot(
  object,
  assay = "SCT",
  slot = "scale.data",
  group.by,
  group.subset = c(),
  genes.of.interest,
  filter.outliers = FALSE,
  scale.data = TRUE,
  log.scale.data = FALSE,
  reorder.ident = TRUE,
  rename.ident = "",
  ylimit = 0,
  plot.style = "grid",
  outlier.low.lim = 0.1,
  outlier.up.lim = 0.9,
  jitter.points = FALSE,
  jitter.width = 0.05,
  jitter.dot.size = 0.5,
  print.outliers = TRUE
)

Arguments

object

Seurat-class object

assay

Assay to extract gene expression data from (Default: SCT)

slot

Slot to extract gene expression data from (Default: scale.data)

group.by

Split violin plot based on metadata group

group.subset

Include only a specific subset from group.by

genes.of.interest

Genes to visualize on the violin plot

filter.outliers

Filter outliers from the data (TRUE/FALSE)

scale.data

Scale data from 0 to 1 (TRUE/FALSE)

log.scale.data

Transform data onto a log10 scale (TRUE/FALSE)

reorder.ident

Numeric data will be ordered naturally by default. Toggling this option will order the groups to match the group list if non-numeric, and will have no effect if otherwise.

rename.ident

Give alternative names to group.by displayed on the graph

ylimit

Y-axis limit

plot.style

Choose between grid, labeled, and row

outlier.low.lim

Filter lower bound outliers (Default = 0.1)

outlier.up.lim

Filter upper bound outliers (Default = 0.9)

jitter.points

Scatter points on the plot (TRUE/FALSE)

jitter.width

Set spread of jittered points

jitter.dot.size

Set size of individual points

print.outliers

Print outliers as points in your graph that may be redundant to jitter

Value

violin ggplot2 object

Details

Takes in a list of genes inputted by the user, displays violin plots of genes across groups from a slot-assay with (optional) outliers removed. Can also choose to scale or transform expression data.