dedupRowNames: Deduplicate the rownames of a matrix or SingleCellExperiment...

View source: R/miscFunctions.R

dedupRowNamesR Documentation

Deduplicate the rownames of a matrix or SingleCellExperiment object

Description

Adds '-1', '-2', ... '-i' to multiple duplicated rownames, and in place replace the unique rownames, store unique rownames in rowData, or return the unique rownames as character vecetor.

Usage

dedupRowNames(x, as.rowData = FALSE, return.list = FALSE)

Arguments

x

A matrix like or /linkS4classSingleCellExperiment object, on which we can apply rownames() to and has duplicated rownames.

as.rowData

Only applicable when x is a /linkS4classSingleCellExperiment object. When set to TRUE, will insert a new column called "rownames.uniq" to rowData(x), with the deduplicated rownames.

return.list

When set to TRUE, will return a character vector of the deduplicated rownames.

Value

By default, a matrix or /linkS4classSingleCellExperiment object with rownames deduplicated. When x is a /linkS4classSingleCellExperiment and as.rowData is set to TRUE, will return x with rowData updated. When return.list is set to TRUE, will return a character vector with the deduplicated rownames.

Examples

data("scExample", package = "singleCellTK")
sce <- dedupRowNames(sce)

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