AutoNumber.by.UMAP: Relabel Cluster Numbers Along a UMAP (or tSNE) Axis

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

AutoNumber.by.UMAPR Documentation

Relabel Cluster Numbers Along a UMAP (or tSNE) Axis

Description

Automatically renumbers clusters based on their position along a specified dimension in a UMAP (or tSNE or PCA) plot, potentially enhancing interpretability by ordering clusters.

Usage

AutoNumber.by.UMAP(
  obj = combined.obj,
  reduction = "umap",
  dim = 1,
  swap = FALSE,
  ident = GetClusteringRuns(obj = obj)[1],
  plot = TRUE,
  obj.version = obj@version
)

Arguments

obj

Seurat object containing clustering and UMAP (or other dimensional reduction) data; Default: combined.obj.

reduction

Dimension reduction technique used for cluster positioning ('umap', 'tsne', or 'pca'); Default: 'umap'.

dim

Dimension along which to order clusters (1 for the first dimension, typically horizontal); Default: 1.

swap

If TRUE, reverses the ordering direction; Default: FALSE.

ident

Clustering resolution identifier used to fetch cluster labels from obj metadata; Default: 'integrated_snn_res.0.5'.

plot

If TRUE, plots the UMAP with new cluster names; Default: TRUE.

Examples

## Not run: 
combined.obj <- AutoNumber.by.UMAP(
  obj = combined.obj, dim = 1, reduction = "umap",
  ident = "integrated_snn_res.0.5"
)
DimPlot.ClusterNames(combined.obj, ident = GetClusteringRuns(combined.obj)[1])

## End(Not run)


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