Multi-Dendrix Logo

This Page

multi_dendrix.core_modules.extract

multi_dendrix.core_modules.extract(collections, stability_threshold)

Extracts the core modules from a set of collections output by Multi-Dendrix. Core modules are defined by how often genes appear in the same gene set together for different parameters of Multi-Dendrix (“how often” is tunable using the stability threshold).

Parameters:
  • collections (list of lists of lists) – multiple collections of gene sets identified by Multi-Dendrix.
  • stability_threshold (int) – the number of times two genes must appear in the same gene set in order to be grouped in the same module.
Returns:
A tuple containing the following:
  • core_modules (list of lists) - the core modules identified by the algorithm
  • module_graph (NetworkX Graph) - the graph created to identify the core modules, where genes are nodes and pairs of genes are connected by edges weighted by how often they appeared in the same gene set.
Example:
A simple example with the resulting module graph (edges with weight zero are not shown):
>>> import networkx as nx
>>> collections = [ [["G1", "G2", "G3"], ["G4", "G5", "G6"]],
                    [["G1", "G2", "G3"], ["G4", "G5", "G6", "G7"]],
                    [["G1", "G2", "G3"], ["G4", "G5", "G7", "G8"]] ]
>>> core_modules, module_graph = extract(collections, 1)
>>> core_modules
[['G7', 'G6', 'G5', 'G4'], ['G3', 'G2', 'G1']]
>>> nx.draw_circular(module_graph, node_size=125, font_size=8)
../../_images/module_graph.png