A convenient way to extract gene names.

getGenes(
  object,
  of_gene_sets = NULL,
  similar_to = NULL,
  top_n = 25,
  simplify = TRUE,
  ...
)

getGenesInteractive(object)

Arguments

object

An object of class spata2.

of_gene_sets

A character vector specifying the gene sets from which to return the gene names.

similar_to

Character value. If specified, n genes with the highest spatial correlation similarity to the specified gene are returned where n is equal to the input for argument top_n.

top_n

Numeric value. Denotes the number of genes to be returned if argument similar_to is specified.

simplify

Logical. If set to TRUE the output list is simplified to a vector if possible. If set to FALSE a list is returned.

...

Used to absorb deprecated arguments or functions.

Value

A list of character vectors or a single character vector.

Details

If neither of_gene_sets nor similar_to is specified all genes found in the active expression matrix are returned in a character vector.

If of_gene_sets is specified a list named according to the input of of_gene_sets is returned in which each element is a character vector containing the names of genes the specific gene set is composed of. Is simplified to a vector if simplify is set to TRUE.

If of_gene_sets is not specified but argument similar_to is a gene name a character vector of genes featuring the highest similarity to the specified gene is returned. The number of genes depends on the input of argument top_n.