plot_heatmap: Plot the heatmap of single cell dataset

Description Usage Arguments Value

View source: R/visualization.R

Description

Plot the heatmap of single cell dataset

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
plot_heatmap(
  dataset,
  markers,
  sort_var = c("seurat_clusters"),
  n = 8,
  anno_var,
  anno_colors,
  hm_limit = c(-2, 0, 2),
  hm_colors = c("#4575b4", "white", "#d73027"),
  row_font_size = 12
)

Arguments

dataset

A Seurat object.

markers

A dataframe - the dataframe generated by FindAllMarkers function in Seurat;

Or a character vector - the names of genes can be directly specified.

sort_var

A character vector - the variables to be sorted in the heatmap, should exist in the metadata of the dataset.

n

An integer - number of genes to be plotted for each seurat_cluster. This parameter will not be used if the markers are directly specified.

anno_var

A character vector - the variables in the annotation, should exist in the metadata of the dataset.

anno_colors

A list - the color specification of annotation bars. The length should be the same as anno_var, with each list element corresponding to each variable.

For a numeric variable, the element can be the name of a sequential or divergent palette in RColorBrewer. Please use brewer.pal.info for more information. It can also be a character vector of three color values, corresponding to the min, median, and max values of the numeric variable.

For a categorical variable, the element can be the names of palettes in RColorBrewer. Multiple palettes can be specified, in case of many levels to be colored. It can also be a character vector of colors, corresponding to the levels in the categorical variable. Hence, the number of colors specified should be at least the number of levels (unique values) in the categorical variable.

hm_limit

A numeric vector - three numeric values that dictate the lowest limit, midpoint, and highest limit of the color gradient. These three values correspond to the colors specified in the hm_colors.

hm_colors

A character vector of length 3 - three colors corresponding to the lowest limit, midpoint, and highest limit specified in hm_colors.

row_font_size

An integer - the font size of row names.

Value

A plot.


xmc811/Scillus documentation built on April 26, 2021, 1:41 a.m.