DefaultDimReduc: Set Default Dimensionality Reduction Set the default...

View source: R/utils.R

DefaultDimReduc<-R Documentation

Set Default Dimensionality Reduction Set the default dimensionality reduction for a specific assay in a Seurat object.

Description

Searches for DimReducs matching “umap”, “tsne”, or “pca”, case-insensitive, and in that order. Priority given to DimReducs matching the DefaultAssay or assay specified (eg. “pca” for the default assay weights higher than “umap” for a non-default assay)

Usage

DefaultDimReduc(object, ...) <- value

DefaultDimReduc(object, assay = NULL)

## S3 replacement method for class 'Seurat'
DefaultDimReduc(object, ...) <- value

Arguments

object

A Seurat object

...

Arguments passed to other methods

value

Character string specifying the name of the dimensionality reduction to set as default. Set to NULL to clear the default for the current assay.

assay

Name of assay to use; defaults to the default assay of the object

Details

This function stores the default dimensionality reduction on a per-assay basis. This function only needs to be run if users want to override the default DimReduc selection logic that Seurat employs. When 'DefaultDimReduc()' is called, it will return the assay-specific default if one has been set. If none was explicitly set then default Seurat logic will be used to select default.

Value

A Seurat object with the default dimensionality reduction updated.

The default DimReduc, if possible

Examples

DefaultDimReduc(pbmc_small)

## Not run: 
# Set UMAP as default for RNA assay
DefaultDimReduc(seurat_obj) <- "umap"

# Clear the set default
DefaultDimReduc(seurat_obj) <- NULL

## End(Not run)

SeuratObject documentation built on April 11, 2026, 9:06 a.m.