Skip to contents

Builds boxplots of log2 fold changes for selected genes and comparisons, optionally adding statistics.

Usage

get_foldchange_boxplot(
  x,
  genes = NULL,
  sample_comparisons = NULL,
  facet_by = c("auto", "comparison", "none"),
  p.label = "p.signif",
  stats_group = FALSE,
  stats_method = "t.test"
)

Arguments

x

A VISTA object containing differential expression results.

genes

Optional character vector of gene IDs to include.

sample_comparisons

Optional character vector of comparison names to plot.

facet_by

Faceting mode: "auto" (default), "comparison", or "none".

p.label

Label type passed to ggpubr::stat_compare_means().

stats_group

Logical; add pairwise statistical tests when TRUE.

stats_method

Statistical method passed to ggpubr::stat_compare_means().

Value

An object returned by this function.

Examples

v <- example_vista()
comp <- names(comparisons(v))[1]
genes <- head(as.character(comparisons(v)[[comp]]$gene_id), 10)
p <- get_foldchange_boxplot(v, sample_comparison = comp, genes = genes)
print(p)