cabean-python Documentation

This Python module is an interface to the software tool CABEAN (https://satoss.uni.lu/software/CABEAN/) for the computation and source-target control of attractors of asynchronous Boolean networks, using symbolic encoding of state transition graph.

The control predictions can be processed using the algorecell_types library, which eases the display and comparison with other control methods.

Installation instructions at https://github.com/algorecell/cabean-python.

Examples can be found at:

Quick usage:

>>> import cabean

Model loading:

>>> cb = cabean.load("model.bnet") # in BoolNet format
# alternatively, load with biolqm in any format
>>> import biolqm
>>> lm = biolqm.load("model.zginml") # or any format support by bioLQM
>>> cb = cabean.load(lm)

Attractors :

>>> from colomoto_jupyter import tabulate
>>> tabulate(cabean.attractors(cb))

Reprogramming predictions:

>>> source = {"A": 0, "B": 1} # any attractor matching
>>> target = {"A": 1, "B", 0} # any attractor matching
# one-step reprogramming with instantaneeous perturbations:
>>> cb_inst = cabean.OneStep_Instantaneous(cb)
>>> rs = cb_inst.attractor_to_attractor(source, target)
>>> rs.as_table()
# attractor-sequential reprogramming with temporary perturbations:
>>> cb_seq_temp = cabean.AttractorSequential_Temporary(cb)
>>> rs = cb_seq_temp.attractor_to_attractor(source, target)
>>> rs.as_graph()

See help(rs) for other display methods

class cabean._OneStep(bn, inputs=None)

One-step reprogramming strategies consist of a set of perturbations which, when applied in the initial state are sufficient to ensure the reachability of the target attractor.

attractor_to_attractor(orig, dest, exclude=None)

Compute one-step reprogramming strategies for enforcing the reachability of an attractor of the model matching with dest from an attractor matching with orig. The type of perturbations depends on the class from which this method is called:

Parameters:exclude (list(str)) – list of nodes to exclude from perturbations.
Return type:algorecell_types.ReprogrammingStrategies
class cabean._AttractorSequential(bn, inputs=None)

Attractor-sequential reprogramming strategies consider reprogramming in several steps, where perturbations are performed once in an attractor, and may go through several intermediate attractors before reaching the target one.

attractor_to_attractor(orig, dest, exclude=None, maxpert=None)

Compute attractor-sequential reprogramming strategies for enforcing the reachability of an attractor of the model matching with dest from an attractor matching with orig. The type of perturbations depends on the class from which this method is called:

Parameters:
  • exclude (list(str)) – list of nodes to exclude from perturbations.
  • maxpert (int) – maximum number of steps
Return type:

algorecell_types.ReprogrammingStrategies

class cabean.AttractorSequential_Instantaneous(bn, inputs=None)

Bases: cabean._AttractorSequential

Attractor-sequential reprogramming with instantaneous perturbations.

class cabean.AttractorSequential_Permanent(bn, inputs=None)

Bases: cabean._AttractorSequential

Attractor-sequential reprogramming with permanent perturbations. Note that CABEAN only considers attractors of the “wild-type” Boolean networks: permanent reprogramming strategies correspond to the cases whenever temporary perturbations can be sustained forever.

class cabean.AttractorSequential_Temporary(bn, inputs=None)

Bases: cabean._AttractorSequential

Attractor-sequential reprogramming with temporary perturbations, i.e., to be released once in an attractor

class cabean.CabeanInstance(bn, *spec, **kwspec)

Bases: object

CABEAN Boolean network model, storing the list of its attractors

Parameters:bn – Boolean network in any format supported by colomoto.minibn.BooleanNetwork, which include filename in BoolNet format, and biolqm or ginsim objects.

Other arguments can used to specify a fixed value for input nodes.

Example :

>>> cb = cabean.CabeanInstance(bn, {"I1": 1, "I2": 0})
class cabean.OneStep_Instantaneous(bn, inputs=None)

Bases: cabean._OneStep

One-step reprogramming with instantaneous perturbations

class cabean.OneStep_Permanent(bn, inputs=None)

Bases: cabean._OneStep

One-step reprogramming with permanent perturbations. Note that CABEAN only considers attractors of the “wild-type” Boolean networks: permanent reprogramming strategies correspond to the cases whenever temporary perturbations can be sustained forever.

class cabean.OneStep_Temporary(bn, inputs=None)

Bases: cabean._OneStep

One-step reprogramming with temporary perturbations, i.e., to be released once in an attractor

class cabean.Sequential_Instantaneous(bn)

Bases: cabean._CabeanReprogramming

Sequential reprogramming strategies consider reprogramming in several steps, where perturbations are performed in specific states, not necessarily in an attractor. The current implementation only considers instantaneous perturbations.

attractor_to_attractor(orig, dest, maxsteps=5, limit=1)

Compute sequential reprogramming strategies for enforcing the reachability of an attractor of the model matching with dest from states matching orig, using instantenous perturbations.

Parameters:
  • exclude (list(str)) – list of nodes to exclude from perturbations.
  • maxsteps (int) – maximum number of steps
  • limit (int) – maximum number of solutions
Return type:

algorecell_types.ReprogrammingStrategies

cabean.attractors(model, *spec, **kwspec)

Returns the list of attractors of model. An attractor is either represented as a colomoto.types.Hypercube, i.e., a dictionnary mapping node names to 0, 1, or * (cyclic); or as a colomoto.types.HypercubeCollection, i.e., a list of the former type.

Parameters:model – either a .CabeanInstance object, or arguments are the same as CabeanInstance.
cabean.load(bn, *spec, **kwspec)

Returns CabeanInstance (bn, *spec, **kwspec)

Example :

>>> cb = cabean.load(bn, {"I1": 1, "I2": 0})