StableMotifs-python

This module brings a Python interface to the tool “StableMotifs” (Jorge G. T. Zañudo and Réka Albert), for the control of Boolean networks.

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/StableMotifs-python

Quick usage:

>>> import stablemotifs

Model loading:

>>> sm = stablemotifs.load("network.txt") # in BooleanNet format
# alternatively, load with biolqm in any format
>>> import biolqm
>>> lm = biolqm.load("model.zginml") # or any format support by bioLQM
>>> sm = stablemotifs.load(lm)

Reprogramming predictions:

>>> sr = sm.reprogramming_to_attractor({"A": 1, "B": 0})
>>> sr.as_table()

See help(sr) for other display methods

Examples can be found at:
stablemotifs.load(model, fixed=None, mcl='', msm='', quiet=False)

Execute StableMotifs analysis on the given Boolean network model.

Parameters:
  • model – either a biolqm or ginsim object, or filename/URL of Boolean network in BooleanNet format
  • fixed (dict[str,int]) – fix the given nodes to their associated given values
  • mcl (str) – Optional threshold in the maximum cycle length (mcl). One must specify both a mcl and msm.
  • msm (str) – Optional threshold in the maximum stable motif size (msm). One must specify both a mcl and msm.
  • quiet (bool) – If True, skip computation output
Return type:

results.StableMotifsResult instance

class stablemotifs.results.StableMotifsResult(wd, model_name, fixed)

Class of objects returned by load() function giving access to StableMotifs results.

attractors

List of attractors (dictionnaries mapping node names to 0, 1, or 'X').

reprogramming_to_attractor(*spec, **kwspec)

Compute reprogramming strategies ensuring that only attractors matching with the given specification can be reached with the asynchronous mode. The perturbations are temporary, i.e., can be released once in the attractor.

Return type:algorecell_types.ReprogrammingStrategies

Examples:

>>> sm.reprogramming_to_attractor(A=1, B=0)
>>> sm.reprogramming_to_attractor({"A": 1, "B": 0})
control_sets

Dictionnary mapping attractor indices to their control sets (dict[str,int] list)

stable_motifs

List of stable motifs, mapping subset of nodes to Boolean values (dict[str,int])