dot-check_and_rename: Check and Rename Gene Names in Seurat Assay Object

.check_and_renameR Documentation

Check and Rename Gene Names in Seurat Assay Object

Description

This function renames rows (genes) in a specified slot of a Seurat assay object. It supports slots storing data as either a dense or a sparse matrix (dgCMatrix) or data.frame.

Usage

.check_and_rename(obj, assay, newnames, layer.name)

Arguments

obj

A Seurat object.

assay

An Assay name in a Seurat object.

newnames

A character vector of new gene names to be assigned.

layer.name

A string specifying the slot in the Assay object to be updated. Valid options typically include 'counts', 'data', or 'scale.data'.

Value

An Assay object with updated gene names in the specified slot.

Examples

## Not run: 
# Assuming 'seurat_obj' is a Seurat object and 'new_gene_names' is a vector of gene names
updated_assay <- check_and_rename(
  assayobj = seurat_obj[["RNA"]],
  newnames = new_gene_names,
  layer.name = "counts"
)

## End(Not run)

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