Skip to contents

Returns a character vector of gene names matching any combination of chromosome, biotype, or name pattern filters. Requires AnnotateFeatures() to have been run first.

Usage

GetFeatures(
  seurat_object,
  chromosome = NULL,
  gene_biotype = NULL,
  pattern = NULL,
  assay = NULL,
  invert = FALSE
)

Arguments

seurat_object

A Seurat object with feature annotations.

chromosome

Numeric or character vector of chromosomes to keep, e.g. 1:19, c("X","Y"), "MT". Both "1" and "chr1" are accepted. NULL keeps all chromosomes.

gene_biotype

Character vector of Ensembl biotype(s) to keep, e.g. "protein_coding", c("protein_coding","lncRNA"). NULL keeps all.

pattern

Character. Regular expression matched against gene names. NULL skips pattern filtering.

assay

Character. Which assay's feature metadata to use.

invert

Logical. Return genes that do NOT match the filters. Default FALSE.

Value

A character vector of gene names passing all filters.