This method provides a heatmap of single cell data from a Seurat object given a set of genes and optionally orders by various metadata and/or gene or protein expression levels. Method is based on ComplexHeatmap::pheatmap

heatmapSC(
  object,
  sample.names,
  metadata,
  transcripts,
  proteins = NULL,
  heatmap.color = "Bu Yl Rd",
  plot.title = "Heatmap",
  add.gene.or.protein = FALSE,
  protein.annotations = NULL,
  rna.annotations = NULL,
  arrange.by.metadata = TRUE,
  add.row.names = TRUE,
  add.column.names = FALSE,
  row.font = 5,
  col.font = 5,
  legend.font = 5,
  row.height = 15,
  set.seed = 6,
  scale.data = TRUE,
  trim.outliers = TRUE,
  trim.outliers.percentage = 0.01,
  order.heatmap.rows = FALSE,
  row.order = c()
)

Arguments

object

Seurat-class object

sample.names

Sample names

metadata

Metadata column to plot

transcripts

Transcripts to plot

proteins

Proteins to plot (default is NULL)

heatmap.color

Color for heatmap. Choices are "Cyan to Mustard", "Blue to Red", "Red to Vanilla", "Violet to Pink", "Bu Yl Rd", "Bu Wt Rd" (default is "Bu Yl Rd")

plot.title

Title of plot (default is "Heatmap")

add.gene.or.protein

Add Gene or protein annotations (default is FALSE)

protein.annotations

Protein annotations to add (defulat is NULL)

rna.annotations

Gene annotations to add (default is NULL)

arrange.by.metadata

Arrange by metadata (default is TRUE)

add.row.names

Add row names (default is TRUE)

add.column.names

Add column names (default is FALSE)

row.font

Font size for rows (default is 5)

col.font

Font size for columns (default is 5)

legend.font

Font size for legend (default is 5)

row.height

Height of row. If NA, adjust to plot size (default is 15)

set.seed

Seed for colors (default is 6)

scale.data

Perform z-scaling on rows (default is TRUE)

trim.outliers

Remove outlier data (default is TRUE)

trim.outliers.percentage

Set outlier percentage (default is 0.01)

order.heatmap.rows

Order heatmap rows (default is FALSE)

row.order

Gene vector to set row order. If NULL, use cluster order (default is NULL)

Value

This function returns a heatmap plot and the data underlying the heatmap.