Skip to contents

This function plots a violin plot from a Seurat object.

Usage

plot_violin(
  sobj,
  feature = "percent.mt",
  feature_slot = "data",
  feature_thresh = 0,
  group_by = "orig.ident",
  col_by = NULL,
  col_slot = "data",
  col_color = NULL,
  pt_size = 2,
  text_size = 17,
  add_noise = FALSE,
  x_label_angle = 0
)

Arguments

sobj

: a Seurat object

feature

CHARACTER : gene (or meta.data information) to make to violin plot for (default to "percent.mt")

feature_slot

CHARACTER : slot to pull feature for (default to "data")

feature_thresh

NUMERIC : numeric threshold to compute the proportion of positive cells (default to 0)

group_by

CHARACTER : factor to group cells by (default to "orig.ident")

col_by

CHARACTER : gene (or meta.data information) to color points (cells) by (default to NULL)

col_slot

CHARACTER : slot to pull col_by for (default to "data")

col_color

VECTOR : a character vector to color cells with, according to col_by value (default to aquarius::palette_GrOrBl if col_by is not NULL, and "black" otherwise)

pt_size

NUMERIC : point size (default to 2)

text_size

NUMERIC : text size (default to 17)

add_noise

LOGICAL : whether to add a negative noise when cells have 0 for feature. This could helps when a lot of cells have 0 and one wants to look at col_by level in those cells (default to FALSE)

x_label_angle

NUMERIC : angle to rotate axis.text.x. It is useful when group_by levels are long, and x_label_angle = 45 gives good result (default to 0)

Value

A ggplot object