Draws a heatmap focusing on a transcriptional state. Both cells and genes are sorted by their proportions of counts in a given transcriptional state. Allows for nice visualization of co-expression of those genes grouped into transcriptional states by Celda.

moduleHeatmap(counts, celda.mod, feature.module = 1, top.cells = NULL,
  top.features = NULL, normalize = TRUE, scale.row = scale,
  show_featurenames = TRUE)

Arguments

counts

Integer matrix. Rows represent features and columns represent cells. This matrix should be the same as the one used to generate `celda.mod`.

celda.mod

Celda object of class "celda_G" or "celda_CG".

feature.module

Integer. The feature module to display.

top.cells

Integer. Number of cells with the highest and lowest probabilities for this module to plot. For example, if `top.cells` = 50, the 50 cells with the lowest probability and the 50 cells with the highest probability for that feature module will be plotted. If NULL, all cells will be plotted. Default NULL.

top.features

Integer. Plot `top.features` with the highest probability in the feature module. If NULL, plot all features in the module. Default NULL.

normalize

Logical. Whether to normalize the columns of `counts`. Default TRUE.

scale.row

Character. Which function to use to scale each individual row. Set to NULL to disable. Occurs after normalization and log transformation. 'scale' will Z-score transform each row. Default 'scale'.

show_featurenames

Logical. Specifies if feature names should be shown. Default TRUE.

Examples

celda.sim = simulateCells("celda_CG") celda.mod = celda_CG(celda.sim$counts, K=celda.sim$K, L=celda.sim$L, nchains=1, max.iter=1)
#> --------------------------------------------------------------------
#> Starting Celda_CG: Clustering cells and genes.
#> --------------------------------------------------------------------
#> Thu Sep 06 12:57:18 2018 .. Initializing chain 1 with 'random' (seed=12345)
#> Thu Sep 06 12:57:18 2018 .... Determining if any cell clusters should be split.
#> Thu Sep 06 12:57:19 2018 .... Cluster 4 was reassigned and cluster 3 was split in two.
#> Thu Sep 06 12:57:19 2018 .... Determining if any gene clusters should be split.
#> Thu Sep 06 12:57:19 2018 .... Cluster 2 was reassigned and cluster 9 was split in two.
#> Thu Sep 06 12:57:19 2018 .... Completed iteration: 1 | logLik: -1272652.93151523
#> Thu Sep 06 12:57:19 2018 .. Finished chain 1 with seed 12345
#> --------------------------------------------------------------------
#> Completed Celda_CG. Total time: 0.7365789 secs
#> --------------------------------------------------------------------
moduleHeatmap(celda.sim$counts, celda.mod)
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character
#> Warning: supplied color is neither numeric nor character