BNS tutorial for fixed points and synchronous attractors#
The bns
package provides functions for the identification of fixed points or of all synchronous attractors. These methods call the BNS tool uses a SAT solver to compute attractors of synchronous models.
import bns
from colomoto_jupyter import tabulate
tabulate(bns.fixpoints("cellcycle.cnet"))
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | |
---|---|---|---|---|---|---|---|---|---|---|
0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 |
tabulate(bns.attractors("cellcycle.cnet"))
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | ||
---|---|---|---|---|---|---|---|---|---|---|---|
0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 |
1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 |
5 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | |
6 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 1 | |
4 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | |
1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | |
2 | 1 | 0 | 1 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | |
3 | 1 | 0 | 1 | 1 | 1 | 0 | 0 | 1 | 0 | 0 |
The search can be restricted to attractors of a specific length. Note that an attractor on length k
is also an attractor of length n*k
.
This restriction is in particular used to identify only fixed points, wich are found for any length.
tabulate(bns.attractors("cellcycle.cnet", length=3))
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | |
---|---|---|---|---|---|---|---|---|---|---|
0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 |
Import from GINsim or bioLQM#
Models can also be imported from biolqm
and ginsim
objects.
In that case, the names of the nodes will be used instead of a number.
import ginsim
lrg = ginsim.load("http://ginsim.org/sites/default/files/boolean_cell_cycle.zginml")
Downloading http://ginsim.org/sites/default/files/boolean_cell_cycle.zginml
tabulate(bns.attractors(lrg))
CycD | Rb | E2F | CycE | CycA | p27 | Cdc20 | cdh1 | UbcH10 | CycB | ||
---|---|---|---|---|---|---|---|---|---|---|---|
0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 |
1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 |
5 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | |
6 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 1 | |
4 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | |
1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | |
2 | 1 | 0 | 1 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | |
3 | 1 | 0 | 1 | 1 | 1 | 0 | 0 | 1 | 0 | 0 |