heatmap_plot: Tailored heatmap plot

View source: R/utils_plot.R

heatmap_plotR Documentation

Tailored heatmap plot

Description

Heatmap plot showing marker genes after the clustering process. Expression levels are taken from the scaled.data slot. Current implementation is 'hard' coded: that is for heatmap column annotation, it assumes the Seurat object contains 'condition', 'sample' and 'seurat_clusters' as columns in meta.data slot.

Usage

heatmap_plot(
  seu,
  markers,
  topn_genes = 10,
  diff_cluster_pct = 0.1,
  pval_adj = 0.05,
  filename = NULL,
  col_pal = NULL,
  heatmap_downsample_cols = NULL,
  ...
)

Arguments

seu

Seurat object (required).

markers

Data frame with marker genes for each cluster. Expects a format as the output of Seurat's FindAllMarkers.

topn_genes

Top N marker genes to plot for each cluster.

diff_cluster_pct

Retain marker genes per cluster if their pct.1 - pct.2 > diff_cluster_pct, i.e. they show cluster specific expression. Set to -Inf, to ignore this additional filtering.

pval_adj

Adjusted p-value threshold to consider marker genes per cluster.

filename

Filename for saving the heatmap plot. If null, the heatmap is just plotted in device.

col_pal

Discrete colour palette to use, default is Hue palette (hue_pal) from 'scales' package.

heatmap_downsample_cols

If numberic, it will downsamples the columns of the heatmap plot, so a big specific cluster doesn't dominate the heatmap.

...

Additional parameters passed to 'pheatmap' function

Value

A ggplot2 object.

Author(s)

C.A.Kapourani C.A.Kapourani@ed.ac.uk


andreaskapou/SeuratPipe documentation built on Nov. 22, 2022, 4:16 p.m.