import boolsim
from colomoto_jupyter import tabulate # for display
Computing attractors with boolSim#
Input from a GINsim model#
import ginsim
lrg = ginsim.load("https://zenodo.org/record/3719029/files/SuppMat_Model_Master_Model.zginml")
Downloading https://zenodo.org/record/3719029/files/SuppMat_Model_Master_Model.zginml
%time A = boolsim.attractors(lrg)
tabulate(A)
CPU times: user 26.4 ms, sys: 6.89 ms, total: 33.3 ms
Wall time: 1.92 s
AKT1 | AKT2 | Apoptosis | CDH1 | CDH2 | CellCycleArrest | CTNNB1 | DKK1 | DNAdamage | ECMicroenv | EMT | ERK | GF | Invasion | Metastasis | Migration | miR200 | miR203 | miR34 | NICD | p21 | p53 | p63 | p73 | SMAD | SNAI1 | SNAI2 | TGFbeta | TWIST1 | VIM | ZEB1 | ZEB2 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 |
0 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 |
2 | 0 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 1 | 1 | 1 |
4 | 0 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 1 | 1 | 1 |
6 | 0 | 1 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
7 | 0 | 1 | 0 | 0 | 1 | 1 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
Input from a minibn.BooleanNetwork
object#
from colomoto.minibn import BooleanNetwork
bn = BooleanNetwork({
"a": "(a|b)&!(a&b)",
"b": "(a|b)&!(a&b)"
})
a = boolsim.attractors(bn)
tabulate(a)
a | b | ||
---|---|---|---|
1 | 0 | 0 | 0 |
0 | 0 | 0 | 1 |
1 | 1 | * |
The attractor 1
is a fixed point:
a[1]
{'a': 0, 'b': 0}
The attractor 0
is a complex attractor, being represented as a list of hypercubes:
a[0]
[{'a': 0, 'b': 1}, {'a': 1, 'b': '*'}]