Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

DoHeatmap

Feature expression heatmap


Description

Draws a heatmap of single cell feature expression.

Usage

DoHeatmap(
  object,
  features = NULL,
  cells = NULL,
  group.by = "ident",
  group.bar = TRUE,
  group.colors = NULL,
  disp.min = -2.5,
  disp.max = NULL,
  slot = "scale.data",
  assay = NULL,
  label = TRUE,
  size = 5.5,
  hjust = 0,
  angle = 45,
  raster = TRUE,
  draw.lines = TRUE,
  lines.width = NULL,
  group.bar.height = 0.02,
  combine = TRUE
)

Arguments

object

Seurat object

features

A vector of features to plot, defaults to VariableFeatures(object = object)

cells

A vector of cells to plot

group.by

A vector of variables to group cells by; pass 'ident' to group by cell identity classes

group.bar

Add a color bar showing group status for cells

group.colors

Colors to use for the color bar

disp.min

Minimum display value (all values below are clipped)

disp.max

Maximum display value (all values above are clipped); defaults to 2.5 if slot is 'scale.data', 6 otherwise

slot

Data slot to use, choose from 'raw.data', 'data', or 'scale.data'

assay

Assay to pull from

label

Label the cell identies above the color bar

size

Size of text above color bar

hjust

Horizontal justification of text above color bar

angle

Angle of text above color bar

raster

If true, plot with geom_raster, else use geom_tile. geom_raster may look blurry on some viewing applications such as Preview due to how the raster is interpolated. Set this to FALSE if you are encountering that issue (note that plots may take longer to produce/render).

draw.lines

Include white lines to separate the groups

lines.width

Integer number to adjust the width of the separating white lines. Corresponds to the number of "cells" between each group.

group.bar.height

Scale the height of the color bar

combine

Combine plots into a single patchworked ggplot object. If FALSE, return a list of ggplot objects

Value

A patchworked ggplot object if combine = TRUE; otherwise, a list of ggplot objects

Examples

data("pbmc_small")
DoHeatmap(object = pbmc_small)

Seurat

Tools for Single Cell Genomics

v4.0.1
GPL-3 | file LICENSE
Authors
Andrew Butler [ctb] (<https://orcid.org/0000-0003-3608-0463>), Saket Choudhary [ctb] (<https://orcid.org/0000-0001-5202-7633>), Charlotte Darby [ctb] (<https://orcid.org/0000-0003-2195-5300>), Jeff Farrell [ctb], Christoph Hafemeister [ctb] (<https://orcid.org/0000-0001-6365-8254>), Yuhan Hao [ctb] (<https://orcid.org/0000-0002-1810-0822>), Paul Hoffman [aut, cre] (<https://orcid.org/0000-0002-7693-8957>), Jaison Jain [ctb] (<https://orcid.org/0000-0002-9478-5018>), Efthymia Papalexi [ctb] (<https://orcid.org/0000-0001-5898-694X>), Patrick Roelli [ctb], Rahul Satija [ctb] (<https://orcid.org/0000-0001-9448-8833>), Karthik Shekhar [ctb], Avi Srivastava [ctb] (<https://orcid.org/0000-0001-9798-2079>), Tim Stuart [ctb] (<https://orcid.org/0000-0002-3044-0897>), Kristof Torkenczy [ctb] (<https://orcid.org/0000-0002-4869-7957>), Shiwei Zheng [ctb] (<https://orcid.org/0000-0001-6682-6743>), Satija Lab and Collaborators [fnd]
Initial release
2021-03-17

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.