setRowNames: Set rownames of SCE with a character vector or a rowData...

View source: R/miscFunctions.R

setRowNamesR Documentation

Set rownames of SCE with a character vector or a rowData column

Description

Users can set rownames of an SCE object with either a character vector where the length equals to nrow(x), or a single character specifying a column in rowData(x). Also applicable to matrix like object where rownames<- method works, but only allows full size name vector. Users can set dedup = TRUE to remove duplicated entries in the specification, by adding -1, -2, ..., -i suffix to the duplication of the same identifier.

Usage

setRowNames(x, rowNames, dedup = TRUE)

Arguments

x

Input object where the rownames will be modified.

rowNames

Character vector of the rownames. If x is an SingleCellExperiment object, a single character specifying a column in rowData(x).

dedup

Logical. Whether to deduplicate the specified rowNames. Default TRUE

Value

The input SCE object with rownames updated.

Examples

data("scExample", package = "singleCellTK")
head(rownames(sce))
sce <- setRowNames(sce, "feature_name")
head(rownames(sce))

compbiomed/singleCellTK documentation built on Feb. 10, 2024, 3:32 a.m.