Skip to contents

Creates a violin plot to compare gene expression across different conditions or groups within a Seurat object. It incorporates Wilcoxon rank-sum tests to evaluate statistical differences between conditions. The plot can be customized with options for data transformation, jitter display, and significance annotations. The function also supports multiple conditions and allows for visualization of statistical results from wilcoxon test.

Usage

DO.VlnPlot(
  Seu_object,
  SeuV5 = T,
  Feature,
  ListTest = NULL,
  returnValues = FALSE,
  ctrl.condition = NULL,
  group.by = "condition",
  group.by.2 = NULL,
  geom_jitter_args = c(0.2, 0.25, 0.25),
  geom_jitter_args_group_by2 = c(0.1, 0.1, 1),
  vector_colors = c("#1f77b4", "#ea7e1eff", "royalblue4", "tomato2", "darkgoldenrod",
    "palegreen4", "maroon", "thistle3"),
  wilcox_test = T,
  stat_pos_mod = 1.15,
  hjust.wilcox = 0.8,
  vjust.wilcox = 2,
  size.wilcox = 3.33,
  step_mod = 0,
  hjust.wilcox.2 = 0.5,
  vjust.wilcox.2 = 0,
  sign_bar = 0.8
)

Arguments

Seu_object

combined Seurat object

SeuV5

Seuratv5 object? (TRUE or FALSE)

Feature

name of the feature

ListTest

List for which conditions wilcox will be performed, if NULL always CTRL group against everything

returnValues

return df.melt.sum data frame containing means and SEM for the set group

ctrl.condition

set your ctrl condition, relevant if running with empty comparison List

group.by

select the seurat Seu_object slot where your conditions can be found, default conditon

group.by.2

relevant for multiple group testing, e.g. for each cell type the test between each of them in two conditions provided

geom_jitter_args

vector for dots visualisation in vlnplot: size, width, alpha value

wilcox_test

Bolean if TRUE a bonferoni wilcoxon test will be carried out between ctrl.condition and the rest

stat_pos_mod

value for modifiyng statistics height

vector_colours

specify a minimum number of colours as you have entries in your condition, default 2

Value

a ggplot or a list used data frames

Author

Mariano Ruz Jurado

Examples

if (FALSE) { # \dontrun{

(optional)
ListTest <- list()
ListTest[[1]] <- c("CTRL", "CONDITION")

DO.VlnPlot(
  Seu_object = Seurat,
  SeuV5=T,
  Feature = "CDH5",
  ListTest = ListTest,
  ctrl.condition = "CTRL",
  group.by="condition"
)
} # }