Perform GO/KEGG Enrichment Analysis for Multiple Clusters
enrichCluster(
object = NULL,
type = c("BP", "MF", "CC", "KEGG", "ownSet"),
TERM2GENE = NULL,
TERM2NAME = NULL,
OrgDb = NULL,
id.trans = TRUE,
fromType = "SYMBOL",
toType = c("ENTREZID"),
readable = TRUE,
organism = "hsa",
pvalueCutoff = 0.05,
topn = 5,
seed = 5201314,
add.gene = FALSE,
heatmap.type = c("plot_pseudotime_heatmap2", "plot_genes_branched_heatmap2",
"plot_multiple_branches_heatmap2"),
...
)
a data.frame.
An object containing clustering results.
This is clusterData object. Alternatively, it can be a CellDataSet
object, in which case the function can also visualize pseudotime data.
Character. The type of enrichment analysis to perform. Options include:
"BP"
: Biological Process (GO)
"MF"
: Molecular Function (GO)
"CC"
: Cellular Component (GO)
"KEGG"
: KEGG Pathway analysis
"ownSet"
: Custom gene set enrichment, requiring TERM2GENE
and optionally TERM2NAME
.
A data frame containing mappings of terms to genes. Required when type = "ownSet"
.
This must be a two-column data frame, where the first column is the term and the second column is the gene.
A data frame containing term-to-name mappings. Optional when type = "ownSet"
.
This must also be a two-column data frame, where the first column is the term and the second column is the name.
An organism database object (e.g., org.Hs.eg.db
for human or org.Mm.eg.db
for mouse),
used for GO or KEGG enrichment analysis.
Logical. Whether to perform gene ID transformation. Default is TRUE
.
Character. The type of the input gene IDs (e.g., "SYMBOL"
, "ENSEMBL"
). Default is "SYMBOL"
.
Character. The target ID type for transformation using clusterProfiler::bitr
(e.g., "ENTREZID"
). Default is "ENTREZID"
.
Logical. Whether to convert the enrichment result IDs back to a readable format (e.g., SYMBOL).
Only applicable for GO and KEGG analysis. Default is TRUE
.
Character. The KEGG organism code (e.g., "hsa"
for human, "mmu"
for mouse). Required when
performing KEGG enrichment. Default is "hsa"
.
Numeric. The p-value cutoff for enriched terms to be included in the results. Default is 0.05
.
Integer or vector. The number of top enrichment results to extract. If a single value, it is applied
to all clusters. Otherwise, it should match the number of clusters. Default is 5
.
Numeric. Seed for random operations to ensure reproducibility. Default is 5201314
.
Logical. Whether to include the list of genes associated with each enriched term in the results.
Default is FALSE
.
Character. The type of heatmap visualization to use when input data is a CellDataSet
object.
Options include:
"plot_pseudotime_heatmap2"
"plot_genes_branched_heatmap2"
"plot_multiple_branches_heatmap2"
Additional arguments passed to plot_pseudotime_heatmap2/plot_genes_branched_heatmap2/plot_multiple_branches_heatmap2 functions.
JunZhang
This function performs Gene Ontology (GO) or KEGG enrichment analysis, or custom gene set enrichment, on clustered genes. It supports multiple clusters, incorporating cluster-specific results into its analysis.