-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fddd0e3
commit ea15298
Showing
2 changed files
with
43 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import sys | ||
sys.path.append("..") | ||
|
||
import balm | ||
|
||
from biodivine_aeon import BooleanNetwork | ||
from balm.SuccessionDiagram import SuccessionDiagram | ||
from balm._sd_algorithms.expand_source_SCCs import expand_source_SCCs | ||
|
||
# Print progress and succession diagram size. | ||
balm.SuccessionDiagram.DEBUG = True | ||
|
||
NODE_LIMIT = 1_000_000 | ||
DEPTH_LIMIT = 10_000 | ||
|
||
# This is unfortunately necessary for PyEDA Boolean expression parser (for now). | ||
sys.setrecursionlimit(150000) | ||
|
||
bn = BooleanNetwork.from_file(sys.argv[1]) | ||
bn = bn.infer_regulatory_graph() | ||
|
||
# Compute the succession diagram. | ||
sd = SuccessionDiagram(bn) | ||
fully_expanded = expand_source_SCCs(sd, SuccessionDiagram.expand_attractor_seeds) | ||
assert fully_expanded | ||
|
||
attractor_count = 0 | ||
motif_avoidant_count = 0 | ||
|
||
for node in sd.node_ids(): | ||
attr = sd.node_attractor_seeds(node, compute=True) | ||
attractor_count += len(attr) | ||
if not sd.node_is_minimal(node): | ||
motif_avoidant_count += len(attr) | ||
|
||
print("nodes, attractors, motif-avoidant") | ||
print(f"{len(sd)}, {attractor_count}, {motif_avoidant_count}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters