Multi-Dendrix Logo

This Page

multi_dendrix.permute.ppi_network.permute_network

multi_dendrix.permute.ppi_network.permute_network(G, Q)[source]

Permutes the given graph G=(V, E) by performing | E | * Q edge swaps.

Parameters:
  • G (NetworkX Graph) – PPI network.
  • Q (int) – constant multiplier for number Q * | E | of edge swaps to perform (default and suggested value: 100). See Milo et al. (2003) for details on choosing Q.
Returns:

a permuted version of H (G is not modified)

Examples:
A view of example input:
>>> import networkx as nx
>>> G = nx.Graph()
>>> G.add_edges_from([["G1", "G2"], ["G2", "G3"], ["G2", "G4"], ["G1", "G4"],
                      ["G2", "G5"], ["G5", "G6"], ["G5", "G7"]])
>>> nx.draw_spectral(G, node_size=125, font_size=8)
../../_images/ppi_network.png
Permuting the network by performing | E | * 10 edge swaps.
>>> permute_network(G, 10)
../../_images/permuted_ppi_network.png

See also: load_network(), multi_dendrix.permute.mutation_data.permute_mutation_data().

Notes: Uses the NetworkX double_edge_swap function.