<jupyter_start><jupyter_text>1. Example from [SQUADTransformation.ipynb](https://github.com/caramirezal/SQUADBookChapter/blob/master/SQUADTransformation.ipynb)<jupyter_code>g = {'A': {'A': '+'}, 
     'B': {'A': '+', 'C': '-'}, 
     'C': {'A': '-', 'B': '-'}}
B = squad_reboot.SquadRegulatoryNetwork(g)<jupyter_output><empty_output><jupyter_text>Steady states<jupyter_code>for s in B.bool_steady_states():
    print(s)<jupyter_output>{'A': 0, 'B': 0, 'C': 1}
{'A': 1, 'B': 1, 'C': 0}<jupyter_text>Dynamic simulation<jupyter_code>initial_state = {"A":0, "B":1, "C":1}
_ = B.dynamic_simulation(initial_state=initial_state, h=50, t_max=10, gamma=1)<jupyter_output>Status: End<jupyter_text>2. Example from [SQUAD_implementation.ipynb](https://github.com/caramirezal/SQUADBookChapter/blob/master/SQUAD_implementation.ipynb)<jupyter_code># error in original definition of graph?
g = {"A":{"A":"+", "B":"-", "X":"+"},  
     "B":{"A":"-", "Y":"+", "B":"+"}, 
     "X":{"Z":"-", "A":"+"},
     "Y":{"A":"-", "B":"+"},
     "Z":{"B":"+"}}
B = squad_reboot.SquadRegulatoryNetwork(g)<jupyter_output><empty_output><jupyter_text>Small pertubation example<jupyter_code>initial_state = 0
events = {10:{"X":{"perturbation":.25}}, 
          20:{"Y":{"perturbation":.25}}}
_ = B.dynamic_simulation(node_events=events, initial_state=initial_state, h=50, gamma=1)<jupyter_output>Status: Event at  10:
          X -> 0.25 (duration  0)

Status: Event at  20:
          Y -> 0.25 (duration  0)

Status: End<jupyter_text>Simulate perturbations with different order of appearence and intensity<jupyter_code>events = {10:{"X":{"perturbation":1}}, 
          20:{"Y":{"perturbation":1}}}
_ = B.dynamic_simulation(node_events=events, initial_state=initial_state, h=50, gamma=1)
events = {10:{"Y":{"perturbation":1}}, 
          20:{"X":{"perturbation":1}}}
_ = B.dynamic_simulation(node_events=events, initial_state=initial_state)<jupyter_output>Status: Event at  10:
          Y -> 1.00 (duration  0)

Status: Event at  20:
          X -> 1.00 (duration  0)

Status: End<jupyter_text>More pertubations<jupyter_code>events = {9:{"A":{"perturbation":0.5, "duration":1}}, 
          7:{"Y":{"perturbation":0.3, "duration":5}},
          10:{"X":{"perturbation":.25, "duration":5}, "Z":{"perturbation":0}}, 
          20:{"Y":{"perturbation":1}}
         }
_ = B.dynamic_simulation(node_events=events, initial_state=initial_state, h=50, gamma=1)<jupyter_output>Status: Event at   7:
          Y -> 0.30 (duration  5)

Status: Event at   9:
          A -> 0.50 (duration  1)

Status: Event at  10:
          A -> released
          X -> 0.25 (duration  5)
          Z -> 0.00 (duration  0)

Status: Event at  12:
          Y -> released

Status: Event at  15:
          X -> released

Status: Event at  20:
          Y -> 1.00 (duration  0)

Status: End<jupyter_text>TODO: Terminal B cell differentiation  A. thaliana network from graphml<jupyter_code># load graph
g_path = "./networks/Athaliana.graphml"
g = squad_reboot.import_graphml(g_path, activator_symbol="standard", inhibitor_symbol="white_diamond")
g
B = squad_reboot.SquadRegulatoryNetwork(g)
for s in B.bool_steady_states():
    print(s)
initial_state = s

events = {5:{"AP2":{"perturbation":0.5, "duration":1}}, 
          10:{"SEP":{"perturbation":.25, "duration":5}, "AP3":{"perturbation":0}}, 
         }

_ = B.dynamic_simulation(node_events=events, initial_state=initial_state, h=50, gamma=1)



_ = B.dynamic_simulation(t_max=100)<jupyter_output>Status: End
{'fraction_non_alphanumeric': 0.19307780320366133, 'fraction_numerical': 0.038615560640732266, 'mean_word_length': 4.413312693498452, 'pattern_counts': {'":': 52, '<': 27, '<?xml version=': 0, '>': 39, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '8', 'dir': 'jupyter-structured-clean-dedup', 'id': '458592', 'license': 'MIT', 'n_tokens_mistral': 1430, 'n_tokens_neox': 1293, 'n_words': 228, 'path': 'examples/test-notebook.ipynb', 'repo_name': 'NIB-SI/squad-reboot', 'size': '3496'}