booldog.continuous.semi_quantitative
Attributes
Classes
Class for Continuous simulations functions. |
Module Contents
- booldog.continuous.semi_quantitative.logger
- class booldog.continuous.semi_quantitative.ContinuousMixin
Class for Continuous simulations functions.
This class is not intended to be used directly, but rather as a mixin.
- transform_bool_to_continuous(transform='normalisedhillcube', **kwargs)
Generate an ODE from RegulatoryNetwork/Boolean graph.
Note that the Network object is kept in memory as the primes of the Boolean network. This means that importing the graph may take a while, depending on the size of the network.
- Parameters:
transform (str) – One of accepted transforms. See booldog.ode.transforms for accepted options.
**kwargs – Additional keyword arguments passed to
booldog.ODE().
- continuous_simulation(node_events=None, edge_events=None, t_min=0, t_max=30, initial_state=0, ode_system=None, solver=solve_ivp, **kwargs)
Run continuous semi-quantitative simulation.
- Parameters:
node_events (None or list of dict, optional) – List of node events with a dictionary defining each event. See Notes for description of event definitions.
edge_events (None or list of dict, optional) – Disrupt connections #TODO not implemented
t_min (float, optional) – Interval of integration, simulation starts with t=t_min and integrates until it reaches t=t_max.
t_max (float, optional) – Interval of integration, simulation starts with t=t_min and integrates until it reaches t=t_max.
initial_state (float or int or array or dict, optional) – Initial state of nodes. See Notes for description of format.
ode_system (None or
booldog.ODE(), optional) – If none, the ODE is created withtransform_bool_to_continuous()**kwargs –
If ode_system is None, additional keyword arguments are passed to
transform_bool_to_continuous(). For description of these arguments seebooldog.ODE().If plot=True , additional keyword arguments are passed to
plot_simulation().
- Returns:
r (object #TODO)
t (ndarray, shape (n_time_points,)) – Time-points.
y (ndarray, shape (n_time_points, n_nodes)) – Values of the solution at t.
Notes
- Format of the node_events parameter
The node events are passed as a list of dictionaries defining each event. Dictionary keys are:
time: time at which the event occurs
node: name of node which is perturbed
value: value to which the node is set
duration: (optional) duration for which the node is fixed if longer than 0, (i.e. not a point perturbation)
Example - at timepoint 10, node X is set to 0.25 for 5 time-steps. and at timepoint 12, node Y and Z are set to 1 for 0 timesteps:
node_events = [ {'time':10, 'node':'X', 'value':.25, 'duration':5}, {'time':12, 'node':'Y', 'value':1}, {'time':12, 'node':'X', 'value':1} ]
- Format of the initial_state parameter
If the initial state is an int or float, the value is assigned for all variables. Otherwise the parameter argument should be a dict with keys as node names and values for their initial state. In this case, if the initial state is not defined for all nodes, a default key with the default value should also be present in the dict.