clUMAP: clUMAP - Quick Visualization of Clustering Results with UMAP...

View source: R/Seurat.Utils.Visualization.R

clUMAPR Documentation

clUMAP - Quick Visualization of Clustering Results with UMAP and automatically save the plot

Description

Generates a UMAP visualization based on clustering results from a Seurat object, and automatically saves it. Offers options for custom titles, subtitles, saving, and more. Assumes default options for custom titles, subtitles, saving, and more.

Usage

clUMAP(
  ident = NULL,
  obj = combined.obj,
  title = ident,
  sub = NULL,
  prefix = NULL,
  suffix = make.names(sub),
  caption = .parseBasicObjStats(obj, simple = TRUE),
  reduction = "umap",
  splitby = NULL,
  label.cex = 7,
  h = 7,
  w = NULL,
  nr.cols = NULL,
  plotname = ppp(toupper(reduction), ident),
  cols = NULL,
  palette = c("alphabet", "alphabet2", "glasbey", "polychrome", "stepped")[4],
  max.cols.for.std.palette = 7,
  highlight.clusters = NULL,
  cells.highlight = NULL,
  cols.highlight = "red",
  sizes.highlight = 1,
  label = TRUE,
  repel = TRUE,
  legend = !label,
  legend.pos = NULL,
  MaxCategThrHP = 200,
  axes = NULL,
  aspect.ratio = c(FALSE, 0.6)[2],
  save.plot = MarkdownHelpers::TRUE.unless("b.save.wplots", v = FALSE),
  PNG = TRUE,
  check_for_2D = TRUE,
  ...
)

Arguments

ident

Cluster identity for visualization; Default: 'integrated_snn_res.0.5'.

obj

Seurat object containing single-cell data; Default: combined.obj.

title

Main title of the plot; Default: ident.

sub

Subtitle of the plot; optional; Default: NULL.

prefix

Prefix for saved filename; optional; Default: NULL.

suffix

Suffix for saved filename; defaults to plot subtitle; Default: NULL.

caption

Plot caption; optional; Default: dynamically generated from obj.

reduction

Dimension reduction method ('umap', 'tsne', 'pca'); Default: 'umap'.

splitby

Metadata column to split cells by; optional; Default: NULL.

label.cex

Size of cluster labels; Default: 7.

h

Height of plot in inches; Default: 7.

w

Width of plot in inches; optional; Default: NULL.

nr.cols

Number of columns for facet wrap if splitby is not NULL; Default: NULL.

plotname

Custom plot name for saving; Default: dynamically generated from reduction and ident.

cols

Custom color vector for clusters; optional; Default: NULL.

palette

Color palette for generating cluster colors; Default: 'glasbey'.

highlight.clusters

Specific clusters to be highlighted; optional; Default: NULL.

cells.highlight

Specific cells to be highlighted; optional; Default: NULL.

cols.highlight

Color for highlighted cells; Default: 'red'.

sizes.highlight

Size of highlighted cells; Default: 1.

label

Show cluster labels; Default: TRUE.

repel

Repel labels to avoid overlap; Default: TRUE.

legend

Show legend; Default: opposite of label.

legend.pos

Position of legend; Default: 'NULL'.

MaxCategThrHP

Maximum number of categories before simplification; Default: 200.

axes

Show axes; Default: FALSE.

aspect.ratio

Fixed aspect ratio for the plot; Default: TRUE.

save.plot

Save plot to file; Default: TRUE.

PNG

Save as PNG (TRUE) or PDF (FALSE); Default: TRUE.

check_for_2D

Ensure UMAP is 2D; Default: TRUE.

...

Additional parameters for DimPlot.

Examples

## Not run: 
clUMAP(ident = "integrated_snn_res.0.5", obj = yourSeuratObj)
clUMAP(ident = "integrated_snn_res.0.5", obj = yourSeuratObj, cols = RColorBrewer::brewer.pal(8, "Dark2"))

## End(Not run)


vertesy/Seurat.utils documentation built on Dec. 4, 2024, 5:20 p.m.