This function plots a similarity network based on the given parameters. It can operate on different levels and databases, and provides options for text annotations.

plot_similarity_network(
  object,
  level = c("module", "functional_module"),
  database = c("go", "kegg", "reactome"),
  degree_cutoff = 0,
  module_id,
  text = TRUE,
  text_all = FALSE
)

Arguments

object

An object of class "functional_module" containing the necessary data for plotting.

level

A character string indicating the level of analysis, either "module" or "functional_module".

database

A character string indicating the database to be used, either "go", "kegg", or "reactome".

degree_cutoff

A numeric value indicating the degree cutoff for filtering nodes in the network.

module_id

Optional, a character or numeric vector of module IDs to include in the plot.

text

Logical, whether to include text annotations on the plot.

text_all

Logical, whether to include text annotations for all nodes.

Value

A ggplot object representing the similarity network.

Author

Xiaotao Shen shenxt1990@outlook.com

Examples

if (FALSE) {
# Assume `obj` is a prepared object containing relevant data
plot_similarity_network(obj, level = "module", database = "go")
plot_similarity_network(obj, level = "functional_module", degree_cutoff = 2)
}