Skip to contents

Build a Ro/e (observed / expected) matrix from single-cell metadata and, optionally, save a heatmap.

Usage

leo.ROIE(
  srt,
  filter_col = NULL,
  filter_criteria = NULL,
  anno_col = "cell_anno",
  group_col = "Stage1",
  group_col_order = NULL,
  plot = FALSE,
  plot_path = NULL,
  col_fun = NULL,
  width = NULL,
  height = NULL,
  fontsize = 6,
  heatmap_anno = c("num", "+++", "none"),
  sym_break = c(-Inf, 0.1, 1, 2, 3, Inf),
  ...
)

Arguments

srt

seurat object

filter_col

column used to subset (optional)

filter_criteria

values kept in filter_col

anno_col

row group column; default "cell_anno"

group_col

column group column; default "Stage1"

group_col_order

column order in heatmap; auto if NULL (based on the level of group_col if it is a factor)

plot

save heatmap if TRUE

plot_path

PDF path; default "./ROIE.pdf"

col_fun

colour scale: Defaut orange style or redblue

width, height

device size; auto when NULL

fontsize

Font size for cell annotations (default 10).

heatmap_anno

"num", "+++, or "none"

sym_break

numeric breakpoints; only two presets supported –> c(-Inf,.1,1,2,3,Inf) or c(-Inf,0,.2,.8,1,Inf)

...

Passed to ComplexHeatmap::Heatmap.

Value

Ro/e matrix

Examples

if (FALSE) { # \dontrun{
roe <- leo.ROIE(all, filter_col = 'lineage', filter_criteria = c('DC'), fontsize = 4,
                anno_col = 'cell_anno', group_col = 'Stage1', col_fun = "redblue",
                plot = TRUE, plot_path = "./figure/sc/celltype_analysis/dc.roe.pdf",
                heatmap_anno = "+++", border = NA, rect_gp = gpar(col = NA))
head(roe)
} # }