jcrozum / pystablemotifs

Python library for attractor identification and control in Boolean networks
MIT License
28 stars 7 forks source link

Multiple source nodes skipped in stable motif succession #47

Closed djwooten closed 4 years ago

djwooten commented 4 years ago

I am having trouble with succession diagrams in the most recent push. The current version seems to not include source node stable motifs, if there is more than one source node in the network.

If I use the version from 569409786f53b3f7dcecdc012a1352c60c7ba643, then all the stable motifs are shown for both network_1.txt and network_2.txt.

Code demonstrating issue

import StableMotifs as sm
import StableMotifs.Export as ex

def stable(fname):
    primes = sm.Format.import_primes(fname,remove_constants=True)

    ar = sm.AttractorRepertoire.from_primes(primes,max_simulate_size=7)

    GM=ex.networkx_succession_diagram_motif_based(ar,include_attractors_in_diagram=False)

    ex.plot_nx_succession_diagram(GM)

print("A single source node")
stable("network_1.txt")

print("Two source nodes")
stable("network_2.txt")

Content of network_1.txt

A *= A

Content of network_2.txt

A *= A
B *= B

When I use the version from commit 569409786f53b3f7dcecdc012a1352c60c7ba643, this is the output I get for each: network_1.txt : {A:0}, {A:1} network_2.txt : {A:0, B:0}, {A:1, B:0}, {A:0, B:1}, {A:1, B:1}

However when I use the current master, network_1.txt gives the same results, but network_2.txt gives an empty succession.

jcrozum commented 4 years ago

Thanks David. I think I know what broke this in the last commit and I have an idea on how to fix it. Hopefully I can get a fix out today.

jcrozum commented 4 years ago

Fixed in latest commit

djwooten commented 4 years ago

Thanks for getting it so quickly!