collapse_mem_clusters: Collapse Multienrichment clusters

collapse_mem_clustersR Documentation

Collapse Multienrichment clusters

Description

Collapse Multienrichment clusters

Usage

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.

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.

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.

See Also

Other jam utility functions: avg_angles(), avg_colors_by_list(), call_fn_ellipsis_deprecated(), cell_fun_bivariate(), colorRamp2D(), deconcat_df2(), display_colorRamp2D(), enrichList2geneHitList(), filter_mem_genes(), filter_mem_sets(), find_colname(), get_igraph_layout(), gsubs(), handle_igraph_param_list(), isColorBlank(), make_legend_bivariate(), make_point_hull(), mem_find_overlap(), order_colors(), rank_mem_clusters(), rotate_coordinates(), subgraph_jam(), subset_mem(), summarize_node_spacing(), xyAngle()


jmw86069/multienrichjam documentation built on Feb. 7, 2024, 12:58 a.m.