% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/GeneSetAnalysisGO.R,
%   R/GeneSetAnalysisReactome.R
\name{FilterGOTerms}
\alias{FilterGOTerms}
\alias{FilterReactomeTerms}
\title{Filter GO/Reactome Gene Sets}
\usage{
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{
\item{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.}

\item{spe}{Species, either 'human' or 'mouse'. Default: getOption("spe").}

\item{n.min}{Minimum number of genes in the gene set. Default: 1.}

\item{n.max}{Maximum number of genes in the gene set. Default: Inf.}

\item{only.end.terms}{Boolean indicating whether only return the end-level pathways or gene sets. Default: FALSE.}

\item{change.name}{Boolean indicating whether to change the gene set names. Default: FALSE.}

\item{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.
}
\description{
Subset gene sets based on GO/Reactome IDs.
}
\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)
}
