Network
In the maboss module, the informations contained in the MaBoSS’s .cfg and .bnd files are represented by Python objects.
Network objects represent most of the information contained in the .bnd
file, and Simulation object contained the information contained in the .cfg file.
Network
- class maboss.network.Network(nodeList)[source]
Represent a boolean network.
Initialised with a list of Nodes whose
logExps must contain only names present in the list.Network objects are in charge of carrying the initial states of each node.
- names
the list of names of the nodes in the network
- set_istate(nodes, probDict, warnings=True)[source]
Change the inital states probability of one or several nodes.
- Parameters:
nodes (a
Nodeor a list or tuple ofNode) – the node(s) whose initial states are to be modifiedprobDict (dict) – the probability distribution of intial states
If nodes is a Node object or a singleton, probDict must be a probability distribution over {0, 1}, it can be expressed by a list [P(0), P(1)] or a dictionary: {0: P(0), 1: P(1)}.
If nodes is a tuple or a list of several Node objects, the Node object will be bound, and probDict must be a probability distribution over a part of {0, 1}^n. It must be expressed in the form of a dictionary {(b1, …, bn): P(b1,..,bn),…}. States that do not appear in the dictionary will be considered to be impossible. If a state has a 0 probability of being an intial state but might be reached later, it must explicitly appear as a key in probDict.
Example
>>> my_network.set_istate('node1', [0.3, 0.7]) # node1 will have a probability of 0.7 of being up >>> my_network.set_istate(['node1', 'node2'], {(0, 0): 0.4, (1, 0): 0.6, (0, 1): 0}) # node1 and node2 can never be both up because (1, 1) is not in the dictionary