This function plots a bar chart representing enriched pathways, modules, or functional modules. The bars are colored according to the database of origin.

plot_pathway_bar(
  object,
  top_n = 10,
  y_lable_width = 50,
  level = c("pathway", "module", "functional_module"),
  p.adjust.cutoff = 0.05,
  count.cutoff = 5,
  database_color = c(GO = "#1F77B4FF", KEGG = "#FF7F0EFF", Reactome = "#2CA02CFF"),
  database = c("go", "kegg", "reactome")
)

Arguments

object

An object containing the enrichment results and other relevant data.

top_n

An integer specifying the top N pathways to display.

y_lable_width

An integer specifying the width of the Y-axis labels.

level

A character string specifying the level of analysis. One of "pathway", "module", or "functional_module".

p.adjust.cutoff

A numeric value for the FDR adjusted P-value cutoff.

count.cutoff

A numeric value for the count cutoff.

database_color

A named vector containing the colors for different databases.

database

A character vector specifying which databases to include in the plot. Should be "go", "kegg", or/and "reactome".

Value

A ggplot object representing the bar chart.

Author

Xiaotao Shen shenxt1990@outlook.com

Examples

if (FALSE) {
# Assume `obj` is an object containing the relevant data
plot_pathway_bar(obj, top_n = 5, level = "pathway")
plot_pathway_bar(obj, top_n = 10, level = "module", p.adjust.cutoff = 0.05)
}