CASCI-lab / CANA

CANAlization: Control & Redundancy in Boolean Networks
https://casci-lab.github.io/CANA/
MIT License
22 stars 15 forks source link

identity of attractors and states in state transition graph #22

Closed stas-g closed 2 years ago

stas-g commented 2 years ago

hi Rion,

i have poked around the documentation and the code and could not find a way to decipher identities of attractors (i.e. which states they correspond to), e.g. for a boolean graph L with 4 nodes/variables i get:

In [47]: L.attractors()
Out[47]: [[0], [4], [10], [15]]

In [48]: L.attractor(initial = "0111")
Out[48]: [4]

however, which of the states 16 states [4] etc correspond to is not clear. similarly, for e.g.

STG = L.state_transition_graph()
STG.nodes

any help would be appreciated.

thank you in advance, stas

xuan-w commented 2 years ago

If I am not mistaken, that can be given by statenum_to_binstate() here https://github.com/rionbr/CANA/blob/master/cana/cutils.pyx

stas-g commented 2 years ago

hi @xuan-w, thanks for this -- statenum_to_binstate() does give the correct attractors for my toy example!