Collapse Multienrichment clusters

collapse_mem_clusters(
  mem,
  clusters,
  choose = NULL,
  per_cluster = Inf,
  byCols = c("composite_rank", "minp_rank", "gene_count_rank"),
  return_type = c("cnet", "mem"),
  max_labels = 4,
  max_nchar_labels = 25,
  include_cluster_title = TRUE,
  cluster_color_min_fraction = 0.5,
  verbose = FALSE,
  ...
)

Arguments

cluster_color_min_fraction

numeric value between 0 and 1 used to define the cnet colors for each cluster. The number of significant pathways is calculated per cluster for each enrichment using mem$enrichIMcolors, and the fraction of significant pathways versus the max number per enrichment is used to filter. For example a cluster with 10 pathways, might have 8 significant pathways in one enrichment result, and 3 significant pathways in another enrichment result. The fraction for each enrichment is 8/8 == 1 for the first enrichment, and 3/8 = 0.375 for the second enrichment. When cluster_color_min_fraction=0.5 (default) the first enrichment color would be included, but not the second enrichment color. The intent is to represent enrichment colors that have at least half (0.5) the pathways of the most representative (max) enrichment color. Therefore, a cluster with only one significant pathway from a given enrichment would typically not be representive of that enrichment, and its enrichment color would not be included.

Value

By default return_type="cnet" and this function returns an augmented Cnet plot. The labels of each cluster are defined by the input names(clusters), however an igraph attribute "set_labels" includes an abbreviated label of the top ranked sets for each cluster. This label is probably the closest thing to summarizing the composition of each cluster.

Details

This function is similar to rank_mem_clusters() in that it starts with mem results from multiEnrichMap() and a list of clusters of pathways/sets. Instead of ranking and choosing exemplars from each clusters, it simply collapses each cluster into one super-set that contains union of all genes.

It does also run rank_mem_clusters() in the event one would want to collapse only the top per_cluster entries for each cluster, but the default is to include them all.