which_genes_regex: Get indices of genes whose annotation matches a regex.

View source: R/sce.R

which_genes_regexR Documentation

Get indices of genes whose annotation matches a regex.

Description

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

## Not run: 
# Indices of mitochondrial genes.
which_genes_regex(sce, regex = "^MT-", colname = "Symbol", ignore_case = TRUE)

## End(Not run)


bioinfocz/scdrake documentation built on Sept. 19, 2024, 4:43 p.m.