This function merges pathway enrichment results obtained through various databases (GO, KEGG, Reactome). It applies similarity measures to find closely related pathways and categorizes them into modules.

merge_pathways_internal(
  pathway_result,
  p.adjust.cutoff = 0.05,
  count.cutoff = 5,
  database = c("go", "kegg", "reactome"),
  sim.cutoff = 0.5,
  measure.method = c("Wang", "Resnik", "Rel", "Jiang", "Lin", "TCSS", "jaccard"),
  path = "result",
  save_to_local = FALSE
)

Arguments

pathway_result

A required object containing results from the enrich_pathway function.

p.adjust.cutoff

Numeric, p-adjusted value cutoff for filtering enriched pathways.

count.cutoff

Numeric, count cutoff for filtering enriched pathways.

database

Character vector, the database from which the enrichment results were obtained ('go', 'kegg', 'reactome').

sim.cutoff

Numeric, similarity cutoff for clustering pathways.

measure.method

Character, method for calculating term similarity.

path

Character, directory to save intermediate and final results.

save_to_local

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

Value

A list containing graph_data, module_result, and result_with_module.

Author

Xiaotao Shen shenxt1990@outlook.com

Examples

if (FALSE) {
# Load pathway results obtained through `enrich_pathway` function
pathway_results <- load_pathway_results("path/to/results")

# Merge pathways and find modules
merged_results <- merge_pathways_internal(pathway_result = pathway_results)
}