uniquifyFeatureNames: Make feature names unique

Description Usage Arguments Details Value Author(s) Examples

View source: R/uniquifyFeatureNames.R

Description

Combine a user-interpretable feature name (e.g., gene symbol) with a standard identifier that is guaranteed to be unique and valid (e.g., Ensembl) for use as row names.

Usage

1

Arguments

ID

A character vector of unique identifiers.

names

A character vector of feature names.

Details

This function will attempt to use names if it is unique. If not, it will append the _ID to any non-unique value of names. Missing names will be replaced entirely by ID.

The output is guaranteed to be unique, assuming that ID is also unique. This can be directly used as the row names of a SingleCellExperiment object.

Value

A character vector of unique-ified feature names.

Author(s)

Aaron Lun

Examples

1
2
3
4
uniquifyFeatureNames(
  ID=paste0("ENSG0000000", 1:5),
  names=c("A", NA, "B", "C", "A")
)

scuttle documentation built on Dec. 19, 2020, 2 a.m.