Multi-Dendrix Logo

This Page

multi_dendrix.evaluate.network.direct_interactions_test

multi_dendrix.evaluate.network.direct_interactions_test(collection, G, Hs)[source]

Performs the direct interactions test on the collection of gene sets. If t (number of gene sets in the collection) is 1, then the statistic is 0 and the p-value is 1.

Parameters:
  • collection (list of lists) – collection of gene sets to be tested.
  • G (NetworkX Graph.) – original PPI network.
  • Hs (list of NetworkX Graphs) – permuted versions of G.
Returns:
A tuple consisting of the following:
  • \(\nu(\mathbf{P})\) (float) - the direct interactions test statistic.
  • pval (float) - the direct interactions test p-value of the given collection.

Test:

For the definition of the test statistic used by the direct interactions test, see direct_interactions_stat(). The direct interactions test compares the direct interactions test statistic of the collection on the original and permuted PPI networks.

Examples:
A view of example input:
>>> import networkx as nx
>>> collection = [["G1", "G2"], ["G3", "G4"]]
>>> G = nx.Graph()
>>> G.add_edges_from([("G1", "G2"), ("G3", "G4"), ("G2", "G5"), ("G4", "G5")])
>>> Hs =[ nx.double_edge_swap(G.copy(), nswap=10, max_tries=1e75) for i in range(10) ]
>>> nx.draw_circular(G, node_size=125, font_size=8)
../../_images/direct_interactions_test_graph.png
A simple example
>>> direct_interactions_test(collection, G, Hs)
(1.0, 0.1)

See also: direct_interactions_stat(), eval_gene_sets_by_interactions(), avg_pair_dist_test().