get_levels_seu: Get Unique Levels of a Seurat Object Ident Slot

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

get_levels_seuR Documentation

Get Unique Levels of a Seurat Object Ident Slot

Description

This function extracts the unique levels present in the 'ident' slot of a Seurat object. The function throws an error if the number of levels exceeds 'max_levels'. The function optionally prints the R code to recreate the 'Levels' vector using 'dput'.

Usage

get_levels_seu(obj, ident, max_levels = 100, dput = TRUE)

Arguments

obj

A Seurat object.

ident

A character string representing the name of the slot in the Seurat object.

max_levels

An integer that sets the maximum number of levels allowed. Default is 100.

dput

A logical that decides whether to print the R code to recreate the 'Levels' vector. Default is TRUE.

Value

A vector of unique levels present in the 'ident' slot of the Seurat object.


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