Subset gene sets based on GO/Reactome IDs.

FilterGOTerms(
  term = NULL,
  spe = getOption("spe"),
  n.min = 1,
  n.max = Inf,
  only.end.terms = F,
  change.name = F,
  parent = NULL
)

FilterReactomeTerms(
  term = NULL,
  spe = getOption("spe"),
  n.min = 1,
  n.max = Inf,
  only.end.terms = F,
  change.name = F,
  parent = NULL
)

Arguments

term

GO/Reactome IDs, either as a character vector or matrix (with IDs in rownames). If NULL, the function will filter from the entire database.

spe

Species, either 'human' or 'mouse'. Default: getOption("spe").

n.min

Minimum number of genes in the gene set. Default: 1.

n.max

Maximum number of genes in the gene set. Default: Inf.

only.end.terms

Boolean indicating whether only return the end-level pathways or gene sets. Default: FALSE.

change.name

Boolean indicating whether to change the gene set names. Default: FALSE.

parent

ID or name of the parent (top-level) gene set in the GO/Reactome database. Default: NULL.

Value

Returns a character vector or matrix, depending on the input.

Examples

library(SeuratExtend)
options(max.print = 10, spe = "human")

# Filter GO terms. For instance, select pathways under the category GO:0002376 (immune system process).
terms <- FilterGOTerms(parent = "GO:0002376")
RenameGO(terms)

# If you want to further restrict the number of genes in a pathway to be between 10 and 1000,
# you can adjust the n.min and n.max parameters.
terms2 <- FilterGOTerms(term = terms, n.min = 10, n.max = 1000)
RenameGO(terms2)

# To only return the end-level pathways, set the only.end.terms parameter to TRUE.
terms3 <- FilterGOTerms(term = terms, only.end.terms = TRUE)
RenameGO(terms3)

# Filter Reactome terms. For example, select pathways under the category R-HSA-168256 (Immune System).
terms <- FilterReactomeTerms(parent = "R-HSA-168256")
RenameReactome(terms)