plotDEheatmap_conos: Plot a heatmap of differential genes. Code is adapted from...

View source: R/get_prop_associations.R

plotDEheatmap_conosR Documentation

Plot a heatmap of differential genes. Code is adapted from Conos package. https://github.com/kharchenkolab/conos/blob/master/R/plot.R

Description

Plot a heatmap of differential genes. Code is adapted from Conos package. https://github.com/kharchenkolab/conos/blob/master/R/plot.R

Usage

plotDEheatmap_conos(
  con,
  groups,
  container,
  de = NULL,
  min.auc = NULL,
  min.specificity = NULL,
  min.precision = NULL,
  n.genes.per.cluster = 10,
  additional.genes = NULL,
  exclude.genes = NULL,
  labeled.gene.subset = NULL,
  expression.quantile = 0.99,
  pal = (grDevices::colorRampPalette(c("dodgerblue1", "grey95", "indianred1")))(1024),
  ordering = "-AUC",
  column.metadata = NULL,
  show.gene.clusters = TRUE,
  remove.duplicates = TRUE,
  column.metadata.colors = NULL,
  show.cluster.legend = TRUE,
  show_heatmap_legend = FALSE,
  border = TRUE,
  return.details = FALSE,
  row.label.font.size = 10,
  order.clusters = FALSE,
  split = FALSE,
  split.gap = 0,
  cell.order = NULL,
  averaging.window = 0,
  ...
)

Arguments

con

conos (or p2) object

groups

groups in which the DE genes were determined (so that the cells can be ordered correctly)

container

environment Project container that stores sub-containers for each cell type as well as results and plots from all analyses

de

differential expression result (list of data frames)

min.auc

optional minimum AUC threshold

min.specificity

optional minimum specificity threshold

min.precision

optional minimum precision threshold

n.genes.per.cluster

number of genes to show for each cluster

additional.genes

optional additional genes to include (the genes will be assigned to the closest cluster)

exclude.genes

an optional list of genes to exclude from the heatmap

labeled.gene.subset

a subset of gene names to show (instead of all genes). Can be a vector of gene names, or a number of top genes (in each cluster) to show the names for.

expression.quantile

expression quantile to show (0.98 by default)

pal

palette to use for the main heatmap

ordering

order by which the top DE genes (to be shown) are determined (default "-AUC")

column.metadata

additional column metadata, passed either as a data.frame with rows named as cells, or as a list of named cell factors.

show.gene.clusters

whether to show gene cluster color codes

remove.duplicates

remove duplicated genes (leaving them in just one of the clusters)

column.metadata.colors

a list of color specifications for additional column metadata, specified according to the HeatmapMetadata format. Use "clusters" slot to specify cluster colors.

show.cluster.legend

whether to show the cluster legend

show_heatmap_legend

whether to show the expression heatmap legend

border

show borders around the heatmap and annotations

return.details

if TRUE will return a list containing the heatmap (ha), but also raw matrix (x), expression list (expl) and other info to produce the heatmap on your own.

row.label.font.size

font size for the row labels

order.clusters

whether to re-order the clusters according to the similarity of the expression patterns (of the genes being shown)

split

logical If TRUE splits the heatmap by cell type (default=FALSE)

split.gap

numeric The distance to put in the gaps between split parts of the heatmap if split=TRUE (default=0)

cell.order

explicitly supply cell order

averaging.window

optional window averaging between neighboring cells within each group (turned off by default) - useful when very large number of cells shown (requires zoo package)

...

extra parameters are passed to pheatmap

Value

ComplexHeatmap::Heatmap object (see return.details param for other output)


scITD documentation built on Sept. 8, 2023, 5:11 p.m.