jcrozum / pystablemotifs

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

Implement export to networkx option for SuccessionDiagram class (in Succession.py) #1

Closed jcrozum closed 4 years ago

jcrozum commented 4 years ago

In the attractor-reprogramming branch, SuccessionDiagram objects now store a networkx.DiGraph() object (called digraph). The networkx object does not store any metadata, just linkages between nodes of the succession diagram by index in the SuccessionDiagram.motif_reduction_list (formerly called SuccessionDiagram.MotifReductionList before it was renamed for consistency).

Some plotting functions might still be nice, so I'll leave the issue open for now.

jgtz commented 4 years ago

Created a new branch with some implementation. Also includes a StableMotifTestNetworkX.py for testing. Not yet fully debugged. Still want to add the attractors at the end of the succession diagram.

https://github.com/jcrozum/StableMotifs/tree/succession_diagram_network_export_visualization

jgtz commented 4 years ago

I think this last commit is getting close to the point where I think it can be merged with the master. It needs some commenting to explain what is going on and maybe some variable changes, but I think it is very close to the "good enough" point.

https://github.com/jcrozum/StableMotifs/tree/succession_diagram_network_export_visualization

jcrozum commented 4 years ago

Great! I took a quick look through and I have a request/suggestion. Can SuccessionDiagram.process_networkx_succession_diagram either store the various networkx objects as variables within the SuccessionDiagram object or else return a struct or named tuple? There's no way I'll ever get the order right for six return variables.

jgtz commented 4 years ago

I did those changes you requested and some extra ones. I think it is ready to merge with the main branch.

jcrozum commented 4 years ago

I've merged it.