jcrozum / biobalm

The biologist's Boolean attractor landscape mapper, building Waddington landscapes from Boolean networks.
https://jcrozum.github.io/biobalm/
MIT License
2 stars 0 forks source link

Fast-forward source node expansion anywhere in the succession diagram #122

Closed daemontus closed 3 months ago

daemontus commented 3 months ago

This is a slightly more controversial update:

During the block expansion, allow to "fast-forward" the expansion of source nodes anywhere in the succession diagram. That is, if the percolation of a stable motif results in the creation of a bunch of source nodes, we automatically create 2**n successors for these without further analysis (they can't contain motif-avoidant attractors anyway). However, this only happens with block expansion and can be turned off using the recently added optimize_source_nodes flag.

This eliminates 88 978 SD nodes and almost 9 minutes of compute time for the BBM "easy" models alone. I haven't retested all the hard models yet, but this overall seems like a win. It does sometimes increase the ratio of expanded nodes vs. the non-expanded ones, but is mostly not an issue, because the ones where we expand the source nodes cost us very little compute.

daemontus commented 3 months ago

Performance data for the "easy" BBM models:

biobalm-source-fast-forward.xlsx

github-actions[bot] commented 3 months ago

Coverage

Coverage Report
FileStmtsMissCoverMissing
biobalm
   _pint_reachability.py615018%24, 40–54, 69–93, 101–146
   control.py1141488%107, 119, 125, 129, 134, 143–159, 477, 480, 493
   interaction_graph_utils.py52688%11–13, 151–152, 222–223
   petri_net_translation.py1491292%22–26, 79, 136, 234, 308–309, 333–334, 343, 452
   space_utils.py1322085%26–28, 104–110, 133–139, 347–350, 414, 462
   succession_diagram.py3806483%6, 120, 210–215, 228, 275–282, 386–393, 410–411, 421, 427, 543, 630–636, 752, 755, 873–891, 923, 933, 936, 976, 983, 1034, 1052, 1174, 1360, 1371, 1379, 1422, 1434, 1439, 1445
   symbolic_utils.py32584%10, 39–44, 100, 128
   trappist_core.py1842388%14–18, 55, 57, 92, 215, 217, 219, 254–256, 276–282, 340, 342, 372, 420, 422
biobalm/_sd_algorithms
   expand_attractor_seeds.py60788%6, 28, 42, 109–114, 119
   expand_bfs.py28196%6
   expand_dfs.py30197%6
   expand_minimal_spaces.py40295%6, 37
   expand_source_SCCs.py1111686%11–13, 50, 69, 77, 82, 103, 112, 120, 131, 140, 143, 167, 179, 242–243
   expand_source_blocks.py1131587%10, 30, 42, 54, 64, 71, 76, 79, 138, 164, 173, 206, 216, 222, 231
   expand_to_target.py31390%6, 38, 43
biobalm/_sd_attractors
   attractor_candidates.py2659066%13–15, 26–27, 93, 101, 107–108, 130, 152, 187, 193–204, 223, 239–320, 325, 329, 335, 341, 356, 383, 388, 392, 398, 400–438, 511, 582–583, 684
   attractor_symbolic.py1141686%6–7, 75, 88–92, 103, 112, 144, 179, 191–193, 202, 230, 236
TOTAL198534583% 

Tests Skipped Failures Errors Time
359 0 :zzz: 0 :x: 0 :fire: 55.206s :stopwatch:
daemontus commented 3 months ago

Merging since the tests passed and this does not have any affect on the structure produced during the full expansion, so it will not interfere with any other analysis tasks except for attractor detection (where it should be faster).