Skip to contents

Like SplitDotPlot2() but accepts genes via a character vector or a regex pattern, and can slice the gene dendrogram into k_genes labeled panels using cutree().

Usage

FastDotPlot(
  seurat_object,
  assay = "RNA",
  features = NULL,
  pattern = NULL,
  group.by = "seurat_clusters",
  split.by = NULL,
  ClusterGroups = FALSE,
  ClusterGenes = TRUE,
  k_genes = 1,
  min.pct.exp = 15,
  col.min = 0,
  col.max = 2.5,
  scale.min = 5,
  scale.max = 100,
  dot.scale = 6,
  output_dir = NULL,
  file_name = NULL
)

Arguments

seurat_object

A Seurat object.

assay

Character. Assay to use. Default "RNA".

features

Character vector of gene names, or NULL if using pattern.

pattern

Character regex. All matching genes in rownames(seurat_object) are used. Ignored if features is provided.

group.by

Character. Metadata column for y-axis. Default "GlobalAssignment".

split.by

Character or NULL. Metadata column for row facets.

ClusterGroups

Logical. Cluster y-axis groups? Default FALSE.

ClusterGenes

Logical. Cluster genes on x-axis? Default TRUE.

k_genes

Integer. Number of gene clusters (panels) to cut the dendrogram into. 1 = no cutting (single panel). Default 1.

min.pct.exp

Numeric. Minimum percent expression threshold. Default 15.

col.min, col.max

Numeric. Color clamp limits. Defaults 0, 2.5.

scale.min, scale.max

Numeric. Size clamp limits. Defaults 5, 100.

dot.scale

Numeric. Max dot radius. Default 6.

output_dir

Character or NULL. Directory to save a PDF. NULL (default) returns the plot without saving. When NULL, the function walks up to the output_dir stored by PrepObject, unless AutoSavePlots = FALSE was set there.

file_name

Character or NULL. Base name (no extension) for the saved PDF. NULL (default) auto-generates a name that includes the gene pattern (when used) followed by group.by and split.by, e.g. <pattern>_<group.by>_<split.by>_FastDotPlot, so different groupings and splits never overwrite each other.

Value

A ggplot2 object (invisibly when saved to disk).