pbHeatmap: Heatmap of cluster-sample pseudobulks

Description Usage Arguments Value Author(s) Examples

View source: R/pbHeatmap.R

Description

...

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
pbHeatmap(
  x,
  y,
  k = NULL,
  g = NULL,
  c = NULL,
  top_n = 20,
  fdr = 0.05,
  lfc = 1,
  sort_by = "p_adj.loc",
  decreasing = FALSE,
  assay = "logcounts",
  fun = mean,
  normalize = TRUE,
  col = viridis(10),
  row_anno = TRUE,
  col_anno = TRUE
)

Arguments

x

a SingleCellExperiment.

y

a list of DS analysis results as returned by pbDS or mmDS.

k

character vector; specifies which cluster ID(s) to retain. Defaults to levels(x$cluster_id).

g

character vector; specifies which genes to retain. Defaults to considering all genes.

c

character string; specifies which contrast/coefficient to retain. Defaults to names(y$table)[1].

top_n

single numeric; number of genes to retain per cluster.

fdr, lfc

single numeric; FDR and logFC cutoffs to filter results by. The specified FDR threshold is applied to p_adj.loc values.

sort_by

character string specifying a numeric results table column to sort by; "none" to retain original ordering.

decreasing

logical; whether to sort in decreasing order of sort_by.

assay

character string; specifies which assay to use; should be one of assayNames(x).

fun

function to use as summary statistic, e.g., mean, median, sum (depending on the input assay).

normalize

logical; whether to apply a z-normalization to each row (gene) of the cluster-sample pseudobulk data.

col

character vector of colors or color mapping function generated with colorRamp2. Passed to argument col in Heatmap (see ?ComplexHeatmap::Heatmap for details).

row_anno, col_anno

logical; whether to render annotations of cluster and group IDs, respectively.

Value

a HeatmapList-class object.

Author(s)

Helena L Crowell

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
data(sce)

# compute pseudobulks & run DS analysis
pb <- aggregateData(sce)
res <- pbDS(pb)

# cluster-sample expression means
pbHeatmap(sce, res)

# include only a single cluster
pbHeatmap(sce, res, k = "B cells")

# plot specific gene across all clusters
pbHeatmap(sce, res, g = "ISG20")

muscat documentation built on Nov. 8, 2020, 7:47 p.m.