enrichCluster: Perform GO/KEGG Enrichment Analysis for Multiple Clusters

View source: R/3.enrichCluster.R

enrichClusterR Documentation

Perform GO/KEGG Enrichment Analysis for Multiple Clusters

Description

Perform GO/KEGG Enrichment Analysis for Multiple Clusters

Usage

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"),
  ...
)

Arguments

object

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.

type

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.

TERM2GENE

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.

TERM2NAME

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.

OrgDb

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.

id.trans

Logical. Whether to perform gene ID transformation. Default is TRUE.

fromType

Character. The type of the input gene IDs (e.g., "SYMBOL", "ENSEMBL"). Default is "SYMBOL".

toType

Character. The target ID type for transformation using clusterProfiler::bitr (e.g., "ENTREZID"). Default is "ENTREZID".

readable

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.

organism

Character. The KEGG organism code (e.g., "hsa" for human, "mmu" for mouse). Required when performing KEGG enrichment. Default is "hsa".

pvalueCutoff

Numeric. The p-value cutoff for enriched terms to be included in the results. Default is 0.05.

topn

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.

seed

Numeric. Seed for random operations to ensure reproducibility. Default is 5201314.

add.gene

Logical. Whether to include the list of genes associated with each enriched term in the results. Default is FALSE.

heatmap.type

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.

Value

a data.frame.

Author(s)

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.


ClusterGVis documentation built on April 4, 2025, 2:27 a.m.