This function performs enrichment analysis on various databases such as GO, KEGG, and Reactome. It's a generic function that dispatches to specific methods based on the class of the 'object' parameter.

enrich_pathway(
  variable_info,
  database = c("go", "kegg", "reactome"),
  save_to_local = FALSE,
  path = "result",
  OrgDb,
  organism = "hsa",
  keyType = "ENTREZID",
  use_internal_data = FALSE,
  ont = "ALL",
  pvalueCutoff = 0.05,
  pAdjustMethod = "BH",
  universe_go = NULL,
  universe_kegg = NULL,
  universe_reactome = NULL,
  qvalueCutoff = 0.2,
  minGSSize = 10,
  maxGSSize = 500,
  readable = FALSE,
  pool = FALSE,
  ...
)

Arguments

variable_info

A data.frame containing relevant gene information or an object that has a specific method for enrich_pathway.

database

Character vector, specify which database(s) to use for enrichment ('go', 'kegg', 'reactome').

save_to_local

Logical, if TRUE the results will be saved to local disk.

path

Character, the directory where to save the results if save_to_local is TRUE.

OrgDb

Object, the OrgDb object required for GO enrichment.

organism

Character, the organism code.

keyType

Character, the type of key to be used.

use_internal_data

Logical, whether to use internal data for KEGG enrichment.

ont

Character, the ontology to be used for GO enrichment ('ALL', 'BP', 'CC', 'MF').

pvalueCutoff

Numeric, the p-value cutoff for enrichment.

pAdjustMethod

Character, the method for adjusting p-values.

universe_go

Numeric vector, the universe for GO enrichment.

universe_kegg

Numeric vector, the universe for KEGG enrichment.

universe_reactome

Numeric vector, the universe for Reactome enrichment.

qvalueCutoff

Numeric, the q-value cutoff for enrichment.

minGSSize

Numeric, the minimum gene set size for enrichment.

maxGSSize

Numeric, the maximum gene set size for enrichment.

readable

Logical, whether to make the results more human-readable.

pool

Logical, whether to use clusterProfiler's pooling feature.

...

Additional arguments passed to the underlying methods.

Value

An object containing the enrichment results and parameters.

Author

Xiaotao Shen shenxt1990@outlook.com

Examples

if (FALSE) {
data(demo_data)

variable_info <-
  demo_data %>%
  massdataset::activate_mass_dataset(what = "variable_info") %>%
  dplyr::filter(fdr < 0.05 & score > 0) %>%
  massdataset::extract_variable_info()
require(org.Hs.eg.db)
enriched_pathways <-
  enrich_pathway(
    variable_info = variable_info,
    save_to_local = FALSE,
    path = "result",
    OrgDb = org.Hs.eg.db,
    organism = "hsa",
    database = c("kegg", "reactome"),
    ont = "ALL",
    pvalueCutoff = 0.05,
    pAdjustMethod = "BH",
    qvalueCutoff = 0.2,
    minGSSize = 10,
    maxGSSize = 500,
    readable = FALSE,
    pool = FALSE
  )
  }