Simulation

The maboss module can call the MaBoSS software via the run method of Simulation objects. This method writes a .cfg and a .bnd files and run MaBoSS on them. Then, a Result object is created to interact with MaBoSS output files.

  • Simulation

class maboss.simulation.Simulation(nt, parameters={}, command=None, mutations=[], mutationsTypes={}, **kwargs)[source]

Class that handles MaBoSS simulations.

network

A Network object, that will be translated in a bnd file

mutations

A list of nodes for which mutation can be triggered by modifying the cfg file

palette

A mapping of nodes to color for plotting the results of the simulation.

param

A dictionary that contains global variables (keys starting with a ‘$’), and simulation parameters (keys not starting with a ‘$’).

__init__(nt, parameters={}, command=None, mutations=[], mutationsTypes={}, **kwargs)[source]

Initialize the Simulation object.

Parameters:
  • nt (Network) – the network associated with the simulation.

  • kwargs (dict) – parameters of the simulation

continue_from_result(result)[source]

Set the initial state from as the last state from result.

get_initial_state()[source]

TODO

mutate(node, state)[source]

Trigger or untrigger mutation for a node.

Parameters:
  • node (Node) – The Node to be modified

  • State (str) –

    • 'ON' (always up)

    • 'OFF' (always down)

    • 'WT' (mutable but with normal behaviour)

The node will appear as a mutable node in the bnd file. This means that its rate will be of the form:

rate_up = $LowNode ? 0 :($HighNode ? 1: (@logic ? rt_up : 0))

If the node is already mutable, this method will simply set $HighNode and $LowNode accordingly to the desired mutation.

print_bnd(out=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>)[source]

Produce the content of the bnd file associated to the simulation.

print_cfg(out=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>)[source]

Produce the content of the cfg file associated to the simulation.

run(command=None, workdir=None, overwrite=False, prefix='res', cmaboss=False, only_final_state=False)[source]

Run the simulation with MaBoSS and return a Result object.

Parameters:

command – specify a MaBoSS command, default to None for automatic selection

Return type:

Result

update_parameters(**kwargs)[source]

Add elements to self.param.