
Dot plot split by a metadata variable with numbered group labels
SplitDotPlot.RdGenerates a dot plot where dot color encodes scaled average expression and dot size encodes percent of cells expressing each gene. Cell groups (y-axis) are numbered and can be hierarchically clustered. Genes (x-axis) are grouped by a gene-metadata column and faceted accordingly.
Usage
SplitDotPlot(
seurat_object,
markers_df,
gene_column = "Genes",
gene_group_column = "CellType",
group.by = "seurat_clusters",
split.by = NULL,
gene_col = NULL,
gene_group_col = NULL,
ClusterFeatures = FALSE,
col.min = 0,
col.max = 2.5,
scale.min = 5,
scale.max = 100,
dot.scale = 6,
cols = "RdBu",
output_dir = NULL,
file_name = NULL
)Arguments
- seurat_object
A Seurat object.
- markers_df
A data frame containing at least two columns: gene names and gene group labels.
- gene_column
Character. Column in
markers_dfwith gene names. Default"Genes".- gene_group_column
Character. Column in
markers_dfwith gene group labels (used for x-axis faceting). Default"CellType".- group.by
Character. Metadata column for the y-axis (cell groups). Default
"GlobalAssignment".- split.by
Character or
NULL. Metadata column to split rows by.NULLshows all groups together. Default"CancerType".- gene_col
Deprecated alias for
gene_column. Ignored whengene_columnis set explicitly.- gene_group_col
Deprecated alias for
gene_group_column. Ignored whengene_group_columnis set explicitly.- ClusterFeatures
Logical. Hierarchically cluster cell groups (y-axis)? Default
FALSE.- col.min, col.max
Numeric. Color scale clamp limits for scaled average expression. Defaults
0and2.5.- scale.min, scale.max
Numeric. Size scale clamp limits for percent expressed. Defaults
5and100.- dot.scale
Numeric. Maximum dot radius. Default
6.- cols
Ignored (kept for API compatibility). Color palette is viridis plasma.
- output_dir
Character or
NULL. Directory to save a PDF.NULL(default) returns the plot without saving. WhenNULL, the function walks up to theoutput_dirstored byPrepObject, unlessAutoSavePlots = FALSEwas set there.- file_name
Character or
NULL. Base name (no extension) for the saved PDF.NULL(default) auto-generates a name that includes themarkers_dfvariable name (when detectable) followed bygroup.byandsplit.by, e.g.<markers>_<group.by>_<split.by>_SplitDotPlot, so different groupings and splits never overwrite each other.