booldog.io.networkx

Function to transform booldog:BoolDogModel to networkx:DiGraph

Attributes

logger

Functions

booldog2networkx(model[, as_logic_circuit])

Export a BoolDog Boolean model to Networkx DiGraph

Module Contents

booldog.io.networkx.logger
booldog.io.networkx.booldog2networkx(model, as_logic_circuit=True)

Export a BoolDog Boolean model to Networkx DiGraph

Parameters:
  • model (booldog:BoolDogModel) – A BoolDog object representing a Boolean network.

  • as_logic_circuit (bool) – If True, the graph is exported as a logic circuit (Boolean rules are represented as “logical” nodes (and, or, not) and edges. Otherwise, it is exported as a directed interaction graph. Default is True.

Returns:

graph – A networkx graph with the same nodes as the input network. If as_logic_circuit is True, Boolean rules are represented as “logical” nodes (and, or, not) and edges. Otherwise, each node has a “type” attribute (“species”) and each edge has a “type” attribute derived from pyboolnet’s “sign” edge attribute (“activation”, “inhibition”, “mixed”, or “none”). In both cases, every model node also gets “rule” and “label” attributes copied from the corresponding BoolDogNode.

Return type:

networkx.DiGraph

Notes

When as_logic_circuit is False, the interaction graph is built via pyboolnet.interaction_graphs.primes2igraph() (despite its name, this returns a networkx.DiGraph).