Skip to contents

Convert multiEnrichMap mem output to EnrichmentMap emap

Usage

mem2emap(
  mem,
  overlap = 0.2,
  p_cutoff = NULL,
  min_count = NULL,
  colorV = NULL,
  cluster_function = igraph::cluster_walktrap,
  cluster_list = NULL,
  num_keep_terms = 3,
  keep_terms_sep = ",\n",
  repulse = 3.3,
  remove_singlets = FALSE,
  color_by_nodes = FALSE,
  apply_direction = TRUE,
  direction_max = 2,
  direction_floor = 0.5,
  seed = 123,
  do_plot = FALSE,
  verbose = FALSE,
  ...
)

Arguments

mem

Mem or legacy list mem output from multiEnrichMap()

overlap

numeric, default 0.2, value between 0 and 1 with Jaccard overlap coefficient required between any two pathways in order to create a network edge connecting these two pathways.

  • Jaccard overlap coefficient is reciprocal of Jaccard distance, using (1 - Jaccard_distance).

  • overlap=0.2 is default, which specifies roughly 20% overlap in genes shared between two pathway nodes.

  • Note these genes must be involved in enrichment, and therefore does not use all possible genes annotated to a pathway. Therefore connections are only created with enriched genes are shared between pathways.

p_cutoff

numeric threshold used for significant enrichment P-value. The default NULL uses the value in the mem object.

min_count

integer threshold for minimum genes involved in enrichment in order for a pathway to be considered significant during this analysis. When NULL it uses the threshold in mem.

colorV

character vector of R colors used for each enrichment. Default NULL uses colors defined in mem.

cluster_function

function, default igraph::cluster_walktrap, used to cluster igraph nodes in the resulting network graph. It is used to enhance the visual summary.

  • This function is not used when cluster_list is supplied.

cluster_list

list default NULL, optional list of pathway clusters, containing character vectors of igraph node/vertex names. It will be used instead of cluster_function when supplied.

num_keep_terms

integer, default 3, number of text terms to keep for each pathway cluster, used together with cluster_function. Common words are removed, remaining terms are sorted by decreasing occurrence, then used to summarize each cluster.

keep_terms_sep

character string, default is comma-newline, used to separate terms, used together with num_keep_terms.

repulse

numeric value passed to layout_with_qfr(), default 3.3.

  • Use repulse 'FALSE', 'NULL', or '0' will skip the layout, which is used by mem_find_overlap() to iterate numerous overlaps without spending time on layout each iteration.

remove_singlets

logical, default TRUE, whether to remove pathway singlets which have no connections to any other pathways.

  • Using TRUE will help simplify busy figures, at the expense of being less complete.

color_by_nodes

logical, default TRUE, whether to colorize pathway clusters using node colors in each cluster. Note that a mix of colors often turns brown, so this feature has unpredictable benefit.

apply_direction

logical default TRUE, whether to apply direction to the node border color, when supplied. Used with direction_max and direction_floor.

direction_max

numeric, default 2, indicating the directional score at which the maximum color is applied. Typically when using some derivative of z-score to represent directionality, values at or above 2 are effectively "maximum".

direction_floor

numeric default 0.5, the minimum directional score for any color to be applied, below which values are considered "non-directional". Typically when using some form of z-score, a value at or below 0.5 may be considered "not directional."

seed

numeric passed to set.seed() via the layout_with_qfr() layout algorithm, default 123.

do_plot

logical, default FALSE, whether to render the resulting plot using jam_igraph().

verbose

logical whether to print verbose output.

...

additional arguments are passed to jam_igraph() to customize the network plot, used when do_plot=TRUE.

Details

This function is currently In development.

This function is intended to convert mem output from multiEnrichMap() into an EnrichmentMap igraph format which represents the statistical enrichment support from each pathway enrichment.

This function can apply P-value thresholds using the input mem, or using a custom value.

A node clustering function is applied by default, which may help define suitable subgroups of nodes. When defined, the clusters are used to define nodegroups for edge bundling.