% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/run_clusterProfiler_GO.R
\name{run_clusterProfiler_GO}
\alias{run_clusterProfiler_GO}
\title{Runs clusterProfiler GO enrichment function for a DEG list or for a ranked gene list.}
\usage{
run_clusterProfiler_GO(
  input_genes,
  background_genes = "",
  file_name = NULL,
  ordered_query = FALSE,
  id_type = "ENSEMBL",
  ontology = "BP",
  OrgDb = "org.Hs.eg.db",
  pvalueCutoff = 0.05,
  min_set_size = 10,
  max_set_size = 1000,
  min_overlap = 2,
  pAdjustMethod = "BH",
  similarity_filtering = FALSE,
  rng.seed = NULL
)
}
\arguments{
\item{input_genes}{A character vector of gene IDs (ORA) or a named,
ordered vector of fold changes of ALL genes with gene IDs as names (GSEA).}

\item{background_genes}{A character vector of background gene IDs. If not specified, by default uses all human genes
annotated to term domain.}

\item{file_name}{A character string used as a file name.}

\item{ordered_query}{If set to TRUE, computes GSEA-style p-values for an input ranked gene list.}

\item{id_type}{By default uses "ENSEMBL". Can be any ID type that is supported by the corresponding OrgDb.}

\item{ontology}{A vector of ontology types to use. One of the following:
GO:BP = GO Biological Process
GO:MF = GO Molecular Function
GO:CC = GO Cellular Component}

\item{OrgDb}{Organism annotation package, by default uses "org.Hs.eg.db".}

\item{pvalueCutoff}{Adjusted p-value cut-off.}

\item{min_set_size}{Minimum size of the functional category, uses 10 by default.}

\item{max_set_size}{Maximum size of the functional category, uses 1000 by default.}

\item{min_overlap}{Minimum size of the overlap (intersection) between query and functional category,
smaller intersections are excluded. By default uses 2.}

\item{pAdjustMethod}{The algorithm used for multiple testing correction, one of
"holm", "hochberg", "hommel", "bonferroni", "BH", "BY", "fdr", "none". By default uses "BH".}

\item{similarity_filtering}{Similarity filtering method, either FALSE (default) or TRUE (uses simplify function).}

\item{rng.seed}{Optional integer. If supplied, \code{set.seed()} is called with this value before
the permutation-based gene set enrichment analysis, making the result reproducible. Defaults to
\code{NULL}, i.e. the random number generator is left untouched, so that the function does not
alter the state of the user's session. Note that this is distinct from the \code{seed} argument
of \code{clusterProfiler::gseGO()}/\code{gseKEGG()}, which controls that package's own internal seeding.}
}
\value{
A table listing statistically significant enrichment results according to threshold set in pvalueCutoff
       The table is also saved in xlsx format with user-specified name.
}
\description{
Runs clusterProfiler GO enrichment function for a DEG list or for a ranked gene list.
}
\examples{
\donttest{
if (requireNamespace("org.Hs.eg.db", quietly = TRUE)) {
  genes <- c("ENSG00000141510", "ENSG00000012048", "ENSG00000139618")
  # wrapped in tryCatch(): the result depends on the installed annotation database
  go <- tryCatch(run_clusterProfiler_GO(input_genes = genes, ontology = "BP",
                                        OrgDb = "org.Hs.eg.db", id_type = "ENSEMBL"),
                 error = function(e) {
                   message("GO enrichment could not be run: ", conditionMessage(e))
                   NULL
                 })
}
}
}
