Skip to contents

Rename features for the Seurat object

Usage

RenameFeatures(
  object,
  newnames = NULL,
  assays = NULL,
  verbose = TRUE,
  srt = NULL
)

Arguments

object

A Seurat object.

newnames

One name per feature in the first selected assay, or a character vector named by old feature IDs. Unnamed vectors require the selected assays to have the same feature IDs.

assays

Assays to rename (all assays by default). Standard Seurat v3 and v5 assays are supported. Rename features before fitting reductions that rely on those features.

verbose

Whether to print the message. Default is TRUE.

srt

Deprecated alias for object; supply exactly one of the two. It will be removed in scop 1.0.0.

Details

Previously computed results stored in the object are not rewritten.

Examples

data(panc8_sub)
head(rownames(panc8_sub))
#> [1] "A1CF"   "A4GALT" "AAAS"   "AACS"   "AADAC"  "AADAT" 
# Simply convert genes from human to mouse and preprocess the data
genenames <- make.unique(
  thisutils::capitalize(rownames(panc8_sub),
    force_tolower = TRUE
  )
)
names(genenames) <- rownames(panc8_sub)
panc8_rename <- RenameFeatures(
  panc8_sub,
  newnames = genenames
)
#> ℹ [2026-12-03 11:50:44] Rename features for the assay: RNA
head(rownames(panc8_rename))
#> [1] "A1cf"   "A4galt" "Aaas"   "Aacs"   "Aadac"  "Aadat"