Skip to contents

Great for sanity checking, to make sure that differentially expressed genes as reported through DE gene analysis metrics (such as DESeq2) are reflected in gene expression data per sample.

Usage

plot_DEgene_boxplot(
  data,
  anno,
  anno_sig,
  anno_type = NULL,
  sig_DE,
  genes = NULL,
  metric = "sign_log_p",
  pval = FALSE,
  genes_n = 6,
  colors = NULL,
  title = NULL,
  savename = NULL,
  height = 8,
  width = 8
)

Arguments

data

df/string; (path to) numeric gene expression matrix, rownames = genes, colnames = samples

anno

df/string; (path to) annotation table, rownames = samples, columns = metadata

anno_sig

string; colname in anno to be used as breaks for x-axis

anno_type

string; colname in anno to be used to color jitter points by

sig_DE

df/string, optional; (path to) DE(seq) gene results table

genes

char vector; list of genes to plot, must be present in data

metric

string; colname in sig_DE to rank genes by for auto gene selection if genes not provided and for appending to gene name in parens

pval

logical; use t.test pvalue annotation via ggsignif::stat_signif

genes_n

integer; if genes not provided, get top/bottom genes_n

colors

char vector; jitter point colors, length == # of unique anno_types

title

string; plot title

savename

string; file path to save plot under

height

numeric; plot height

width

numeric; plot width

Value

ggplot object, with facet-wrapped boxplot

Details

Providing DE(seq) gene signature (sig_DE) is optional; if not provided, genes list must be defined. If DE gene info is provided, each subplot's title will have the metric value appended in parenthesis.