Skip to contents

Get indices of genes whose annotation matches a regex.

Usage

which_genes_regex(sce, regex, colname = "Symbol", ignore_case = TRUE)

Arguments

sce

A SingleCellExperiment object.

regex

A character scalar.

colname

A character scalar: name of column in rowData(sce) whose values will be tested by regex.

ignore_case

A logical scalar: if TRUE, ignore case in regex.

Value

An integer vector: indices of rowData(sce) matching the regex.

Examples

if (FALSE) {
# Indices of mitochondrial genes.
which_genes_regex(sce, regex = "^MT-", colname = "Symbol", ignore_case = TRUE)
}