From 11bd294e9dd79e30da3c75283ec894e33770ba71 Mon Sep 17 00:00:00 2001 From: Eran Date: Sun, 11 Feb 2024 13:30:20 -0500 Subject: [PATCH 01/11] WIP --- bigraph_viz/diagram.py | 151 +++-- notebooks/basics2.ipynb | 1410 ++------------------------------------- 2 files changed, 173 insertions(+), 1388 deletions(-) diff --git a/bigraph_viz/diagram.py b/bigraph_viz/diagram.py index 3ee4869..c6569e2 100644 --- a/bigraph_viz/diagram.py +++ b/bigraph_viz/diagram.py @@ -22,6 +22,31 @@ '_inherit': 'step', 'interval': 'float'} +def plot_edges(graph, edge, edge_spec, port_labels, port_label_size, state_node_spec): + process_path = edge['edge_path'] + process_name = str(process_path) + target_path = edge['target_path'] + port = edge['port'] + # edge_type = edge['type'] # input or output + target_name = str(target_path) + + # place it in the graph + if target_name not in graph.body: # is the source node already in the graph? + label = make_label(target_path[-1]) + graph.node(target_name, label=label, **state_node_spec) + + # port label + label = '' + if port_labels: + label = make_label(port) + + with graph.subgraph(name=process_name) as c: + graph.attr('edge', **edge_spec) + c.edge( + target_name, process_name, + label=label, + labelloc="t", + fontsize=port_label_size) def get_graph_wires(schema, wires, graph_dict, schema_key, edge_path, port): @@ -43,7 +68,13 @@ def get_graph_wires(schema, wires, graph_dict, schema_key, edge_path, port): subschema, subwire, graph_dict, schema_key, edge_path, port) elif isinstance(wires, (list, tuple)): target_path = absolute_path(edge_path[:-1], tuple(wires)) # TODO -- make sure this resolves ".." - graph_dict['hyper_edges'].append({ + if schema_key == 'inputs': + edge_key = 'input_edges' + elif schema_key == 'outputs': + edge_key = 'output_edges' + else: + raise Exception(f'invalid schema key {schema_key}') + graph_dict[edge_key].append({ 'edge_path': edge_path, 'target_path': target_path, 'port': port, @@ -74,7 +105,9 @@ def get_graph_dict( 'state_nodes': [], 'process_nodes': [], 'place_edges': [], - 'hyper_edges': [], + # 'hyper_edges': [], + 'input_edges': [], + 'output_edges': [], 'disconnected_hyper_edges': [], 'bridges': [], } @@ -164,9 +197,13 @@ def get_graphviz_fig( show_types=False, port_labels=True, port_label_size='10pt', + invisible_edges=False, + remove_process_place_edges=False, ): """make a graphviz figure from a graph_dict""" + node_names = [] + invisible_edges = invisible_edges or [] # node specs state_node_spec = { @@ -223,38 +260,33 @@ def get_graphviz_fig( # place edges graph.attr('edge', arrowhead='none', penwidth='2') for edge in graph_dict['place_edges']: - graph.attr('edge', style='filled') - parent_node = str(edge['parent']) - child_node = str(edge['child']) - graph.edge(parent_node, child_node) - - # hyper edges - for edge in graph_dict['hyper_edges']: - process_path = edge['edge_path'] - process_name = str(process_path) - target_path = edge['target_path'] - port = edge['port'] - edge_type = edge['type'] # input or output - target_name = str(target_path) - # place it in the graph - if target_name not in graph.body: # is the source node already in the graph? - label = make_label(target_path[-1]) - graph.node(target_name, label=label, **state_node_spec) + # show edge or not + show_edge = True + if remove_process_place_edges and edge['child'] in process_paths: + show_edge = False + elif edge in invisible_edges: + show_edge = False - if edge_type == 'inputs': - graph.attr('edge', **input_edge_spec) - elif edge_type == 'outputs': - graph.attr('edge', **output_edge_spec) + if show_edge: + graph.attr('edge', style='filled') else: - graph.attr('edge', **hyper_edge_spec) - with graph.subgraph(name=process_name) as c: - if port_labels: - label = make_label(port) - c.edge(target_name, process_name, label=label, labelloc="t", fontsize=port_label_size) - else: - c.edge(target_name, process_name) + graph.attr('edge', style='invis') + parent_node = str(edge['parent']) + child_node = str(edge['child']) + graph.edge(parent_node, child_node) + + # input edges + for edge in graph_dict['input_edges']: + plot_edges( + graph, edge, input_edge_spec, + port_labels, port_label_size, state_node_spec) + for edge in graph_dict['output_edges']: + plot_edges( + graph, edge, output_edge_spec, + port_labels, port_label_size, state_node_spec) + # disconnected hyper edges graph.attr('edge', **hyper_edge_spec) for edge in graph_dict['disconnected_hyper_edges']: @@ -267,20 +299,25 @@ def get_graphviz_fig( node_name2 = str(absolute_path(process_path, port)) graph.node(node_name2, label='', style='invis', width='0') + # port label + label = '' + if port_labels: + label = make_label(port) + # add the edge - if edge_type == 'inputs': - graph.attr('edge', **input_edge_spec) - elif edge_type == 'outputs': - graph.attr('edge', **output_edge_spec) - else: - graph.attr('edge', **hyper_edge_spec) with graph.subgraph(name=process_name) as c: - if port_labels: - label = make_label(port) - c.edge(node_name2, process_name, label=label, labelloc="t", fontsize=port_label_size - ) + if edge_type == 'inputs': + graph.attr('edge', **input_edge_spec) + elif edge_type == 'outputs': + graph.attr('edge', **output_edge_spec) else: - c.edge(node_name2, process_name) + graph.attr('edge', **hyper_edge_spec) + c.edge( + node_name2, process_name, + label=label, + labelloc="t", + fontsize=port_label_size + ) return graph @@ -308,9 +345,9 @@ def plot_bigraph( # node_fill_colors=None, # node_groups=False, remove_nodes=None, - # invisible_edges=False, + invisible_edges=False, # mark_top=False, - # remove_process_place_edges=False, + remove_process_place_edges=False, ): # get kwargs dict and remove plotting-specific kwargs kwargs = locals() @@ -434,8 +471,32 @@ def test_bio_schema(): plot_bigraph(b, filename='bioschema') - +def test_input_output(): + flat_composite_spec = { + 'store1.1': 'float', + 'store1.2': 'int', + 'process1': { + '_type': 'process', + 'outputs': { + 'port1': ['store1.1'], + 'port2': ['store1.2'], + } + }, + 'process2': { + '_type': 'process', + '_inputs': { + 'port1': 'any', + 'port2': 'any', + }, + 'inputs': { + 'port1': ['store1.1'], + 'port2': ['store1.2'], + } + }, + } + plot_bigraph(flat_composite_spec, rankdir='RL', filename='flat_composite') if __name__ == '__main__': # test_diagram_plot() - test_bio_schema() + # test_bio_schema() + test_input_output() diff --git a/notebooks/basics2.ipynb b/notebooks/basics2.ipynb index b060bfa..8d33f3d 100644 --- a/notebooks/basics2.ipynb +++ b/notebooks/basics2.ipynb @@ -36,7 +36,7 @@ "output_type": "stream", "text": [ "-e git+https://github.com/vivarium-collective/bigraph-schema.git@0c90a88ffe83c4b88d057e28a4f30fb19ef0263e#egg=bigraph_schema\n", - "bigraph-viz==0.0.31\n", + "-e git+https://github.com/vivarium-collective/bigraph-viz.git@d6f8103cd0486b23a4804ac5bdc32ede474c7e18#egg=bigraph_viz\n", "-e git+https://github.com/vivarium-collective/process-bigraph.git@6517fc88103bc3cfaad4d5a1fdbd9131015360d4#egg=process_bigraph\n" ] } @@ -57,7 +57,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 2, "id": "2ab3cb32-e007-45c4-807e-b1b442ac1608", "metadata": { "tags": [] @@ -69,7 +69,7 @@ "from bigraph_viz.diagram import plot_bigraph\n", "\n", "plot_settings = {\n", - " # 'remove_process_place_edges': True\n", + " 'remove_process_place_edges': True\n", "}\n", "save_images = False\n", "if save_images:\n", @@ -97,7 +97,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 3, "id": "d711b952-089a-4938-817d-d1ccad9de56e", "metadata": { "tags": [] @@ -134,10 +134,10 @@ "\n" ], "text/plain": [ - "" + "" ] }, - "execution_count": 6, + "execution_count": 3, "metadata": {}, "output_type": "execute_result" } @@ -159,7 +159,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 4, "id": "f3e5fa71-7ffc-4a8f-a1a0-dc547c886f84", "metadata": {}, "outputs": [ @@ -195,10 +195,10 @@ "\n" ], "text/plain": [ - "" + "" ] }, - "execution_count": 7, + "execution_count": 4, "metadata": {}, "output_type": "execute_result" } @@ -224,7 +224,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 5, "id": "0f3f0824-f89d-4c6e-830e-2c5a321f7b33", "metadata": {}, "outputs": [ @@ -325,10 +325,10 @@ "\n" ], "text/plain": [ - "" + "" ] }, - "execution_count": 8, + "execution_count": 5, "metadata": {}, "output_type": "execute_result" } @@ -368,7 +368,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 6, "id": "7c74237b-0d66-4e8f-a8ca-79174fadad8b", "metadata": {}, "outputs": [ @@ -419,10 +419,10 @@ "\n" ], "text/plain": [ - "" + "" ] }, - "execution_count": 14, + "execution_count": 6, "metadata": {}, "output_type": "execute_result" } @@ -450,7 +450,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 7, "id": "8c2457a3-fc47-4850-8b9e-9ee98e81567d", "metadata": {}, "outputs": [ @@ -505,50 +505,50 @@ "\n", "\n", "('process1', 'p', 'o', 'r', 't', '2')->('process1',)\n", - "\n", - "\n", + "\n", + "\n", "port2\n", "\n", "\n", "\n", "\n", "('process2', 'p', 'o', 'r', 't', '1')->('process2',)\n", - "\n", - "\n", + "\n", + "\n", "port1\n", "\n", "\n", "\n", "\n", "('process2', 'p', 'o', 'r', 't', '2')->('process2',)\n", - "\n", - "\n", + "\n", + "\n", "port2\n", "\n", "\n", "\n", "\n", "('process3', 'p', 'o', 'r', 't', '1')->('process3',)\n", - "\n", - "\n", + "\n", + "\n", "port1\n", "\n", "\n", "\n", "\n", "('process3', 'p', 'o', 'r', 't', '2')->('process3',)\n", - "\n", - "\n", + "\n", + "\n", "port2\n", "\n", "\n", "\n" ], "text/plain": [ - "" + "" ] }, - "execution_count": 15, + "execution_count": 7, "metadata": {}, "output_type": "execute_result" } @@ -558,8 +558,10 @@ " '_type': 'process',\n", " '_inputs': {\n", " 'port1': 'Any',\n", + " },\n", + " '_outputs': {\n", " 'port2': 'Any'\n", - " }\n", + " },\n", "}\n", "\n", "processes_spec = {\n", @@ -581,7 +583,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 8, "id": "a6ecad5d-8948-4636-910c-79284a3e8679", "metadata": {}, "outputs": [ @@ -655,10 +657,10 @@ "\n" ], "text/plain": [ - "" + "" ] }, - "execution_count": 19, + "execution_count": 8, "metadata": {}, "output_type": "execute_result" } @@ -713,7 +715,7 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": 9, "id": "781a84e6-bbe2-4708-b441-47efc611b46f", "metadata": {}, "outputs": [ @@ -751,7 +753,7 @@ "process1\n", "\n", "\n", - "\n", + "\n", "('store1.1',)->('process1',)\n", "\n", "\n", @@ -764,10 +766,10 @@ "process2\n", "\n", "\n", - "\n", + "\n", "('store1.1',)->('process2',)\n", - "\n", - "\n", + "\n", + "\n", "port1\n", "\n", "\n", @@ -777,27 +779,27 @@ "store1.2\n", "\n", "\n", - "\n", + "\n", "('store1.2',)->('process1',)\n", "\n", "\n", "port2\n", "\n", "\n", - "\n", + "\n", "('store1.2',)->('process2',)\n", - "\n", - "\n", + "\n", + "\n", "port2\n", "\n", "\n", "\n" ], "text/plain": [ - "" + "" ] }, - "execution_count": 22, + "execution_count": 9, "metadata": {}, "output_type": "execute_result" } @@ -835,7 +837,7 @@ }, { "cell_type": "code", - "execution_count": 24, + "execution_count": 10, "id": "701e759d-7f9b-41bb-911c-a8208c892462", "metadata": {}, "outputs": [ @@ -846,8 +848,8 @@ "traceback": [ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)", - "Cell \u001b[0;32mIn[24], line 27\u001b[0m\n\u001b[1;32m 1\u001b[0m nested_composite_spec \u001b[38;5;241m=\u001b[39m {\n\u001b[1;32m 2\u001b[0m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mstore1\u001b[39m\u001b[38;5;124m'\u001b[39m: {\n\u001b[1;32m 3\u001b[0m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mstore1.1\u001b[39m\u001b[38;5;124m'\u001b[39m: \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mfloat\u001b[39m\u001b[38;5;124m'\u001b[39m,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 25\u001b[0m }\n\u001b[1;32m 26\u001b[0m }\n\u001b[0;32m---> 27\u001b[0m \u001b[43mplot_bigraph\u001b[49m\u001b[43m(\u001b[49m\u001b[43mnested_composite_spec\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mplot_settings\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mfilename\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mnested_composite\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m)\u001b[49m\n", - "File \u001b[0;32m~/code/bigraph-viz/venv/lib/python3.9/site-packages/bigraph_viz/diagram.py:336\u001b[0m, in \u001b[0;36mplot_bigraph\u001b[0;34m(state, schema, core, out_dir, filename, file_format, size, node_label_size, show_values, show_types, port_labels, port_label_size, rankdir, print_source, dpi, label_margin, remove_nodes)\u001b[0m\n\u001b[1;32m 333\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m core\u001b[38;5;241m.\u001b[39mexists(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mprocess\u001b[39m\u001b[38;5;124m'\u001b[39m):\n\u001b[1;32m 334\u001b[0m core\u001b[38;5;241m.\u001b[39mregister(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mprocess\u001b[39m\u001b[38;5;124m'\u001b[39m, process_type)\n\u001b[0;32m--> 336\u001b[0m schema, state \u001b[38;5;241m=\u001b[39m \u001b[43mcore\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcomplete\u001b[49m\u001b[43m(\u001b[49m\u001b[43mschema\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mstate\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 338\u001b[0m \u001b[38;5;66;03m# parse out the network\u001b[39;00m\n\u001b[1;32m 339\u001b[0m graph_dict \u001b[38;5;241m=\u001b[39m get_graph_dict(\n\u001b[1;32m 340\u001b[0m schema\u001b[38;5;241m=\u001b[39mschema,\n\u001b[1;32m 341\u001b[0m state\u001b[38;5;241m=\u001b[39mstate,\n\u001b[1;32m 342\u001b[0m core\u001b[38;5;241m=\u001b[39mcore,\n\u001b[1;32m 343\u001b[0m remove_nodes\u001b[38;5;241m=\u001b[39mremove_nodes,\n\u001b[1;32m 344\u001b[0m )\n", + "Cell \u001b[0;32mIn[10], line 27\u001b[0m\n\u001b[1;32m 1\u001b[0m nested_composite_spec \u001b[38;5;241m=\u001b[39m {\n\u001b[1;32m 2\u001b[0m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mstore1\u001b[39m\u001b[38;5;124m'\u001b[39m: {\n\u001b[1;32m 3\u001b[0m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mstore1.1\u001b[39m\u001b[38;5;124m'\u001b[39m: \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mfloat\u001b[39m\u001b[38;5;124m'\u001b[39m,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 25\u001b[0m }\n\u001b[1;32m 26\u001b[0m }\n\u001b[0;32m---> 27\u001b[0m \u001b[43mplot_bigraph\u001b[49m\u001b[43m(\u001b[49m\u001b[43mnested_composite_spec\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mplot_settings\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mfilename\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mnested_composite\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m~/code/bigraph-viz/bigraph_viz/diagram.py:373\u001b[0m, in \u001b[0;36mplot_bigraph\u001b[0;34m(state, schema, core, out_dir, filename, file_format, size, node_label_size, show_values, show_types, port_labels, port_label_size, rankdir, print_source, dpi, label_margin, remove_nodes, invisible_edges, remove_process_place_edges)\u001b[0m\n\u001b[1;32m 370\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m core\u001b[38;5;241m.\u001b[39mexists(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mprocess\u001b[39m\u001b[38;5;124m'\u001b[39m):\n\u001b[1;32m 371\u001b[0m core\u001b[38;5;241m.\u001b[39mregister(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mprocess\u001b[39m\u001b[38;5;124m'\u001b[39m, process_type)\n\u001b[0;32m--> 373\u001b[0m schema, state \u001b[38;5;241m=\u001b[39m \u001b[43mcore\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcomplete\u001b[49m\u001b[43m(\u001b[49m\u001b[43mschema\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mstate\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 375\u001b[0m \u001b[38;5;66;03m# parse out the network\u001b[39;00m\n\u001b[1;32m 376\u001b[0m graph_dict \u001b[38;5;241m=\u001b[39m get_graph_dict(\n\u001b[1;32m 377\u001b[0m schema\u001b[38;5;241m=\u001b[39mschema,\n\u001b[1;32m 378\u001b[0m state\u001b[38;5;241m=\u001b[39mstate,\n\u001b[1;32m 379\u001b[0m core\u001b[38;5;241m=\u001b[39mcore,\n\u001b[1;32m 380\u001b[0m remove_nodes\u001b[38;5;241m=\u001b[39mremove_nodes,\n\u001b[1;32m 381\u001b[0m )\n", "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:1251\u001b[0m, in \u001b[0;36mTypeSystem.complete\u001b[0;34m(self, initial_schema, initial_state)\u001b[0m\n\u001b[1;32m 1245\u001b[0m state \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mhydrate(\n\u001b[1;32m 1246\u001b[0m full_schema,\n\u001b[1;32m 1247\u001b[0m initial_state)\n\u001b[1;32m 1249\u001b[0m \u001b[38;5;66;03m# fill in the parts of the composition schema\u001b[39;00m\n\u001b[1;32m 1250\u001b[0m \u001b[38;5;66;03m# determined by the state\u001b[39;00m\n\u001b[0;32m-> 1251\u001b[0m schema, state \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43minfer_schema\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 1252\u001b[0m \u001b[43m \u001b[49m\u001b[43mfull_schema\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1253\u001b[0m \u001b[43m \u001b[49m\u001b[43mstate\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1255\u001b[0m final_state \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mfill(schema, state)\n\u001b[1;32m 1257\u001b[0m \u001b[38;5;66;03m# TODO: add flag to types.access(copy=True)\u001b[39;00m\n", "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:1177\u001b[0m, in \u001b[0;36mTypeSystem.infer_schema\u001b[0;34m(self, schema, state, top_state, path)\u001b[0m\n\u001b[1;32m 1174\u001b[0m inner_path \u001b[38;5;241m=\u001b[39m path \u001b[38;5;241m+\u001b[39m (key,)\n\u001b[1;32m 1175\u001b[0m \u001b[38;5;66;03m# if get_path(schema, inner_path) is None or get_path(state, inner_path) is None:\u001b[39;00m\n\u001b[0;32m-> 1177\u001b[0m schema, top_state \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43minfer_schema\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 1178\u001b[0m \u001b[43m \u001b[49m\u001b[43mschema\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1179\u001b[0m \u001b[43m \u001b[49m\u001b[43mvalue\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1180\u001b[0m \u001b[43m \u001b[49m\u001b[43mtop_state\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mtop_state\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1181\u001b[0m \u001b[43m \u001b[49m\u001b[43mpath\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43minner_path\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1183\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(state, \u001b[38;5;28mstr\u001b[39m):\n\u001b[1;32m 1184\u001b[0m \u001b[38;5;28;01mpass\u001b[39;00m\n", "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:1177\u001b[0m, in \u001b[0;36mTypeSystem.infer_schema\u001b[0;34m(self, schema, state, top_state, path)\u001b[0m\n\u001b[1;32m 1174\u001b[0m inner_path \u001b[38;5;241m=\u001b[39m path \u001b[38;5;241m+\u001b[39m (key,)\n\u001b[1;32m 1175\u001b[0m \u001b[38;5;66;03m# if get_path(schema, inner_path) is None or get_path(state, inner_path) is None:\u001b[39;00m\n\u001b[0;32m-> 1177\u001b[0m schema, top_state \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43minfer_schema\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 1178\u001b[0m \u001b[43m \u001b[49m\u001b[43mschema\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1179\u001b[0m \u001b[43m \u001b[49m\u001b[43mvalue\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1180\u001b[0m \u001b[43m \u001b[49m\u001b[43mtop_state\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mtop_state\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1181\u001b[0m \u001b[43m \u001b[49m\u001b[43mpath\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43minner_path\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1183\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(state, \u001b[38;5;28mstr\u001b[39m):\n\u001b[1;32m 1184\u001b[0m \u001b[38;5;28;01mpass\u001b[39;00m\n", @@ -899,137 +901,10 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": null, "id": "638c5dc7-4cfd-46e4-b66a-8c42ca98ff1d", "metadata": {}, - "outputs": [ - { - "data": { - "image/svg+xml": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "bigraph\n", - "\n", - "\n", - "\n", - "('composite_process', 'store1.1')\n", - "\n", - "store1.1\n", - "\n", - "\n", - "\n", - "('composite_process', 'process1')\n", - "\n", - "process1\n", - "\n", - "\n", - "\n", - "('composite_process', 'store1.1')->('composite_process', 'process1')\n", - "\n", - "\n", - "port1\n", - "\n", - "\n", - "\n", - "('composite_process', 'process2')\n", - "\n", - "process2\n", - "\n", - "\n", - "\n", - "('composite_process', 'store1.1')->('composite_process', 'process2')\n", - "\n", - "\n", - "port1\n", - "\n", - "\n", - "\n", - "('composite_process', 'store1.2')\n", - "\n", - "store1.2\n", - "\n", - "\n", - "\n", - "('composite_process', 'store1.2')->('composite_process', 'process1')\n", - "\n", - "\n", - "port2\n", - "\n", - "\n", - "\n", - "('composite_process', 'store1.2')->('composite_process', 'process2')\n", - "\n", - "\n", - "port2\n", - "\n", - "\n", - "\n", - "('composite_process',)\n", - "\n", - "\n", - "composite_process\n", - "\n", - "\n", - "\n", - "('composite_process',)->('composite_process', 'store1.1')\n", - "\n", - "\n", - "\n", - "\n", - "('composite_process',)->('composite_process', 'store1.1')\n", - "\n", - "\n", - "tunnel port1\n", - "\n", - "\n", - "\n", - "('composite_process',)->('composite_process', 'store1.2')\n", - "\n", - "\n", - "\n", - "\n", - "('composite_process',)->('composite_process', 'store1.2')\n", - "\n", - "\n", - "tunnel port2\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "('composite_process', 'port1')->('composite_process',)\n", - "\n", - "\n", - "port1\n", - "\n", - "\n", - "\n", - "\n", - "('composite_process', 'port2')->('composite_process',)\n", - "\n", - "\n", - "port2\n", - "\n", - "\n", - "\n" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 11, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "composite_process_spec = {\n", " 'composite_process': {\n", @@ -1072,7 +947,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": null, "id": "e76c97a8-3037-464a-929e-ba4414c73c34", "metadata": {}, "outputs": [], @@ -1097,186 +972,10 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": null, "id": "f0eff7b0-f0e2-4d56-8b16-ef0fc1ce5aba", "metadata": {}, - "outputs": [ - { - "data": { - "image/svg+xml": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "flow\n", - "\n", - "\n", - "\n", - "('temporal<br/>process2',)\n", - "\n", - "temporal\n", - "process2\n", - "\n", - "\n", - "\n", - "('temporal<br/>process2',) 1.0\n", - "\n", - "1.0\n", - "\n", - "\n", - "\n", - "('temporal<br/>process2',)->('temporal<br/>process2',) 1.0\n", - "\n", - "\n", - "\n", - "\n", - "('temporal<br/>process2',) 2.0\n", - "\n", - "2.0\n", - "\n", - "\n", - "\n", - "('temporal<br/>process2',) 1.0->('temporal<br/>process2',) 2.0\n", - "\n", - "\n", - "\n", - "\n", - "('state',)\n", - "\n", - "state\n", - "\n", - "\n", - "\n", - "('temporal<br/>process2',) 1.0->('state',)\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "('temporal<br/>process2',) end\n", - "\n", - "\n", - "\n", - "\n", - "('temporal<br/>process2',) 2.0->('temporal<br/>process2',) end\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "('temporal<br/>process2',) 2.0->('state',)\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "('temporal<br/>process1',)\n", - "\n", - "temporal\n", - "process1\n", - "\n", - "\n", - "\n", - "('temporal<br/>process1',) 0.5\n", - "\n", - "0.5\n", - "\n", - "\n", - "\n", - "('temporal<br/>process1',)->('temporal<br/>process1',) 0.5\n", - "\n", - "\n", - "\n", - "\n", - "('temporal<br/>process1',) 1.0\n", - "\n", - "1.0\n", - "\n", - "\n", - "\n", - "('temporal<br/>process1',) 0.5->('temporal<br/>process1',) 1.0\n", - "\n", - "\n", - "\n", - "\n", - "('temporal<br/>process1',) 0.5->('state',)\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "('temporal<br/>process1',) 1.5\n", - "\n", - "1.5\n", - "\n", - "\n", - "\n", - "('temporal<br/>process1',) 1.0->('temporal<br/>process1',) 1.5\n", - "\n", - "\n", - "\n", - "\n", - "('temporal<br/>process1',) 1.0->('state',)\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "('temporal<br/>process1',) 2.0\n", - "\n", - "2.0\n", - "\n", - "\n", - "\n", - "('temporal<br/>process1',) 1.5->('temporal<br/>process1',) 2.0\n", - "\n", - "\n", - "\n", - "\n", - "('temporal<br/>process1',) 1.5->('state',)\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "('temporal<br/>process1',) end\n", - "\n", - "\n", - "\n", - "\n", - "('temporal<br/>process1',) 2.0->('temporal<br/>process1',) end\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "('temporal<br/>process1',) 2.0->('state',)\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 13, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "multitimestep_spec = {\n", " 'temporal process2': {\n", @@ -1306,78 +1005,10 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": null, "id": "db45c99b-b97b-47bc-a73e-c669882f3969", "metadata": {}, - "outputs": [ - { - "data": { - "image/svg+xml": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "flow\n", - "\n", - "\n", - "\n", - "('step1',)\n", - "\n", - "step1\n", - "\n", - "\n", - "\n", - "('step2',)\n", - "\n", - "step2\n", - "\n", - "\n", - "\n", - "('step1',)->('step2',)\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "('step4',)\n", - "\n", - "step4\n", - "\n", - "\n", - "\n", - "('step2',)->('step4',)\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "('step3',)\n", - "\n", - "step3\n", - "\n", - "\n", - "\n", - "('step3',)->('step4',)\n", - "\n", - "\n", - "\n", - "\n", - "\n" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 14, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "flow = {\n", " 'step1': {\n", @@ -1427,611 +1058,12 @@ }, { "cell_type": "code", - "execution_count": 25, + "execution_count": null, "id": "47bdf8e5-0bdd-4cac-b57e-2449c75fa178", "metadata": { "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Writing out/cell_hierarchy\n" - ] - }, - { - "data": { - "image/svg+xml": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "bigraph\n", - "\n", - "\n", - "\n", - "('cell',)\n", - "\n", - "cell\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm')\n", - "\n", - "cytoplasm\n", - "\n", - "\n", - "\n", - "('cell',)->('cell', 'cytoplasm')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus')\n", - "\n", - "nucleus\n", - "\n", - "\n", - "\n", - "('cell',)->('cell', 'nucleus')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'secretory<br/>organelles')\n", - "\n", - "secretory\n", - "organelles\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm')->('cell', 'cytoplasm', 'secretory<br/>organelles')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles')\n", - "\n", - "cytoplasmic\n", - "organelles\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'transcriptional<br/>regulation<br/>complex<br/>family')\n", - "\n", - "transcriptional\n", - "regulation\n", - "complex\n", - "family\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm')->('cell', 'cytoplasm', 'transcriptional<br/>regulation<br/>complex<br/>family')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'secretory<br/>organelles', 'transmembrane<br/>transport<br/>systems')\n", - "\n", - "transmembrane\n", - "transport\n", - "systems\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'secretory<br/>organelles')->('cell', 'cytoplasm', 'secretory<br/>organelles', 'transmembrane<br/>transport<br/>systems')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'secretory<br/>organelles', 'transmembrane<br/>transport<br/>systems', 'ion<br/>transmembrane<br/>transport<br/>systems')\n", - "\n", - "ion\n", - "transmembrane\n", - "transport\n", - "systems\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'secretory<br/>organelles', 'transmembrane<br/>transport<br/>systems')->('cell', 'cytoplasm', 'secretory<br/>organelles', 'transmembrane<br/>transport<br/>systems', 'ion<br/>transmembrane<br/>transport<br/>systems')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles')\n", - "\n", - "subgroup\n", - "of\n", - "cytoplasmic\n", - "organelles\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'metabolic<br/>organelles')\n", - "\n", - "metabolic\n", - "organelles\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'metabolic<br/>organelles')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family')\n", - "\n", - "ribonucleoprotein\n", - "complex\n", - "family\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'metabolic<br/>organelles', 'subgroup<br/>of<br/>metabolic<br/>organelles')\n", - "\n", - "subgroup\n", - "of\n", - "metabolic\n", - "organelles\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'metabolic<br/>organelles')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'metabolic<br/>organelles', 'subgroup<br/>of<br/>metabolic<br/>organelles')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'metabolic<br/>organelles', 'mitochondrion')\n", - "\n", - "mitochondrion\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'metabolic<br/>organelles')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'metabolic<br/>organelles', 'mitochondrion')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'RNA<br/>processing<br/>complex<br/>1')\n", - "\n", - "RNA\n", - "processing\n", - "complex\n", - "1\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'RNA<br/>processing<br/>complex<br/>1')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community')\n", - "\n", - "ribosome\n", - "biogenesis\n", - "community\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'RNA<br/>processing<br/>complex<br/>1', 'RNA<br/>splicing<br/>complex<br/>1')\n", - "\n", - "RNA\n", - "splicing\n", - "complex\n", - "1\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'RNA<br/>processing<br/>complex<br/>1')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'RNA<br/>processing<br/>complex<br/>1', 'RNA<br/>splicing<br/>complex<br/>1')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome')\n", - "\n", - "ribosome\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'nucleic<br/>acid<br/>binding<br/>complex')\n", - "\n", - "nucleic\n", - "acid\n", - "binding\n", - "complex\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'nucleic<br/>acid<br/>binding<br/>complex')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit')\n", - "\n", - "ribosomal\n", - "subunit\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'mitochondirial<br/>large<br/>ribosomal<br/>subunit')\n", - "\n", - "mitochondirial\n", - "large\n", - "ribosomal\n", - "subunit\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'mitochondirial<br/>large<br/>ribosomal<br/>subunit')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'mito-cyto<br/>ribosomal<br/>cluster')\n", - "\n", - "mito-cyto\n", - "ribosomal\n", - "cluster\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'mito-cyto<br/>ribosomal<br/>cluster')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'cotranslational<br/>protein<br/>targeting<br/>to<br/>membrane<br/>system')\n", - "\n", - "cotranslational\n", - "protein\n", - "targeting\n", - "to\n", - "membrane\n", - "system\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'cotranslational<br/>protein<br/>targeting<br/>to<br/>membrane<br/>system')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'ribosomal<br/>complex<br/>5')\n", - "\n", - "ribosomal\n", - "complex\n", - "5\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'ribosomal<br/>complex<br/>5')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'ribosomal<br/>complex<br/>2')\n", - "\n", - "ribosomal\n", - "complex\n", - "2\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'ribosomal<br/>complex<br/>2')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'transcriptional<br/>regulation<br/>complex<br/>family', 'transcriptional<br/>regulation<br/>complexes')\n", - "\n", - "transcriptional\n", - "regulation\n", - "complexes\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'transcriptional<br/>regulation<br/>complex<br/>family')->('cell', 'cytoplasm', 'transcriptional<br/>regulation<br/>complex<br/>family', 'transcriptional<br/>regulation<br/>complexes')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'DNA<br/>metabolic<br/>assembly')\n", - "\n", - "DNA\n", - "metabolic\n", - "assembly\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus')->('cell', 'nucleus', 'DNA<br/>metabolic<br/>assembly')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nuclear<br/>lumen')\n", - "\n", - "nuclear\n", - "lumen\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus')->('cell', 'nucleus', 'nuclear<br/>lumen')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nuclear<br/>body')\n", - "\n", - "nuclear\n", - "body\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus')->('cell', 'nucleus', 'nuclear<br/>body')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nucleo-plasm<br/>1')\n", - "\n", - "nucleo-plasm\n", - "1\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus')->('cell', 'nucleus', 'nucleo-plasm<br/>1')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nucleo-plasm<br/>2')\n", - "\n", - "nucleo-plasm\n", - "2\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus')->('cell', 'nucleus', 'nucleo-plasm<br/>2')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nuclear<br/>transcriptional<br/>speckle')\n", - "\n", - "nuclear\n", - "transcriptional\n", - "speckle\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus')->('cell', 'nucleus', 'nuclear<br/>transcriptional<br/>speckle')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus')\n", - "\n", - "nucleolus\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nuclear<br/>lumen')->('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nuclear<br/>lumen', 'nuclear<br/>splicing<br/>speckle')\n", - "\n", - "nuclear\n", - "splicing\n", - "speckle\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nuclear<br/>lumen')->('cell', 'nucleus', 'nuclear<br/>lumen', 'nuclear<br/>splicing<br/>speckle')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'ribonucleprotein<br/>complex<br/>family')\n", - "\n", - "ribonucleprotein\n", - "complex\n", - "family\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus')->('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'ribonucleprotein<br/>complex<br/>family')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'RNA<br/>processing<br/>complex<br/>family')\n", - "\n", - "RNA\n", - "processing\n", - "complex\n", - "family\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus')->('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'RNA<br/>processing<br/>complex<br/>family')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'splicosomal<br/>complex<br/>family')\n", - "\n", - "splicosomal\n", - "complex\n", - "family\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus')->('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'splicosomal<br/>complex<br/>family')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'RNA<br/>processing<br/>complex<br/>family', 'RNA<br/>processing<br/>complex<br/>1')\n", - "\n", - "RNA\n", - "processing\n", - "complex\n", - "1\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'RNA<br/>processing<br/>complex<br/>family')->('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'RNA<br/>processing<br/>complex<br/>family', 'RNA<br/>processing<br/>complex<br/>1')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'RNA<br/>processing<br/>complex<br/>family', 'RNA<br/>splicing<br/>complex<br/>family')\n", - "\n", - "RNA\n", - "splicing\n", - "complex\n", - "family\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'RNA<br/>processing<br/>complex<br/>family')->('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'RNA<br/>processing<br/>complex<br/>family', 'RNA<br/>splicing<br/>complex<br/>family')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family')\n", - "\n", - "chromosome\n", - "organization\n", - "complex\n", - "family\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nucleo-plasm<br/>1')->('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family', 'chromatin<br/>organization<br/>complex<br/>family')\n", - "\n", - "chromatin\n", - "organization\n", - "complex\n", - "family\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family')->('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family', 'chromatin<br/>organization<br/>complex<br/>family')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family', 'chromatin<br/>organization<br/>complex<br/>family', 'HAT<br/>complex<br/>family')\n", - "\n", - "HAT\n", - "complex\n", - "family\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family', 'chromatin<br/>organization<br/>complex<br/>family')->('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family', 'chromatin<br/>organization<br/>complex<br/>family', 'HAT<br/>complex<br/>family')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family', 'chromatin<br/>organization<br/>complex<br/>family', 'HAT<br/>complex<br/>family', 'NuA4<br/>HAT<br/>complex')\n", - "\n", - "NuA4\n", - "HAT\n", - "complex\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family', 'chromatin<br/>organization<br/>complex<br/>family', 'HAT<br/>complex<br/>family')->('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family', 'chromatin<br/>organization<br/>complex<br/>family', 'HAT<br/>complex<br/>family', 'NuA4<br/>HAT<br/>complex')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nucleo-plasm<br/>2', 'chromatin<br/>regulation<br/>complex')\n", - "\n", - "chromatin\n", - "regulation\n", - "complex\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nucleo-plasm<br/>2')->('cell', 'nucleus', 'nucleo-plasm<br/>2', 'chromatin<br/>regulation<br/>complex')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nuclear<br/>transcriptional<br/>speckle', 'negative<br/>regulation<br/>of<br/>RNA<br/>biosynthesis<br/>process')\n", - "\n", - "negative\n", - "regulation\n", - "of\n", - "RNA\n", - "biosynthesis\n", - "process\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nuclear<br/>transcriptional<br/>speckle')->('cell', 'nucleus', 'nuclear<br/>transcriptional<br/>speckle', 'negative<br/>regulation<br/>of<br/>RNA<br/>biosynthesis<br/>process')\n", - "\n", - "\n", - "\n", - "\n" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 25, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "music_map = {\n", " 'cell': {\n", @@ -2085,67 +1117,24 @@ }, { "cell_type": "code", - "execution_count": 26, + "execution_count": null, "id": "ab431982-d156-4b7a-9918-384a5ea5132a", "metadata": { "tags": [] }, - "outputs": [ - { - "data": { - "text/plain": [ - "{'cell': {'cytoplasm': {'secretory organelles': {'transmembrane transport systems': {'ion transmembrane transport systems': {}}},\n", - " 'cytoplasmic organelles': {'subgroup of cytoplasmic organelles': {'metabolic organelles': {'subgroup of metabolic organelles': {},\n", - " 'mitochondrion': {}},\n", - " 'ribonucleoprotein complex family': {'RNA processing complex 1': {'RNA splicing complex 1': {}},\n", - " 'ribosome biogenesis community': {'ribosome': {'ribosomal subunit': {'mitochondirial large ribosomal subunit': {},\n", - " 'mito-cyto ribosomal cluster': {},\n", - " 'cotranslational protein targeting to membrane system': {},\n", - " 'ribosomal complex 5': {},\n", - " 'ribosomal complex 2': {}}},\n", - " 'nucleic acid binding complex': {}}}}},\n", - " 'transcriptional regulation complex family': {'transcriptional regulation complexes': {}}},\n", - " 'nucleus': {'DNA metabolic assembly': {},\n", - " 'nuclear lumen': {'nucleolus': {'ribonucleprotein complex family': {},\n", - " 'RNA processing complex family': {'RNA processing complex 1': {},\n", - " 'RNA splicing complex family': {}},\n", - " 'splicosomal complex family': {}},\n", - " 'nuclear splicing speckle': {}},\n", - " 'nuclear body': {},\n", - " 'nucleo-plasm 1': {'chromosome organization complex family': {'chromatin organization complex family': {'HAT complex family': {'NuA4 HAT complex': {}}}}},\n", - " 'nucleo-plasm 2': {'chromatin regulation complex': {}},\n", - " 'nuclear transcriptional speckle': {'negative regulation of RNA biosynthesis process': {}}}}}" - ] - }, - "execution_count": 26, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "music_map" ] }, { "cell_type": "code", - "execution_count": 27, + "execution_count": null, "id": "5a76608a-fff0-4005-9f32-c02afef39d9e", "metadata": { "tags": [] }, - "outputs": [ - { - "ename": "TypeError", - "evalue": "plot_bigraph() got an unexpected keyword argument 'node_border_colors'", - "output_type": "error", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)", - "Cell \u001b[0;32mIn[27], line 128\u001b[0m\n\u001b[1;32m 118\u001b[0m plot_settingsx[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mnode_border_colors\u001b[39m\u001b[38;5;124m'\u001b[39m] \u001b[38;5;241m=\u001b[39m {\n\u001b[1;32m 119\u001b[0m (\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mcell\u001b[39m\u001b[38;5;124m'\u001b[39m, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mtranslation\u001b[39m\u001b[38;5;124m'\u001b[39m): \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mblue\u001b[39m\u001b[38;5;124m'\u001b[39m,\n\u001b[1;32m 120\u001b[0m (\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mcell\u001b[39m\u001b[38;5;124m'\u001b[39m, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mtranscription\u001b[39m\u001b[38;5;124m'\u001b[39m): \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mblue\u001b[39m\u001b[38;5;124m'\u001b[39m,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 125\u001b[0m (\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mcell\u001b[39m\u001b[38;5;124m'\u001b[39m, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mRNA
processing\u001b[39m\u001b[38;5;124m'\u001b[39m): \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mblue\u001b[39m\u001b[38;5;124m'\u001b[39m,\n\u001b[1;32m 126\u001b[0m }\n\u001b[1;32m 127\u001b[0m \u001b[38;5;66;03m# plot_settingsx.update({'out_dir': 'out','dpi': '250'})\u001b[39;00m\n\u001b[0;32m--> 128\u001b[0m \u001b[43mplot_bigraph\u001b[49m\u001b[43m(\u001b[49m\u001b[43mmusic_map2\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mplot_settingsx\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mfilename\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mcell_hierarchy_functions\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m)\u001b[49m\n", - "\u001b[0;31mTypeError\u001b[0m: plot_bigraph() got an unexpected keyword argument 'node_border_colors'" - ] - } - ], + "outputs": [], "source": [ "import copy\n", "\n", @@ -2279,59 +1268,12 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": null, "id": "fe3008ad-498e-449f-8521-6ea29fd903f1", "metadata": { "tags": [] }, - "outputs": [ - { - "data": { - "image/svg+xml": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "bigraph\n", - "\n", - "\n", - "\n", - "('hypothesized<br/>mechanism',)\n", - "\n", - "hypothesized\n", - "mechanism\n", - "\n", - "\n", - "\n", - "\n", - "('hypothesized<br/>mechanism', '1')->('hypothesized<br/>mechanism',)\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "('hypothesized<br/>mechanism', '2')->('hypothesized<br/>mechanism',)\n", - "\n", - "\n", - "\n", - "\n", - "\n" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 18, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "new_process = {\n", " 'hypothesized mechanism': {\n", @@ -2365,222 +1307,12 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": null, "id": "b39417ce-d9a1-4985-abce-ce22df816897", "metadata": { "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Writing out/cell\n" - ] - }, - { - "data": { - "image/svg+xml": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "bigraph\n", - "\n", - "\n", - "\n", - "('cell',)\n", - "\n", - "cell\n", - "\n", - "\n", - "\n", - "('cell', 'membrane')\n", - "\n", - "membrane\n", - "\n", - "\n", - "\n", - "('cell',)->('cell', 'membrane')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm')\n", - "\n", - "cytoplasm\n", - "\n", - "\n", - "\n", - "('cell',)->('cell', 'cytoplasm')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleoid')\n", - "\n", - "nucleoid\n", - "\n", - "\n", - "\n", - "('cell',)->('cell', 'nucleoid')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'membrane', 'transporters')\n", - "\n", - "transporters\n", - "\n", - "\n", - "\n", - "('cell', 'membrane')->('cell', 'membrane', 'transporters')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'membrane', 'lipids')\n", - "\n", - "lipids\n", - "\n", - "\n", - "\n", - "('cell', 'membrane')->('cell', 'membrane', 'lipids')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'membrane', 'transmembrane transport')\n", - "\n", - "transmembrane transport\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'membrane', 'transporters')->('cell', 'membrane', 'transmembrane transport')\n", - "\n", - "\n", - "transporters\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'metabolites')\n", - "\n", - "metabolites\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm')->('cell', 'cytoplasm', 'metabolites')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'ribosomal complexes')\n", - "\n", - "ribosomal complexes\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm')->('cell', 'cytoplasm', 'ribosomal complexes')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'transcript regulation complex')\n", - "\n", - "transcript regulation complex\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm')->('cell', 'cytoplasm', 'transcript regulation complex')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'translation')\n", - "\n", - "translation\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'metabolites')->('cell', 'membrane', 'transmembrane transport')\n", - "\n", - "\n", - "internal\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'ribosomal complexes')->('cell', 'cytoplasm', 'translation')\n", - "\n", - "\n", - "p1\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'transcript regulation complex', 'transcripts')\n", - "\n", - "transcripts\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'transcript regulation complex')->('cell', 'cytoplasm', 'transcript regulation complex', 'transcripts')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'transcript regulation complex', 'transcripts')->('cell', 'cytoplasm', 'translation')\n", - "\n", - "\n", - "p2\n", - "\n", - "\n", - "\n", - "('cell', 'nucleoid', 'chromosome')\n", - "\n", - "chromosome\n", - "\n", - "\n", - "\n", - "('cell', 'nucleoid')->('cell', 'nucleoid', 'chromosome')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleoid', 'chromosome', 'genes')\n", - "\n", - "genes\n", - "\n", - "\n", - "\n", - "('cell', 'nucleoid', 'chromosome')->('cell', 'nucleoid', 'chromosome', 'genes')\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'membrane', 'transmembrane transport', 'external')->('cell', 'membrane', 'transmembrane transport')\n", - "\n", - "\n", - "external\n", - "\n", - "\n", - "\n" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 19, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "cell_struct_func = {\n", " 'cell': {\n", @@ -2644,20 +1376,12 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": null, "id": "16960d1b-6e35-421e-bb7d-3efe5052e4fc", "metadata": { "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Writing out/ecoli\n" - ] - } - ], + "outputs": [], "source": [ "ecoli = { \n", " 'chromosome-structure': { \n", From eb759a2abd4f41cf806bfc81bb62f7abc333e3b1 Mon Sep 17 00:00:00 2001 From: Eran Date: Sun, 11 Feb 2024 13:49:29 -0500 Subject: [PATCH 02/11] input/output working in all conditions --- bigraph_viz/diagram.py | 138 +++++++++++++++++++++++------------------ 1 file changed, 78 insertions(+), 60 deletions(-) diff --git a/bigraph_viz/diagram.py b/bigraph_viz/diagram.py index c6569e2..b96b218 100644 --- a/bigraph_viz/diagram.py +++ b/bigraph_viz/diagram.py @@ -22,12 +22,11 @@ '_inherit': 'step', 'interval': 'float'} -def plot_edges(graph, edge, edge_spec, port_labels, port_label_size, state_node_spec): +def plot_edges(graph, edge, port_labels, port_label_size, state_node_spec): process_path = edge['edge_path'] process_name = str(process_path) target_path = edge['target_path'] port = edge['port'] - # edge_type = edge['type'] # input or output target_name = str(target_path) # place it in the graph @@ -41,13 +40,13 @@ def plot_edges(graph, edge, edge_spec, port_labels, port_label_size, state_node_ label = make_label(port) with graph.subgraph(name=process_name) as c: - graph.attr('edge', **edge_spec) c.edge( target_name, process_name, label=label, labelloc="t", fontsize=port_label_size) + def get_graph_wires(schema, wires, graph_dict, schema_key, edge_path, port): if isinstance(schema, dict) and schema: @@ -57,10 +56,18 @@ def get_graph_wires(schema, wires, graph_dict, schema_key, edge_path, port): graph_dict = get_graph_wires( subschema, subwire, graph_dict, schema_key, edge_path, port) else: # this is a disconnected port - graph_dict['disconnected_hyper_edges'].append({ - 'edge_path': edge_path, - 'port': port, - 'type': schema_key}) + if schema_key == 'inputs': + graph_dict['disconnected_input_edges'].append({ + 'edge_path': edge_path, + 'port': port, + 'type': schema_key}) + elif schema_key == 'outputs': + graph_dict['disconnected_output_edges'].append({ + 'edge_path': edge_path, + 'port': port, + 'type': schema_key}) + else: + raise Exception(f'invalid schema key {schema_key}') elif isinstance(wires, dict): for port, subwire in wires.items(): subschema = schema.get(port, schema) @@ -105,10 +112,10 @@ def get_graph_dict( 'state_nodes': [], 'process_nodes': [], 'place_edges': [], - # 'hyper_edges': [], 'input_edges': [], 'output_edges': [], - 'disconnected_hyper_edges': [], + 'disconnected_input_edges': [], + 'disconnected_output_edges': [], 'bridges': [], } @@ -279,45 +286,39 @@ def get_graphviz_fig( # input edges for edge in graph_dict['input_edges']: - plot_edges( - graph, edge, input_edge_spec, - port_labels, port_label_size, state_node_spec) + graph.attr('edge', **input_edge_spec) + plot_edges(graph, edge, port_labels, port_label_size, state_node_spec) + + # output edges for edge in graph_dict['output_edges']: - plot_edges( - graph, edge, output_edge_spec, - port_labels, port_label_size, state_node_spec) - - # disconnected hyper edges - graph.attr('edge', **hyper_edge_spec) - for edge in graph_dict['disconnected_hyper_edges']: + graph.attr('edge', **output_edge_spec) + plot_edges(graph, edge, port_labels, port_label_size, state_node_spec) + + # disconnected input edges + for edge in graph_dict['disconnected_input_edges']: process_path = edge['edge_path'] - process_name = str(process_path) port = edge['port'] - edge_type = edge['type'] # input or output # add invisible node for port node_name2 = str(absolute_path(process_path, port)) graph.node(node_name2, label='', style='invis', width='0') + edge['target_path'] = node_name2 - # port label - label = '' - if port_labels: - label = make_label(port) - - # add the edge - with graph.subgraph(name=process_name) as c: - if edge_type == 'inputs': - graph.attr('edge', **input_edge_spec) - elif edge_type == 'outputs': - graph.attr('edge', **output_edge_spec) - else: - graph.attr('edge', **hyper_edge_spec) - c.edge( - node_name2, process_name, - label=label, - labelloc="t", - fontsize=port_label_size - ) + graph.attr('edge', **input_edge_spec) + plot_edges(graph, edge, port_labels, port_label_size, state_node_spec) + + # disconnected output edges + for edge in graph_dict['disconnected_output_edges']: + process_path = edge['edge_path'] + port = edge['port'] + + # add invisible node for port + node_name2 = str(absolute_path(process_path, port)) + graph.node(node_name2, label='', style='invis', width='0') + edge['target_path'] = node_name2 + + graph.attr('edge', **output_edge_spec) + plot_edges(graph, edge, port_labels, port_label_size, state_node_spec) return graph @@ -472,29 +473,46 @@ def test_bio_schema(): plot_bigraph(b, filename='bioschema') def test_input_output(): - flat_composite_spec = { - 'store1.1': 'float', - 'store1.2': 'int', - 'process1': { - '_type': 'process', - 'outputs': { - 'port1': ['store1.1'], - 'port2': ['store1.2'], - } + # flat_composite_spec = { + # 'store1.1': 'float', + # 'store1.2': 'int', + # 'process1': { + # '_type': 'process', + # 'outputs': { + # 'port1': ['store1.1'], + # 'port2': ['store1.2'], + # } + # }, + # 'process2': { + # '_type': 'process', + # '_inputs': { + # 'port1': 'any', + # 'port2': 'any', + # }, + # 'inputs': { + # 'port1': ['store1.1'], + # 'port2': ['store1.2'], + # } + # }, + # } + # plot_bigraph(flat_composite_spec, rankdir='RL', filename='flat_composite') + + process_schema = { + '_type': 'process', + '_inputs': { + 'port1': 'Any', }, - 'process2': { - '_type': 'process', - '_inputs': { - 'port1': 'any', - 'port2': 'any', - }, - 'inputs': { - 'port1': ['store1.1'], - 'port2': ['store1.2'], - } + '_outputs': { + 'port2': 'Any' }, } - plot_bigraph(flat_composite_spec, rankdir='RL', filename='flat_composite') + + processes_spec = { + 'process1': process_schema, + 'process2': process_schema, + 'process3': process_schema, + } + plot_bigraph(processes_spec, rankdir='BT', filename='multiple_processes') if __name__ == '__main__': # test_diagram_plot() From 7cf9829033800a4942a551275519893e41eb7d32 Mon Sep 17 00:00:00 2001 From: Eran Date: Sun, 11 Feb 2024 14:05:12 -0500 Subject: [PATCH 03/11] working through basics notebook --- bigraph_viz/diagram.py | 82 +++++++--- notebooks/basics2.ipynb | 327 ++++++++++++++++++++++++++++------------ 2 files changed, 286 insertions(+), 123 deletions(-) diff --git a/bigraph_viz/diagram.py b/bigraph_viz/diagram.py index b96b218..23b6435 100644 --- a/bigraph_viz/diagram.py +++ b/bigraph_viz/diagram.py @@ -473,30 +473,31 @@ def test_bio_schema(): plot_bigraph(b, filename='bioschema') def test_input_output(): - # flat_composite_spec = { - # 'store1.1': 'float', - # 'store1.2': 'int', - # 'process1': { - # '_type': 'process', - # 'outputs': { - # 'port1': ['store1.1'], - # 'port2': ['store1.2'], - # } - # }, - # 'process2': { - # '_type': 'process', - # '_inputs': { - # 'port1': 'any', - # 'port2': 'any', - # }, - # 'inputs': { - # 'port1': ['store1.1'], - # 'port2': ['store1.2'], - # } - # }, - # } - # plot_bigraph(flat_composite_spec, rankdir='RL', filename='flat_composite') + flat_composite_spec = { + 'store1.1': 'float', + 'store1.2': 'int', + 'process1': { + '_type': 'process', + 'outputs': { + 'port1': ['store1.1'], + 'port2': ['store1.2'], + } + }, + 'process2': { + '_type': 'process', + '_inputs': { + 'port1': 'any', + 'port2': 'any', + }, + 'inputs': { + 'port1': ['store1.1'], + 'port2': ['store1.2'], + } + }, + } + plot_bigraph(flat_composite_spec, rankdir='RL', filename='flat_composite') +def test_multi_processes(): process_schema = { '_type': 'process', '_inputs': { @@ -514,7 +515,40 @@ def test_input_output(): } plot_bigraph(processes_spec, rankdir='BT', filename='multiple_processes') +def test_nested_processes(): + nested_composite_spec = { + 'store1': { + 'store1.1': 'float', + 'store1.2': 'int', + 'process1': { + '_type': 'process', + 'inputs': { + 'port1': ['store1.1'], + 'port2': ['store1.2'], + } + }, + 'process2': { + '_type': 'process', + 'outputs': { + 'port1': ['store1.1'], + 'port2': ['store1.2'], + } + }, + }, + 'process3': { + '_type': 'process', + 'inputs': { + 'port1': ['store1'], + } + } + } + plot_bigraph(nested_composite_spec, + # **plot_settings, + filename='nested_composite') + if __name__ == '__main__': # test_diagram_plot() # test_bio_schema() - test_input_output() + # test_input_output() + # test_multi_processes() + test_nested_processes() \ No newline at end of file diff --git a/notebooks/basics2.ipynb b/notebooks/basics2.ipynb index 8d33f3d..40cd577 100644 --- a/notebooks/basics2.ipynb +++ b/notebooks/basics2.ipynb @@ -25,7 +25,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 12, "id": "63fb7d1a-cd49-4aac-8d4f-31bb54496a51", "metadata": { "tags": [] @@ -35,8 +35,8 @@ "name": "stdout", "output_type": "stream", "text": [ - "-e git+https://github.com/vivarium-collective/bigraph-schema.git@0c90a88ffe83c4b88d057e28a4f30fb19ef0263e#egg=bigraph_schema\n", - "-e git+https://github.com/vivarium-collective/bigraph-viz.git@d6f8103cd0486b23a4804ac5bdc32ede474c7e18#egg=bigraph_viz\n", + "-e git+https://github.com/vivarium-collective/bigraph-schema.git@3b0bd4f5211e513577fd4c4f18468d1f3a908261#egg=bigraph_schema\n", + "-e git+https://github.com/vivarium-collective/bigraph-viz.git@eb759a2abd4f41cf806bfc81bb62f7abc333e3b1#egg=bigraph_viz\n", "-e git+https://github.com/vivarium-collective/process-bigraph.git@6517fc88103bc3cfaad4d5a1fdbd9131015360d4#egg=process_bigraph\n" ] } @@ -57,7 +57,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 13, "id": "2ab3cb32-e007-45c4-807e-b1b442ac1608", "metadata": { "tags": [] @@ -97,7 +97,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 14, "id": "d711b952-089a-4938-817d-d1ccad9de56e", "metadata": { "tags": [] @@ -134,10 +134,10 @@ "\n" ], "text/plain": [ - "" + "" ] }, - "execution_count": 3, + "execution_count": 14, "metadata": {}, "output_type": "execute_result" } @@ -159,7 +159,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 15, "id": "f3e5fa71-7ffc-4a8f-a1a0-dc547c886f84", "metadata": {}, "outputs": [ @@ -195,10 +195,10 @@ "\n" ], "text/plain": [ - "" + "" ] }, - "execution_count": 4, + "execution_count": 15, "metadata": {}, "output_type": "execute_result" } @@ -224,7 +224,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 16, "id": "0f3f0824-f89d-4c6e-830e-2c5a321f7b33", "metadata": {}, "outputs": [ @@ -325,10 +325,10 @@ "\n" ], "text/plain": [ - "" + "" ] }, - "execution_count": 5, + "execution_count": 16, "metadata": {}, "output_type": "execute_result" } @@ -368,7 +368,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 17, "id": "7c74237b-0d66-4e8f-a8ca-79174fadad8b", "metadata": {}, "outputs": [ @@ -388,41 +388,41 @@ "\n", "\n", - "\n", - "\n", + "\n", + "\n", "bigraph\n", - "\n", + "\n", "\n", "\n", "('process1',)\n", - "\n", - "process1\n", + "\n", + "process1\n", "\n", "\n", "\n", "\n", "('process1', 'p', 'o', 'r', 't', '1')->('process1',)\n", - "\n", - "\n", - "port1\n", + "\n", + "\n", + "port1\n", "\n", "\n", "\n", "\n", "('process1', 'p', 'o', 'r', 't', '2')->('process1',)\n", - "\n", - "\n", - "port2\n", + "\n", + "\n", + "port2\n", "\n", "\n", "\n" ], "text/plain": [ - "" + "" ] }, - "execution_count": 6, + "execution_count": 17, "metadata": {}, "output_type": "execute_result" } @@ -450,7 +450,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 18, "id": "8c2457a3-fc47-4850-8b9e-9ee98e81567d", "metadata": {}, "outputs": [ @@ -470,85 +470,85 @@ "\n", "\n", - "\n", - "\n", + "\n", + "\n", "bigraph\n", - "\n", + "\n", "\n", "\n", "('process1',)\n", - "\n", - "process1\n", + "\n", + "process1\n", "\n", "\n", "\n", "('process2',)\n", - "\n", - "process2\n", + "\n", + "process2\n", "\n", "\n", "\n", "('process3',)\n", - "\n", - "process3\n", + "\n", + "process3\n", "\n", "\n", "\n", "\n", "('process1', 'p', 'o', 'r', 't', '1')->('process1',)\n", - "\n", - "\n", - "port1\n", - "\n", - "\n", - "\n", - "\n", - "('process1', 'p', 'o', 'r', 't', '2')->('process1',)\n", - "\n", - "\n", - "port2\n", + "\n", + "\n", + "port1\n", "\n", "\n", "\n", - "\n", + "\n", "('process2', 'p', 'o', 'r', 't', '1')->('process2',)\n", - "\n", - "\n", - "port1\n", - "\n", - "\n", - "\n", - "\n", - "('process2', 'p', 'o', 'r', 't', '2')->('process2',)\n", - "\n", - "\n", - "port2\n", + "\n", + "\n", + "port1\n", "\n", "\n", "\n", - "\n", + "\n", "('process3', 'p', 'o', 'r', 't', '1')->('process3',)\n", - "\n", - "\n", - "port1\n", + "\n", + "\n", + "port1\n", + "\n", + "\n", + "\n", + "\n", + "('process1', 'p', 'o', 'r', 't', '2')->('process1',)\n", + "\n", + "\n", + "port2\n", + "\n", + "\n", + "\n", + "\n", + "('process2', 'p', 'o', 'r', 't', '2')->('process2',)\n", + "\n", + "\n", + "port2\n", "\n", "\n", "\n", "\n", "('process3', 'p', 'o', 'r', 't', '2')->('process3',)\n", - "\n", - "\n", - "port2\n", + "\n", + "\n", + "port2\n", "\n", "\n", "\n" ], "text/plain": [ - "" + "" ] }, - "execution_count": 7, + "execution_count": 18, "metadata": {}, "output_type": "execute_result" } @@ -583,7 +583,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 19, "id": "a6ecad5d-8948-4636-910c-79284a3e8679", "metadata": {}, "outputs": [ @@ -657,10 +657,10 @@ "\n" ], "text/plain": [ - "" + "" ] }, - "execution_count": 8, + "execution_count": 19, "metadata": {}, "output_type": "execute_result" } @@ -715,7 +715,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 20, "id": "781a84e6-bbe2-4708-b441-47efc611b46f", "metadata": {}, "outputs": [ @@ -796,10 +796,10 @@ "\n" ], "text/plain": [ - "" + "" ] }, - "execution_count": 9, + "execution_count": 20, "metadata": {}, "output_type": "execute_result" } @@ -837,27 +837,132 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 21, "id": "701e759d-7f9b-41bb-911c-a8208c892462", "metadata": {}, "outputs": [ { - "ename": "TypeError", - "evalue": "argument of type 'NoneType' is not iterable", - "output_type": "error", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)", - "Cell \u001b[0;32mIn[10], line 27\u001b[0m\n\u001b[1;32m 1\u001b[0m nested_composite_spec \u001b[38;5;241m=\u001b[39m {\n\u001b[1;32m 2\u001b[0m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mstore1\u001b[39m\u001b[38;5;124m'\u001b[39m: {\n\u001b[1;32m 3\u001b[0m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mstore1.1\u001b[39m\u001b[38;5;124m'\u001b[39m: \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mfloat\u001b[39m\u001b[38;5;124m'\u001b[39m,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 25\u001b[0m }\n\u001b[1;32m 26\u001b[0m }\n\u001b[0;32m---> 27\u001b[0m \u001b[43mplot_bigraph\u001b[49m\u001b[43m(\u001b[49m\u001b[43mnested_composite_spec\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mplot_settings\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mfilename\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mnested_composite\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m)\u001b[49m\n", - "File \u001b[0;32m~/code/bigraph-viz/bigraph_viz/diagram.py:373\u001b[0m, in \u001b[0;36mplot_bigraph\u001b[0;34m(state, schema, core, out_dir, filename, file_format, size, node_label_size, show_values, show_types, port_labels, port_label_size, rankdir, print_source, dpi, label_margin, remove_nodes, invisible_edges, remove_process_place_edges)\u001b[0m\n\u001b[1;32m 370\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m core\u001b[38;5;241m.\u001b[39mexists(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mprocess\u001b[39m\u001b[38;5;124m'\u001b[39m):\n\u001b[1;32m 371\u001b[0m core\u001b[38;5;241m.\u001b[39mregister(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mprocess\u001b[39m\u001b[38;5;124m'\u001b[39m, process_type)\n\u001b[0;32m--> 373\u001b[0m schema, state \u001b[38;5;241m=\u001b[39m \u001b[43mcore\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcomplete\u001b[49m\u001b[43m(\u001b[49m\u001b[43mschema\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mstate\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 375\u001b[0m \u001b[38;5;66;03m# parse out the network\u001b[39;00m\n\u001b[1;32m 376\u001b[0m graph_dict \u001b[38;5;241m=\u001b[39m get_graph_dict(\n\u001b[1;32m 377\u001b[0m schema\u001b[38;5;241m=\u001b[39mschema,\n\u001b[1;32m 378\u001b[0m state\u001b[38;5;241m=\u001b[39mstate,\n\u001b[1;32m 379\u001b[0m core\u001b[38;5;241m=\u001b[39mcore,\n\u001b[1;32m 380\u001b[0m remove_nodes\u001b[38;5;241m=\u001b[39mremove_nodes,\n\u001b[1;32m 381\u001b[0m )\n", - "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:1251\u001b[0m, in \u001b[0;36mTypeSystem.complete\u001b[0;34m(self, initial_schema, initial_state)\u001b[0m\n\u001b[1;32m 1245\u001b[0m state \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mhydrate(\n\u001b[1;32m 1246\u001b[0m full_schema,\n\u001b[1;32m 1247\u001b[0m initial_state)\n\u001b[1;32m 1249\u001b[0m \u001b[38;5;66;03m# fill in the parts of the composition schema\u001b[39;00m\n\u001b[1;32m 1250\u001b[0m \u001b[38;5;66;03m# determined by the state\u001b[39;00m\n\u001b[0;32m-> 1251\u001b[0m schema, state \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43minfer_schema\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 1252\u001b[0m \u001b[43m \u001b[49m\u001b[43mfull_schema\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1253\u001b[0m \u001b[43m \u001b[49m\u001b[43mstate\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1255\u001b[0m final_state \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mfill(schema, state)\n\u001b[1;32m 1257\u001b[0m \u001b[38;5;66;03m# TODO: add flag to types.access(copy=True)\u001b[39;00m\n", - "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:1177\u001b[0m, in \u001b[0;36mTypeSystem.infer_schema\u001b[0;34m(self, schema, state, top_state, path)\u001b[0m\n\u001b[1;32m 1174\u001b[0m inner_path \u001b[38;5;241m=\u001b[39m path \u001b[38;5;241m+\u001b[39m (key,)\n\u001b[1;32m 1175\u001b[0m \u001b[38;5;66;03m# if get_path(schema, inner_path) is None or get_path(state, inner_path) is None:\u001b[39;00m\n\u001b[0;32m-> 1177\u001b[0m schema, top_state \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43minfer_schema\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 1178\u001b[0m \u001b[43m \u001b[49m\u001b[43mschema\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1179\u001b[0m \u001b[43m \u001b[49m\u001b[43mvalue\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1180\u001b[0m \u001b[43m \u001b[49m\u001b[43mtop_state\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mtop_state\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1181\u001b[0m \u001b[43m \u001b[49m\u001b[43mpath\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43minner_path\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1183\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(state, \u001b[38;5;28mstr\u001b[39m):\n\u001b[1;32m 1184\u001b[0m \u001b[38;5;28;01mpass\u001b[39;00m\n", - "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:1177\u001b[0m, in \u001b[0;36mTypeSystem.infer_schema\u001b[0;34m(self, schema, state, top_state, path)\u001b[0m\n\u001b[1;32m 1174\u001b[0m inner_path \u001b[38;5;241m=\u001b[39m path \u001b[38;5;241m+\u001b[39m (key,)\n\u001b[1;32m 1175\u001b[0m \u001b[38;5;66;03m# if get_path(schema, inner_path) is None or get_path(state, inner_path) is None:\u001b[39;00m\n\u001b[0;32m-> 1177\u001b[0m schema, top_state \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43minfer_schema\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 1178\u001b[0m \u001b[43m \u001b[49m\u001b[43mschema\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1179\u001b[0m \u001b[43m \u001b[49m\u001b[43mvalue\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1180\u001b[0m \u001b[43m \u001b[49m\u001b[43mtop_state\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mtop_state\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1181\u001b[0m \u001b[43m \u001b[49m\u001b[43mpath\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43minner_path\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1183\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(state, \u001b[38;5;28mstr\u001b[39m):\n\u001b[1;32m 1184\u001b[0m \u001b[38;5;28;01mpass\u001b[39;00m\n", - "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:1135\u001b[0m, in \u001b[0;36mTypeSystem.infer_schema\u001b[0;34m(self, schema, state, top_state, path)\u001b[0m\n\u001b[1;32m 1128\u001b[0m state_type \u001b[38;5;241m=\u001b[39m {\n\u001b[1;32m 1129\u001b[0m key: value\n\u001b[1;32m 1130\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m key, value \u001b[38;5;129;01min\u001b[39;00m state\u001b[38;5;241m.\u001b[39mitems()\n\u001b[1;32m 1131\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m key\u001b[38;5;241m.\u001b[39mstartswith(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m_\u001b[39m\u001b[38;5;124m'\u001b[39m)}\n\u001b[1;32m 1132\u001b[0m state_schema \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39maccess(\n\u001b[1;32m 1133\u001b[0m state_type)\n\u001b[0;32m-> 1135\u001b[0m hydrated_state \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mdeserialize\u001b[49m\u001b[43m(\u001b[49m\u001b[43mstate_schema\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mstate\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1136\u001b[0m top_state \u001b[38;5;241m=\u001b[39m set_path(\n\u001b[1;32m 1137\u001b[0m top_state,\n\u001b[1;32m 1138\u001b[0m path,\n\u001b[1;32m 1139\u001b[0m hydrated_state)\n\u001b[1;32m 1141\u001b[0m update \u001b[38;5;241m=\u001b[39m state_type\n", - "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:614\u001b[0m, in \u001b[0;36mTypeSystem.deserialize\u001b[0;34m(self, schema, encoded)\u001b[0m\n\u001b[1;32m 612\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m key, branch \u001b[38;5;129;01min\u001b[39;00m encoded\u001b[38;5;241m.\u001b[39mitems():\n\u001b[1;32m 613\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m key \u001b[38;5;129;01min\u001b[39;00m schema:\n\u001b[0;32m--> 614\u001b[0m result[key] \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mdeserialize\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 615\u001b[0m \u001b[43m \u001b[49m\u001b[43mschema\u001b[49m\u001b[43m[\u001b[49m\u001b[43mkey\u001b[49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 616\u001b[0m \u001b[43m \u001b[49m\u001b[43mbranch\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 617\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m result\n\u001b[1;32m 619\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n", - "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:590\u001b[0m, in \u001b[0;36mTypeSystem.deserialize\u001b[0;34m(self, schema, encoded)\u001b[0m\n\u001b[1;32m 587\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mdeserialize\u001b[39m(\u001b[38;5;28mself\u001b[39m, schema, encoded):\n\u001b[1;32m 588\u001b[0m found \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39maccess(schema)\n\u001b[0;32m--> 590\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43m_deserialize\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m \u001b[49m\u001b[38;5;129;43;01min\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mfound\u001b[49m:\n\u001b[1;32m 591\u001b[0m deserialize \u001b[38;5;241m=\u001b[39m found[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m_deserialize\u001b[39m\u001b[38;5;124m'\u001b[39m]\n\u001b[1;32m 592\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(deserialize, \u001b[38;5;28mstr\u001b[39m):\n", - "\u001b[0;31mTypeError\u001b[0m: argument of type 'NoneType' is not iterable" + "name": "stdout", + "output_type": "stream", + "text": [ + "Writing out/nested_composite\n" ] + }, + { + "data": { + "image/svg+xml": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "bigraph\n", + "\n", + "\n", + "\n", + "('store1',)\n", + "\n", + "store1\n", + "\n", + "\n", + "\n", + "('store1', 'store1.1')\n", + "\n", + "store1.1\n", + "\n", + "\n", + "\n", + "('store1',)->('store1', 'store1.1')\n", + "\n", + "\n", + "\n", + "\n", + "('store1', 'store1.2')\n", + "\n", + "store1.2\n", + "\n", + "\n", + "\n", + "('store1',)->('store1', 'store1.2')\n", + "\n", + "\n", + "\n", + "\n", + "('store1', 'process1')\n", + "\n", + "process1\n", + "\n", + "\n", + "\n", + "('store1',)->('store1', 'process1')\n", + "\n", + "\n", + "\n", + "\n", + "('store1', 'process2')\n", + "\n", + "process2\n", + "\n", + "\n", + "\n", + "('store1',)->('store1', 'process2')\n", + "\n", + "\n", + "\n", + "\n", + "('process3',)\n", + "\n", + "process3\n", + "\n", + "\n", + "\n", + "('store1',)->('process3',)\n", + "\n", + "\n", + "port1\n", + "\n", + "\n", + "\n", + "('store1', 'store1.1')->('store1', 'process1')\n", + "\n", + "\n", + "port1\n", + "\n", + "\n", + "\n", + "('store1', 'store1.1')->('store1', 'process2')\n", + "\n", + "\n", + "port1\n", + "\n", + "\n", + "\n", + "('store1', 'store1.2')->('store1', 'process1')\n", + "\n", + "\n", + "port2\n", + "\n", + "\n", + "\n", + "('store1', 'store1.2')->('store1', 'process2')\n", + "\n", + "\n", + "port2\n", + "\n", + "\n", + "\n" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 21, + "metadata": {}, + "output_type": "execute_result" } ], "source": [ @@ -873,7 +978,7 @@ " }\n", " },\n", " 'process2': {\n", - " '_type': 'proces',\n", + " '_type': 'process',\n", " 'outputs': {\n", " 'port1': ['store1.1'],\n", " 'port2': ['store1.2'],\n", @@ -887,7 +992,9 @@ " }\n", " }\n", "}\n", - "plot_bigraph(nested_composite_spec, **plot_settings, filename='nested_composite')" + "plot_bigraph(nested_composite_spec, \n", + " # **plot_settings, \n", + " filename='nested_composite')" ] }, { @@ -901,10 +1008,32 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 23, "id": "638c5dc7-4cfd-46e4-b66a-8c42ca98ff1d", "metadata": {}, - "outputs": [], + "outputs": [ + { + "ename": "Exception", + "evalue": "schema not found for type: None", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mException\u001b[0m Traceback (most recent call last)", + "Cell \u001b[0;32mIn[23], line 29\u001b[0m\n\u001b[1;32m 1\u001b[0m composite_process_spec \u001b[38;5;241m=\u001b[39m {\n\u001b[1;32m 2\u001b[0m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mcomposite_process\u001b[39m\u001b[38;5;124m'\u001b[39m: {\n\u001b[1;32m 3\u001b[0m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mstore1.1\u001b[39m\u001b[38;5;124m'\u001b[39m: \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mAny\u001b[39m\u001b[38;5;124m'\u001b[39m,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 27\u001b[0m }\n\u001b[1;32m 28\u001b[0m }\n\u001b[0;32m---> 29\u001b[0m \u001b[43mplot_bigraph\u001b[49m\u001b[43m(\u001b[49m\u001b[43mcomposite_process_spec\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mplot_settings\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mfilename\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mcomposite_process\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m~/code/bigraph-viz/bigraph_viz/diagram.py:374\u001b[0m, in \u001b[0;36mplot_bigraph\u001b[0;34m(state, schema, core, out_dir, filename, file_format, size, node_label_size, show_values, show_types, port_labels, port_label_size, rankdir, print_source, dpi, label_margin, remove_nodes, invisible_edges, remove_process_place_edges)\u001b[0m\n\u001b[1;32m 371\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m core\u001b[38;5;241m.\u001b[39mexists(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mprocess\u001b[39m\u001b[38;5;124m'\u001b[39m):\n\u001b[1;32m 372\u001b[0m core\u001b[38;5;241m.\u001b[39mregister(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mprocess\u001b[39m\u001b[38;5;124m'\u001b[39m, process_type)\n\u001b[0;32m--> 374\u001b[0m schema, state \u001b[38;5;241m=\u001b[39m \u001b[43mcore\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcomplete\u001b[49m\u001b[43m(\u001b[49m\u001b[43mschema\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mstate\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 376\u001b[0m \u001b[38;5;66;03m# parse out the network\u001b[39;00m\n\u001b[1;32m 377\u001b[0m graph_dict \u001b[38;5;241m=\u001b[39m get_graph_dict(\n\u001b[1;32m 378\u001b[0m schema\u001b[38;5;241m=\u001b[39mschema,\n\u001b[1;32m 379\u001b[0m state\u001b[38;5;241m=\u001b[39mstate,\n\u001b[1;32m 380\u001b[0m core\u001b[38;5;241m=\u001b[39mcore,\n\u001b[1;32m 381\u001b[0m remove_nodes\u001b[38;5;241m=\u001b[39mremove_nodes,\n\u001b[1;32m 382\u001b[0m )\n", + "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:1251\u001b[0m, in \u001b[0;36mTypeSystem.complete\u001b[0;34m(self, initial_schema, initial_state)\u001b[0m\n\u001b[1;32m 1245\u001b[0m state \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mhydrate(\n\u001b[1;32m 1246\u001b[0m full_schema,\n\u001b[1;32m 1247\u001b[0m initial_state)\n\u001b[1;32m 1249\u001b[0m \u001b[38;5;66;03m# fill in the parts of the composition schema\u001b[39;00m\n\u001b[1;32m 1250\u001b[0m \u001b[38;5;66;03m# determined by the state\u001b[39;00m\n\u001b[0;32m-> 1251\u001b[0m schema, state \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43minfer_schema\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 1252\u001b[0m \u001b[43m \u001b[49m\u001b[43mfull_schema\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1253\u001b[0m \u001b[43m \u001b[49m\u001b[43mstate\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1255\u001b[0m final_state \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mfill(schema, state)\n\u001b[1;32m 1257\u001b[0m \u001b[38;5;66;03m# TODO: add flag to types.access(copy=True)\u001b[39;00m\n", + "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:1177\u001b[0m, in \u001b[0;36mTypeSystem.infer_schema\u001b[0;34m(self, schema, state, top_state, path)\u001b[0m\n\u001b[1;32m 1174\u001b[0m inner_path \u001b[38;5;241m=\u001b[39m path \u001b[38;5;241m+\u001b[39m (key,)\n\u001b[1;32m 1175\u001b[0m \u001b[38;5;66;03m# if get_path(schema, inner_path) is None or get_path(state, inner_path) is None:\u001b[39;00m\n\u001b[0;32m-> 1177\u001b[0m schema, top_state \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43minfer_schema\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 1178\u001b[0m \u001b[43m \u001b[49m\u001b[43mschema\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1179\u001b[0m \u001b[43m \u001b[49m\u001b[43mvalue\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1180\u001b[0m \u001b[43m \u001b[49m\u001b[43mtop_state\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mtop_state\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1181\u001b[0m \u001b[43m \u001b[49m\u001b[43mpath\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43minner_path\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1183\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(state, \u001b[38;5;28mstr\u001b[39m):\n\u001b[1;32m 1184\u001b[0m \u001b[38;5;28;01mpass\u001b[39;00m\n", + "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:1177\u001b[0m, in \u001b[0;36mTypeSystem.infer_schema\u001b[0;34m(self, schema, state, top_state, path)\u001b[0m\n\u001b[1;32m 1174\u001b[0m inner_path \u001b[38;5;241m=\u001b[39m path \u001b[38;5;241m+\u001b[39m (key,)\n\u001b[1;32m 1175\u001b[0m \u001b[38;5;66;03m# if get_path(schema, inner_path) is None or get_path(state, inner_path) is None:\u001b[39;00m\n\u001b[0;32m-> 1177\u001b[0m schema, top_state \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43minfer_schema\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 1178\u001b[0m \u001b[43m \u001b[49m\u001b[43mschema\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1179\u001b[0m \u001b[43m \u001b[49m\u001b[43mvalue\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1180\u001b[0m \u001b[43m \u001b[49m\u001b[43mtop_state\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mtop_state\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1181\u001b[0m \u001b[43m \u001b[49m\u001b[43mpath\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43minner_path\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1183\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(state, \u001b[38;5;28mstr\u001b[39m):\n\u001b[1;32m 1184\u001b[0m \u001b[38;5;28;01mpass\u001b[39;00m\n", + "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:1135\u001b[0m, in \u001b[0;36mTypeSystem.infer_schema\u001b[0;34m(self, schema, state, top_state, path)\u001b[0m\n\u001b[1;32m 1128\u001b[0m state_type \u001b[38;5;241m=\u001b[39m {\n\u001b[1;32m 1129\u001b[0m key: value\n\u001b[1;32m 1130\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m key, value \u001b[38;5;129;01min\u001b[39;00m state\u001b[38;5;241m.\u001b[39mitems()\n\u001b[1;32m 1131\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m key\u001b[38;5;241m.\u001b[39mstartswith(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m_\u001b[39m\u001b[38;5;124m'\u001b[39m)}\n\u001b[1;32m 1132\u001b[0m state_schema \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39maccess(\n\u001b[1;32m 1133\u001b[0m state_type)\n\u001b[0;32m-> 1135\u001b[0m hydrated_state \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mdeserialize\u001b[49m\u001b[43m(\u001b[49m\u001b[43mstate_schema\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mstate\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1136\u001b[0m top_state \u001b[38;5;241m=\u001b[39m set_path(\n\u001b[1;32m 1137\u001b[0m top_state,\n\u001b[1;32m 1138\u001b[0m path,\n\u001b[1;32m 1139\u001b[0m hydrated_state)\n\u001b[1;32m 1141\u001b[0m update \u001b[38;5;241m=\u001b[39m state_type\n", + "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:614\u001b[0m, in \u001b[0;36mTypeSystem.deserialize\u001b[0;34m(self, schema, encoded)\u001b[0m\n\u001b[1;32m 612\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m key, branch \u001b[38;5;129;01min\u001b[39;00m encoded\u001b[38;5;241m.\u001b[39mitems():\n\u001b[1;32m 613\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m key \u001b[38;5;129;01min\u001b[39;00m schema:\n\u001b[0;32m--> 614\u001b[0m result[key] \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mdeserialize\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 615\u001b[0m \u001b[43m \u001b[49m\u001b[43mschema\u001b[49m\u001b[43m[\u001b[49m\u001b[43mkey\u001b[49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 616\u001b[0m \u001b[43m \u001b[49m\u001b[43mbranch\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 617\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m result\n\u001b[1;32m 619\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n", + "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:620\u001b[0m, in \u001b[0;36mTypeSystem.deserialize\u001b[0;34m(self, schema, encoded)\u001b[0m\n\u001b[1;32m 617\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m result\n\u001b[1;32m 619\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m--> 620\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mdefault\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 621\u001b[0m \u001b[43m \u001b[49m\u001b[43mschema\u001b[49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:268\u001b[0m, in \u001b[0;36mTypeSystem.default\u001b[0;34m(self, schema)\u001b[0m\n\u001b[1;32m 266\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m key, subschema \u001b[38;5;129;01min\u001b[39;00m found\u001b[38;5;241m.\u001b[39mitems():\n\u001b[1;32m 267\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m key \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;129;01min\u001b[39;00m type_schema_keys:\n\u001b[0;32m--> 268\u001b[0m default[key] \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mdefault\u001b[49m\u001b[43m(\u001b[49m\u001b[43msubschema\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 270\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m default\n", + "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:257\u001b[0m, in \u001b[0;36mTypeSystem.default\u001b[0;34m(self, schema)\u001b[0m\n\u001b[1;32m 255\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mdefault\u001b[39m(\u001b[38;5;28mself\u001b[39m, schema):\n\u001b[1;32m 256\u001b[0m default \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[0;32m--> 257\u001b[0m found \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mretrieve\u001b[49m\u001b[43m(\u001b[49m\u001b[43mschema\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 259\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124m_default\u001b[39m\u001b[38;5;124m'\u001b[39m \u001b[38;5;129;01min\u001b[39;00m found:\n\u001b[1;32m 260\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124m_deserialize\u001b[39m\u001b[38;5;124m'\u001b[39m \u001b[38;5;129;01min\u001b[39;00m found:\n", + "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:117\u001b[0m, in \u001b[0;36mTypeSystem.retrieve\u001b[0;34m(self, schema)\u001b[0m\n\u001b[1;32m 115\u001b[0m found \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39maccess(schema)\n\u001b[1;32m 116\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m found \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[0;32m--> 117\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mException\u001b[39;00m(\u001b[38;5;124mf\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mschema not found for type: \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mschema\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m'\u001b[39m)\n\u001b[1;32m 118\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m found\n", + "\u001b[0;31mException\u001b[0m: schema not found for type: None" + ] + } + ], "source": [ "composite_process_spec = {\n", " 'composite_process': {\n", @@ -912,14 +1041,14 @@ " 'store1.2': 'Any',\n", " 'process1': {\n", " '_type': 'python_process:temporal',\n", - " 'wires': {\n", + " 'outputs': {\n", " 'port1': 'store1.1',\n", " 'port2': 'store1.2',\n", " }\n", " },\n", " 'process2': {\n", " '_type': 'python_process:temporal',\n", - " 'wires': {\n", + " 'outputs': {\n", " 'port1': 'store1.1',\n", " 'port2': 'store1.2',\n", " }\n", From 4a7f5b3167260e9abbd26771e53e6a28ed82e30c Mon Sep 17 00:00:00 2001 From: Eran Date: Wed, 14 Feb 2024 17:44:49 -0500 Subject: [PATCH 04/11] ignore instance key when plotting. make plot_bigraph the main method --- bigraph_viz/__init__.py | 7 +- notebooks/basics2.ipynb | 347 +++++++++++++++++++++++++++++++++------- 2 files changed, 291 insertions(+), 63 deletions(-) diff --git a/bigraph_viz/__init__.py b/bigraph_viz/__init__.py index 80d6991..bfda899 100644 --- a/bigraph_viz/__init__.py +++ b/bigraph_viz/__init__.py @@ -1,3 +1,4 @@ -from bigraph_viz.plot import plot_bigraph, plot_flow, plot_multitimestep -from bigraph_viz.dict_utils import pp, pf, schema_state_to_dict -from bigraph_viz.convert import convert_vivarium_composite +from bigraph_viz.diagram import plot_bigraph +# from bigraph_viz.plot import plot_bigraph, plot_flow, plot_multitimestep +# from bigraph_viz.dict_utils import pp, pf, schema_state_to_dict +# from bigraph_viz.convert import convert_vivarium_composite diff --git a/notebooks/basics2.ipynb b/notebooks/basics2.ipynb index 40cd577..77a229c 100644 --- a/notebooks/basics2.ipynb +++ b/notebooks/basics2.ipynb @@ -25,7 +25,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 1, "id": "63fb7d1a-cd49-4aac-8d4f-31bb54496a51", "metadata": { "tags": [] @@ -35,9 +35,9 @@ "name": "stdout", "output_type": "stream", "text": [ - "-e git+https://github.com/vivarium-collective/bigraph-schema.git@3b0bd4f5211e513577fd4c4f18468d1f3a908261#egg=bigraph_schema\n", - "-e git+https://github.com/vivarium-collective/bigraph-viz.git@eb759a2abd4f41cf806bfc81bb62f7abc333e3b1#egg=bigraph_viz\n", - "-e git+https://github.com/vivarium-collective/process-bigraph.git@6517fc88103bc3cfaad4d5a1fdbd9131015360d4#egg=process_bigraph\n" + "-e git+https://github.com/vivarium-collective/bigraph-schema.git@01a8525182a2de039a16223f086852ee602ac3a3#egg=bigraph_schema\n", + "-e git+https://github.com/vivarium-collective/bigraph-viz.git@7cf9829033800a4942a551275519893e41eb7d32#egg=bigraph_viz\n", + "-e git+https://github.com/vivarium-collective/process-bigraph.git@830e3ae01fe4e9c6d81ce9c29c47868b2c74a1d1#egg=process_bigraph\n" ] } ], @@ -57,7 +57,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 2, "id": "2ab3cb32-e007-45c4-807e-b1b442ac1608", "metadata": { "tags": [] @@ -97,7 +97,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 3, "id": "d711b952-089a-4938-817d-d1ccad9de56e", "metadata": { "tags": [] @@ -134,10 +134,10 @@ "\n" ], "text/plain": [ - "" + "" ] }, - "execution_count": 14, + "execution_count": 3, "metadata": {}, "output_type": "execute_result" } @@ -159,7 +159,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 4, "id": "f3e5fa71-7ffc-4a8f-a1a0-dc547c886f84", "metadata": {}, "outputs": [ @@ -195,10 +195,10 @@ "\n" ], "text/plain": [ - "" + "" ] }, - "execution_count": 15, + "execution_count": 4, "metadata": {}, "output_type": "execute_result" } @@ -224,7 +224,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 5, "id": "0f3f0824-f89d-4c6e-830e-2c5a321f7b33", "metadata": {}, "outputs": [ @@ -325,10 +325,10 @@ "\n" ], "text/plain": [ - "" + "" ] }, - "execution_count": 16, + "execution_count": 5, "metadata": {}, "output_type": "execute_result" } @@ -368,7 +368,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 6, "id": "7c74237b-0d66-4e8f-a8ca-79174fadad8b", "metadata": {}, "outputs": [ @@ -419,10 +419,10 @@ "\n" ], "text/plain": [ - "" + "" ] }, - "execution_count": 17, + "execution_count": 6, "metadata": {}, "output_type": "execute_result" } @@ -450,7 +450,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 7, "id": "8c2457a3-fc47-4850-8b9e-9ee98e81567d", "metadata": {}, "outputs": [ @@ -545,10 +545,10 @@ "\n" ], "text/plain": [ - "" + "" ] }, - "execution_count": 18, + "execution_count": 7, "metadata": {}, "output_type": "execute_result" } @@ -583,7 +583,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 8, "id": "a6ecad5d-8948-4636-910c-79284a3e8679", "metadata": {}, "outputs": [ @@ -657,10 +657,10 @@ "\n" ], "text/plain": [ - "" + "" ] }, - "execution_count": 19, + "execution_count": 8, "metadata": {}, "output_type": "execute_result" } @@ -715,7 +715,7 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 9, "id": "781a84e6-bbe2-4708-b441-47efc611b46f", "metadata": {}, "outputs": [ @@ -796,10 +796,10 @@ "\n" ], "text/plain": [ - "" + "" ] }, - "execution_count": 20, + "execution_count": 9, "metadata": {}, "output_type": "execute_result" } @@ -837,7 +837,7 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 10, "id": "701e759d-7f9b-41bb-911c-a8208c892462", "metadata": {}, "outputs": [ @@ -957,10 +957,10 @@ "\n" ], "text/plain": [ - "" + "" ] }, - "execution_count": 21, + "execution_count": 10, "metadata": {}, "output_type": "execute_result" } @@ -1008,59 +1008,274 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": 11, "id": "638c5dc7-4cfd-46e4-b66a-8c42ca98ff1d", "metadata": {}, "outputs": [ { - "ename": "Exception", - "evalue": "schema not found for type: None", - "output_type": "error", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mException\u001b[0m Traceback (most recent call last)", - "Cell \u001b[0;32mIn[23], line 29\u001b[0m\n\u001b[1;32m 1\u001b[0m composite_process_spec \u001b[38;5;241m=\u001b[39m {\n\u001b[1;32m 2\u001b[0m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mcomposite_process\u001b[39m\u001b[38;5;124m'\u001b[39m: {\n\u001b[1;32m 3\u001b[0m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mstore1.1\u001b[39m\u001b[38;5;124m'\u001b[39m: \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mAny\u001b[39m\u001b[38;5;124m'\u001b[39m,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 27\u001b[0m }\n\u001b[1;32m 28\u001b[0m }\n\u001b[0;32m---> 29\u001b[0m \u001b[43mplot_bigraph\u001b[49m\u001b[43m(\u001b[49m\u001b[43mcomposite_process_spec\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mplot_settings\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mfilename\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mcomposite_process\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m)\u001b[49m\n", - "File \u001b[0;32m~/code/bigraph-viz/bigraph_viz/diagram.py:374\u001b[0m, in \u001b[0;36mplot_bigraph\u001b[0;34m(state, schema, core, out_dir, filename, file_format, size, node_label_size, show_values, show_types, port_labels, port_label_size, rankdir, print_source, dpi, label_margin, remove_nodes, invisible_edges, remove_process_place_edges)\u001b[0m\n\u001b[1;32m 371\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m core\u001b[38;5;241m.\u001b[39mexists(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mprocess\u001b[39m\u001b[38;5;124m'\u001b[39m):\n\u001b[1;32m 372\u001b[0m core\u001b[38;5;241m.\u001b[39mregister(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mprocess\u001b[39m\u001b[38;5;124m'\u001b[39m, process_type)\n\u001b[0;32m--> 374\u001b[0m schema, state \u001b[38;5;241m=\u001b[39m \u001b[43mcore\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcomplete\u001b[49m\u001b[43m(\u001b[49m\u001b[43mschema\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mstate\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 376\u001b[0m \u001b[38;5;66;03m# parse out the network\u001b[39;00m\n\u001b[1;32m 377\u001b[0m graph_dict \u001b[38;5;241m=\u001b[39m get_graph_dict(\n\u001b[1;32m 378\u001b[0m schema\u001b[38;5;241m=\u001b[39mschema,\n\u001b[1;32m 379\u001b[0m state\u001b[38;5;241m=\u001b[39mstate,\n\u001b[1;32m 380\u001b[0m core\u001b[38;5;241m=\u001b[39mcore,\n\u001b[1;32m 381\u001b[0m remove_nodes\u001b[38;5;241m=\u001b[39mremove_nodes,\n\u001b[1;32m 382\u001b[0m )\n", - "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:1251\u001b[0m, in \u001b[0;36mTypeSystem.complete\u001b[0;34m(self, initial_schema, initial_state)\u001b[0m\n\u001b[1;32m 1245\u001b[0m state \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mhydrate(\n\u001b[1;32m 1246\u001b[0m full_schema,\n\u001b[1;32m 1247\u001b[0m initial_state)\n\u001b[1;32m 1249\u001b[0m \u001b[38;5;66;03m# fill in the parts of the composition schema\u001b[39;00m\n\u001b[1;32m 1250\u001b[0m \u001b[38;5;66;03m# determined by the state\u001b[39;00m\n\u001b[0;32m-> 1251\u001b[0m schema, state \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43minfer_schema\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 1252\u001b[0m \u001b[43m \u001b[49m\u001b[43mfull_schema\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1253\u001b[0m \u001b[43m \u001b[49m\u001b[43mstate\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1255\u001b[0m final_state \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mfill(schema, state)\n\u001b[1;32m 1257\u001b[0m \u001b[38;5;66;03m# TODO: add flag to types.access(copy=True)\u001b[39;00m\n", - "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:1177\u001b[0m, in \u001b[0;36mTypeSystem.infer_schema\u001b[0;34m(self, schema, state, top_state, path)\u001b[0m\n\u001b[1;32m 1174\u001b[0m inner_path \u001b[38;5;241m=\u001b[39m path \u001b[38;5;241m+\u001b[39m (key,)\n\u001b[1;32m 1175\u001b[0m \u001b[38;5;66;03m# if get_path(schema, inner_path) is None or get_path(state, inner_path) is None:\u001b[39;00m\n\u001b[0;32m-> 1177\u001b[0m schema, top_state \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43minfer_schema\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 1178\u001b[0m \u001b[43m \u001b[49m\u001b[43mschema\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1179\u001b[0m \u001b[43m \u001b[49m\u001b[43mvalue\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1180\u001b[0m \u001b[43m \u001b[49m\u001b[43mtop_state\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mtop_state\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1181\u001b[0m \u001b[43m \u001b[49m\u001b[43mpath\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43minner_path\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1183\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(state, \u001b[38;5;28mstr\u001b[39m):\n\u001b[1;32m 1184\u001b[0m \u001b[38;5;28;01mpass\u001b[39;00m\n", - "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:1177\u001b[0m, in \u001b[0;36mTypeSystem.infer_schema\u001b[0;34m(self, schema, state, top_state, path)\u001b[0m\n\u001b[1;32m 1174\u001b[0m inner_path \u001b[38;5;241m=\u001b[39m path \u001b[38;5;241m+\u001b[39m (key,)\n\u001b[1;32m 1175\u001b[0m \u001b[38;5;66;03m# if get_path(schema, inner_path) is None or get_path(state, inner_path) is None:\u001b[39;00m\n\u001b[0;32m-> 1177\u001b[0m schema, top_state \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43minfer_schema\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 1178\u001b[0m \u001b[43m \u001b[49m\u001b[43mschema\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1179\u001b[0m \u001b[43m \u001b[49m\u001b[43mvalue\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1180\u001b[0m \u001b[43m \u001b[49m\u001b[43mtop_state\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mtop_state\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1181\u001b[0m \u001b[43m \u001b[49m\u001b[43mpath\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43minner_path\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1183\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(state, \u001b[38;5;28mstr\u001b[39m):\n\u001b[1;32m 1184\u001b[0m \u001b[38;5;28;01mpass\u001b[39;00m\n", - "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:1135\u001b[0m, in \u001b[0;36mTypeSystem.infer_schema\u001b[0;34m(self, schema, state, top_state, path)\u001b[0m\n\u001b[1;32m 1128\u001b[0m state_type \u001b[38;5;241m=\u001b[39m {\n\u001b[1;32m 1129\u001b[0m key: value\n\u001b[1;32m 1130\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m key, value \u001b[38;5;129;01min\u001b[39;00m state\u001b[38;5;241m.\u001b[39mitems()\n\u001b[1;32m 1131\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m key\u001b[38;5;241m.\u001b[39mstartswith(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m_\u001b[39m\u001b[38;5;124m'\u001b[39m)}\n\u001b[1;32m 1132\u001b[0m state_schema \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39maccess(\n\u001b[1;32m 1133\u001b[0m state_type)\n\u001b[0;32m-> 1135\u001b[0m hydrated_state \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mdeserialize\u001b[49m\u001b[43m(\u001b[49m\u001b[43mstate_schema\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mstate\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1136\u001b[0m top_state \u001b[38;5;241m=\u001b[39m set_path(\n\u001b[1;32m 1137\u001b[0m top_state,\n\u001b[1;32m 1138\u001b[0m path,\n\u001b[1;32m 1139\u001b[0m hydrated_state)\n\u001b[1;32m 1141\u001b[0m update \u001b[38;5;241m=\u001b[39m state_type\n", - "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:614\u001b[0m, in \u001b[0;36mTypeSystem.deserialize\u001b[0;34m(self, schema, encoded)\u001b[0m\n\u001b[1;32m 612\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m key, branch \u001b[38;5;129;01min\u001b[39;00m encoded\u001b[38;5;241m.\u001b[39mitems():\n\u001b[1;32m 613\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m key \u001b[38;5;129;01min\u001b[39;00m schema:\n\u001b[0;32m--> 614\u001b[0m result[key] \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mdeserialize\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 615\u001b[0m \u001b[43m \u001b[49m\u001b[43mschema\u001b[49m\u001b[43m[\u001b[49m\u001b[43mkey\u001b[49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 616\u001b[0m \u001b[43m \u001b[49m\u001b[43mbranch\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 617\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m result\n\u001b[1;32m 619\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n", - "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:620\u001b[0m, in \u001b[0;36mTypeSystem.deserialize\u001b[0;34m(self, schema, encoded)\u001b[0m\n\u001b[1;32m 617\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m result\n\u001b[1;32m 619\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m--> 620\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mdefault\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 621\u001b[0m \u001b[43m \u001b[49m\u001b[43mschema\u001b[49m\u001b[43m)\u001b[49m\n", - "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:268\u001b[0m, in \u001b[0;36mTypeSystem.default\u001b[0;34m(self, schema)\u001b[0m\n\u001b[1;32m 266\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m key, subschema \u001b[38;5;129;01min\u001b[39;00m found\u001b[38;5;241m.\u001b[39mitems():\n\u001b[1;32m 267\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m key \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;129;01min\u001b[39;00m type_schema_keys:\n\u001b[0;32m--> 268\u001b[0m default[key] \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mdefault\u001b[49m\u001b[43m(\u001b[49m\u001b[43msubschema\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 270\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m default\n", - "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:257\u001b[0m, in \u001b[0;36mTypeSystem.default\u001b[0;34m(self, schema)\u001b[0m\n\u001b[1;32m 255\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mdefault\u001b[39m(\u001b[38;5;28mself\u001b[39m, schema):\n\u001b[1;32m 256\u001b[0m default \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[0;32m--> 257\u001b[0m found \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mretrieve\u001b[49m\u001b[43m(\u001b[49m\u001b[43mschema\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 259\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124m_default\u001b[39m\u001b[38;5;124m'\u001b[39m \u001b[38;5;129;01min\u001b[39;00m found:\n\u001b[1;32m 260\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124m_deserialize\u001b[39m\u001b[38;5;124m'\u001b[39m \u001b[38;5;129;01min\u001b[39;00m found:\n", - "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:117\u001b[0m, in \u001b[0;36mTypeSystem.retrieve\u001b[0;34m(self, schema)\u001b[0m\n\u001b[1;32m 115\u001b[0m found \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39maccess(schema)\n\u001b[1;32m 116\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m found \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[0;32m--> 117\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mException\u001b[39;00m(\u001b[38;5;124mf\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mschema not found for type: \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mschema\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m'\u001b[39m)\n\u001b[1;32m 118\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m found\n", - "\u001b[0;31mException\u001b[0m: schema not found for type: None" + "name": "stdout", + "output_type": "stream", + "text": [ + "Writing out/composite_process\n" ] + }, + { + "data": { + "image/svg+xml": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "bigraph\n", + "\n", + "\n", + "\n", + "('composite_process',)\n", + "\n", + "composite_process\n", + "\n", + "\n", + "\n", + "('composite_process', 'store1.1')\n", + "\n", + "store1.1\n", + "\n", + "\n", + "\n", + "('composite_process',)->('composite_process', 'store1.1')\n", + "\n", + "\n", + "\n", + "\n", + "('composite_process', 'store1.2')\n", + "\n", + "store1.2\n", + "\n", + "\n", + "\n", + "('composite_process',)->('composite_process', 'store1.2')\n", + "\n", + "\n", + "\n", + "\n", + "('composite_process', 'process1')\n", + "\n", + "process1\n", + "\n", + "\n", + "\n", + "('composite_process',)->('composite_process', 'process1')\n", + "\n", + "\n", + "\n", + "\n", + "('composite_process', 'process2')\n", + "\n", + "process2\n", + "\n", + "\n", + "\n", + "('composite_process',)->('composite_process', 'process2')\n", + "\n", + "\n", + "\n", + "\n", + "('composite_process', 'process1', 'outputs')\n", + "\n", + "outputs\n", + "\n", + "\n", + "\n", + "('composite_process', 'process1')->('composite_process', 'process1', 'outputs')\n", + "\n", + "\n", + "\n", + "\n", + "('composite_process', 'process1', 'inputs')\n", + "\n", + "inputs\n", + "\n", + "\n", + "\n", + "('composite_process', 'process1')->('composite_process', 'process1', 'inputs')\n", + "\n", + "\n", + "\n", + "\n", + "('composite_process', 'process1', 'address')\n", + "\n", + "address\n", + "\n", + "\n", + "\n", + "('composite_process', 'process1')->('composite_process', 'process1', 'address')\n", + "\n", + "\n", + "\n", + "\n", + "('composite_process', 'process1', 'config')\n", + "\n", + "config\n", + "\n", + "\n", + "\n", + "('composite_process', 'process1')->('composite_process', 'process1', 'config')\n", + "\n", + "\n", + "\n", + "\n", + "('composite_process', 'process1', 'interval')\n", + "\n", + "interval\n", + "\n", + "\n", + "\n", + "('composite_process', 'process1')->('composite_process', 'process1', 'interval')\n", + "\n", + "\n", + "\n", + "\n", + "('composite_process', 'process1', 'outputs', 'port1')\n", + "\n", + "port1\n", + "\n", + "\n", + "\n", + "('composite_process', 'process1', 'outputs')->('composite_process', 'process1', 'outputs', 'port1')\n", + "\n", + "\n", + "\n", + "\n", + "('composite_process', 'process1', 'outputs', 'port2')\n", + "\n", + "port2\n", + "\n", + "\n", + "\n", + "('composite_process', 'process1', 'outputs')->('composite_process', 'process1', 'outputs', 'port2')\n", + "\n", + "\n", + "\n", + "\n", + "('composite_process', 'process2', 'outputs')\n", + "\n", + "outputs\n", + "\n", + "\n", + "\n", + "('composite_process', 'process2')->('composite_process', 'process2', 'outputs')\n", + "\n", + "\n", + "\n", + "\n", + "('composite_process', 'process2', 'inputs')\n", + "\n", + "inputs\n", + "\n", + "\n", + "\n", + "('composite_process', 'process2')->('composite_process', 'process2', 'inputs')\n", + "\n", + "\n", + "\n", + "\n", + "('composite_process', 'process2', 'address')\n", + "\n", + "address\n", + "\n", + "\n", + "\n", + "('composite_process', 'process2')->('composite_process', 'process2', 'address')\n", + "\n", + "\n", + "\n", + "\n", + "('composite_process', 'process2', 'config')\n", + "\n", + "config\n", + "\n", + "\n", + "\n", + "('composite_process', 'process2')->('composite_process', 'process2', 'config')\n", + "\n", + "\n", + "\n", + "\n", + "('composite_process', 'process2', 'interval')\n", + "\n", + "interval\n", + "\n", + "\n", + "\n", + "('composite_process', 'process2')->('composite_process', 'process2', 'interval')\n", + "\n", + "\n", + "\n", + "\n", + "('composite_process', 'process2', 'outputs', 'port1')\n", + "\n", + "port1\n", + "\n", + "\n", + "\n", + "('composite_process', 'process2', 'outputs')->('composite_process', 'process2', 'outputs', 'port1')\n", + "\n", + "\n", + "\n", + "\n", + "('composite_process', 'process2', 'outputs', 'port2')\n", + "\n", + "port2\n", + "\n", + "\n", + "\n", + "('composite_process', 'process2', 'outputs')->('composite_process', 'process2', 'outputs', 'port2')\n", + "\n", + "\n", + "\n", + "\n" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" } ], "source": [ "composite_process_spec = {\n", " 'composite_process': {\n", - " 'store1.1': 'Any',\n", - " 'store1.2': 'Any',\n", + " 'store1.1': 'any',\n", + " 'store1.2': 'any',\n", " 'process1': {\n", - " '_type': 'python_process:temporal',\n", + " '_type': 'process',\n", " 'outputs': {\n", " 'port1': 'store1.1',\n", " 'port2': 'store1.2',\n", " }\n", " },\n", " 'process2': {\n", - " '_type': 'python_process:temporal',\n", + " '_type': 'process',\n", " 'outputs': {\n", " 'port1': 'store1.1',\n", " 'port2': 'store1.2',\n", " }\n", " },\n", - " '_ports': {\n", + " '_inputs': {\n", " 'port1': 'Any', \n", " 'port2': 'Any', \n", " },\n", - " '_tunnels': {\n", - " 'port1': 'store1.1',\n", - " 'port2': 'store1.2',\n", - " }\n", + " # '_tunnels': {\n", + " # 'port1': 'store1.1',\n", + " # 'port2': 'store1.2',\n", + " # }\n", " }\n", "}\n", "plot_bigraph(composite_process_spec, **plot_settings, filename='composite_process')" @@ -1076,7 +1291,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 12, "id": "e76c97a8-3037-464a-929e-ba4414c73c34", "metadata": {}, "outputs": [], @@ -1101,10 +1316,22 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 13, "id": "f0eff7b0-f0e2-4d56-8b16-ef0fc1ce5aba", "metadata": {}, - "outputs": [], + "outputs": [ + { + "ename": "NameError", + "evalue": "name 'plot_multitimestep' is not defined", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)", + "Cell \u001b[0;32mIn[13], line 14\u001b[0m\n\u001b[1;32m 1\u001b[0m multitimestep_spec \u001b[38;5;241m=\u001b[39m {\n\u001b[1;32m 2\u001b[0m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mtemporal process2\u001b[39m\u001b[38;5;124m'\u001b[39m: {\n\u001b[1;32m 3\u001b[0m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124m_ports\u001b[39m\u001b[38;5;124m'\u001b[39m: {\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mport1\u001b[39m\u001b[38;5;124m'\u001b[39m: \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mAny\u001b[39m\u001b[38;5;124m'\u001b[39m},\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 11\u001b[0m },\n\u001b[1;32m 12\u001b[0m }\n\u001b[1;32m 13\u001b[0m multitimestep_spec \u001b[38;5;241m=\u001b[39m replace_regex_recursive(multitimestep_spec)\n\u001b[0;32m---> 14\u001b[0m \u001b[43mplot_multitimestep\u001b[49m(multitimestep_spec, total_time\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m2.0\u001b[39m, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mplot_settings2, filename\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mmultitimestep\u001b[39m\u001b[38;5;124m'\u001b[39m)\n", + "\u001b[0;31mNameError\u001b[0m: name 'plot_multitimestep' is not defined" + ] + } + ], "source": [ "multitimestep_spec = {\n", " 'temporal process2': {\n", From c264e1854c88a26c4092eb0097eec472a5aa629f Mon Sep 17 00:00:00 2001 From: Eran Date: Thu, 15 Feb 2024 08:53:12 -0500 Subject: [PATCH 05/11] remove keys --- bigraph_viz/diagram.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bigraph_viz/diagram.py b/bigraph_viz/diagram.py index 23b6435..d66edd6 100644 --- a/bigraph_viz/diagram.py +++ b/bigraph_viz/diagram.py @@ -7,8 +7,9 @@ import graphviz -PROCESS_SCHEMA_KEYS = ['config', 'address', 'interval', 'inputs', 'outputs'] +PROCESS_SCHEMA_KEYS = ['config', 'address', 'interval', 'inputs', 'outputs', 'instance'] +REMOVE_KEYS = ['global_time'] step_type = { '_type': 'step', @@ -155,6 +156,8 @@ def get_graph_dict( output_schema, output_wires, graph_dict, schema_key='outputs', edge_path=subpath, port=()) else: # this is a state node + if key in REMOVE_KEYS: + continue if not isinstance(value, dict): # this is a leaf node node_spec['value'] = value node_spec['type'] = schema.get(key, {}).get('_type') From 84569678815db0194e2ce453dcd6443c798266ea Mon Sep 17 00:00:00 2001 From: Eran Date: Thu, 15 Feb 2024 09:35:41 -0500 Subject: [PATCH 06/11] work on formatting --- bigraph_viz/__init__.py | 1 + bigraph_viz/diagram.py | 36 +- notebooks/basics2.ipynb | 1969 +++++++++++++++++++++++++++++++++++++-- 3 files changed, 1925 insertions(+), 81 deletions(-) diff --git a/bigraph_viz/__init__.py b/bigraph_viz/__init__.py index bfda899..bcbb4ff 100644 --- a/bigraph_viz/__init__.py +++ b/bigraph_viz/__init__.py @@ -1,4 +1,5 @@ from bigraph_viz.diagram import plot_bigraph +from bigraph_schema import TypeSystem # from bigraph_viz.plot import plot_bigraph, plot_flow, plot_multitimestep # from bigraph_viz.dict_utils import pp, pf, schema_state_to_dict # from bigraph_viz.convert import convert_vivarium_composite diff --git a/bigraph_viz/diagram.py b/bigraph_viz/diagram.py index d66edd6..8ef1b8f 100644 --- a/bigraph_viz/diagram.py +++ b/bigraph_viz/diagram.py @@ -209,9 +209,12 @@ def get_graphviz_fig( port_label_size='10pt', invisible_edges=False, remove_process_place_edges=False, + node_border_colors=None, + node_fill_colors=None, + node_groups=False, ): """make a graphviz figure from a graph_dict""" - + node_groups = node_groups or [] node_names = [] invisible_edges = invisible_edges or [] @@ -323,6 +326,31 @@ def get_graphviz_fig( graph.attr('edge', **output_edge_spec) plot_edges(graph, edge, port_labels, port_label_size, state_node_spec) + # grouped nodes + for group in node_groups: + group_name = str(group) + with graph.subgraph(name=group_name) as c: + c.attr(rank='same') + previous_node = None + for path in group: + node_name = str(path) + if node_name in node_names: + c.node(node_name) + if previous_node: + # out them in the order declared in the group + c.edge(previous_node, node_name, style='invis', ordering='out') + previous_node = node_name + else: + print(f'node {node_name} not in graph') + + # formatting + if node_border_colors: + for node_name, color in node_border_colors.items(): + graph.node(str(node_name), color=color) + if node_fill_colors: + for node_name, color in node_fill_colors.items(): + graph.node(str(node_name), color=color, style='filled') + return graph @@ -345,9 +373,9 @@ def plot_bigraph( label_margin='0.05', # show_process_schema=False, # collapse_processes=False, - # node_border_colors=None, - # node_fill_colors=None, - # node_groups=False, + node_border_colors=None, + node_fill_colors=None, + node_groups=False, remove_nodes=None, invisible_edges=False, # mark_top=False, diff --git a/notebooks/basics2.ipynb b/notebooks/basics2.ipynb index 77a229c..588677a 100644 --- a/notebooks/basics2.ipynb +++ b/notebooks/basics2.ipynb @@ -36,7 +36,7 @@ "output_type": "stream", "text": [ "-e git+https://github.com/vivarium-collective/bigraph-schema.git@01a8525182a2de039a16223f086852ee602ac3a3#egg=bigraph_schema\n", - "-e git+https://github.com/vivarium-collective/bigraph-viz.git@7cf9829033800a4942a551275519893e41eb7d32#egg=bigraph_viz\n", + "-e git+https://github.com/vivarium-collective/bigraph-viz.git@c264e1854c88a26c4092eb0097eec472a5aa629f#egg=bigraph_viz\n", "-e git+https://github.com/vivarium-collective/process-bigraph.git@830e3ae01fe4e9c6d81ce9c29c47868b2c74a1d1#egg=process_bigraph\n" ] } @@ -66,7 +66,7 @@ "source": [ "# from bigraph_viz import plot_bigraph, plot_flow, plot_multitimestep, pf\n", "from bigraph_viz.dict_utils import replace_regex_recursive\n", - "from bigraph_viz.diagram import plot_bigraph\n", + "from bigraph_viz import plot_bigraph, TypeSystem\n", "\n", "plot_settings = {\n", " 'remove_process_place_edges': True\n", @@ -134,7 +134,7 @@ "\n" ], "text/plain": [ - "" + "" ] }, "execution_count": 3, @@ -195,7 +195,7 @@ "\n" ], "text/plain": [ - "" + "" ] }, "execution_count": 4, @@ -325,7 +325,7 @@ "\n" ], "text/plain": [ - "" + "" ] }, "execution_count": 5, @@ -419,7 +419,7 @@ "\n" ], "text/plain": [ - "" + "" ] }, "execution_count": 6, @@ -545,7 +545,7 @@ "\n" ], "text/plain": [ - "" + "" ] }, "execution_count": 7, @@ -657,7 +657,7 @@ "\n" ], "text/plain": [ - "" + "" ] }, "execution_count": 8, @@ -796,7 +796,7 @@ "\n" ], "text/plain": [ - "" + "" ] }, "execution_count": 9, @@ -957,7 +957,7 @@ "\n" ], "text/plain": [ - "" + "" ] }, "execution_count": 10, @@ -1241,7 +1241,7 @@ "\n" ], "text/plain": [ - "" + "" ] }, "execution_count": 11, @@ -1319,34 +1319,22 @@ "execution_count": 13, "id": "f0eff7b0-f0e2-4d56-8b16-ef0fc1ce5aba", "metadata": {}, - "outputs": [ - { - "ename": "NameError", - "evalue": "name 'plot_multitimestep' is not defined", - "output_type": "error", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)", - "Cell \u001b[0;32mIn[13], line 14\u001b[0m\n\u001b[1;32m 1\u001b[0m multitimestep_spec \u001b[38;5;241m=\u001b[39m {\n\u001b[1;32m 2\u001b[0m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mtemporal process2\u001b[39m\u001b[38;5;124m'\u001b[39m: {\n\u001b[1;32m 3\u001b[0m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124m_ports\u001b[39m\u001b[38;5;124m'\u001b[39m: {\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mport1\u001b[39m\u001b[38;5;124m'\u001b[39m: \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mAny\u001b[39m\u001b[38;5;124m'\u001b[39m},\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 11\u001b[0m },\n\u001b[1;32m 12\u001b[0m }\n\u001b[1;32m 13\u001b[0m multitimestep_spec \u001b[38;5;241m=\u001b[39m replace_regex_recursive(multitimestep_spec)\n\u001b[0;32m---> 14\u001b[0m \u001b[43mplot_multitimestep\u001b[49m(multitimestep_spec, total_time\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m2.0\u001b[39m, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mplot_settings2, filename\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mmultitimestep\u001b[39m\u001b[38;5;124m'\u001b[39m)\n", - "\u001b[0;31mNameError\u001b[0m: name 'plot_multitimestep' is not defined" - ] - } - ], + "outputs": [], "source": [ - "multitimestep_spec = {\n", - " 'temporal process2': {\n", - " '_ports': {'port1': 'Any'},\n", - " 'wires': {'port1': 'state'},\n", - " '_sync_step': 1.0,\n", - " },\n", - " 'temporal process1': {\n", - " '_ports': {'port1': 'Any'},\n", - " 'wires': {'port1': 'state'},\n", - " '_sync_step': 0.5,\n", - " },\n", - "}\n", - "multitimestep_spec = replace_regex_recursive(multitimestep_spec)\n", - "plot_multitimestep(multitimestep_spec, total_time=2.0, **plot_settings2, filename='multitimestep')" + "# multitimestep_spec = {\n", + "# 'temporal process2': {\n", + "# '_ports': {'port1': 'Any'},\n", + "# 'wires': {'port1': 'state'},\n", + "# '_sync_step': 1.0,\n", + "# },\n", + "# 'temporal process1': {\n", + "# '_ports': {'port1': 'Any'},\n", + "# 'wires': {'port1': 'state'},\n", + "# '_sync_step': 0.5,\n", + "# },\n", + "# }\n", + "# multitimestep_spec = replace_regex_recursive(multitimestep_spec)\n", + "# plot_multitimestep(multitimestep_spec, total_time=2.0, **plot_settings2, filename='multitimestep')" ] }, { @@ -1361,35 +1349,35 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 14, "id": "db45c99b-b97b-47bc-a73e-c669882f3969", "metadata": {}, "outputs": [], "source": [ - "flow = {\n", - " 'step1': {\n", - " '_type': 'step_process',\n", - " '_ports': {},\n", - " '_depends_on': [], \n", - " },\n", - " 'step2': {\n", - " '_type': 'step_process',\n", - " '_ports': {},\n", - " '_depends_on': 'step1', \n", - " },\n", - " 'step3': {\n", - " '_type': 'step_process',\n", - " '_ports': {},\n", - " '_depends_on': [], \n", - " },\n", - " 'step4': {\n", - " '_type': 'step_process',\n", - " '_ports': {},\n", - " '_depends_on': ['step2', 'step3'], \n", - " },\n", - "}\n", + "# flow = {\n", + "# 'step1': {\n", + "# '_type': 'step_process',\n", + "# '_ports': {},\n", + "# '_depends_on': [], \n", + "# },\n", + "# 'step2': {\n", + "# '_type': 'step_process',\n", + "# '_ports': {},\n", + "# '_depends_on': 'step1', \n", + "# },\n", + "# 'step3': {\n", + "# '_type': 'step_process',\n", + "# '_ports': {},\n", + "# '_depends_on': [], \n", + "# },\n", + "# 'step4': {\n", + "# '_type': 'step_process',\n", + "# '_ports': {},\n", + "# '_depends_on': ['step2', 'step3'], \n", + "# },\n", + "# }\n", "\n", - "plot_flow(flow, **plot_settings2, filename='flow')" + "# plot_flow(flow, **plot_settings2, filename='flow')" ] }, { @@ -1414,12 +1402,611 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 15, "id": "47bdf8e5-0bdd-4cac-b57e-2449c75fa178", "metadata": { "tags": [] }, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Writing out/cell_hierarchy\n" + ] + }, + { + "data": { + "image/svg+xml": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "bigraph\n", + "\n", + "\n", + "\n", + "('cell',)\n", + "\n", + "cell\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm')\n", + "\n", + "cytoplasm\n", + "\n", + "\n", + "\n", + "('cell',)->('cell', 'cytoplasm')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus')\n", + "\n", + "nucleus\n", + "\n", + "\n", + "\n", + "('cell',)->('cell', 'nucleus')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'secretory<br/>organelles')\n", + "\n", + "secretory\n", + "organelles\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm')->('cell', 'cytoplasm', 'secretory<br/>organelles')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles')\n", + "\n", + "cytoplasmic\n", + "organelles\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'transcriptional<br/>regulation<br/>complex<br/>family')\n", + "\n", + "transcriptional\n", + "regulation\n", + "complex\n", + "family\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm')->('cell', 'cytoplasm', 'transcriptional<br/>regulation<br/>complex<br/>family')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'secretory<br/>organelles', 'transmembrane<br/>transport<br/>systems')\n", + "\n", + "transmembrane\n", + "transport\n", + "systems\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'secretory<br/>organelles')->('cell', 'cytoplasm', 'secretory<br/>organelles', 'transmembrane<br/>transport<br/>systems')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'secretory<br/>organelles', 'transmembrane<br/>transport<br/>systems', 'ion<br/>transmembrane<br/>transport<br/>systems')\n", + "\n", + "ion\n", + "transmembrane\n", + "transport\n", + "systems\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'secretory<br/>organelles', 'transmembrane<br/>transport<br/>systems')->('cell', 'cytoplasm', 'secretory<br/>organelles', 'transmembrane<br/>transport<br/>systems', 'ion<br/>transmembrane<br/>transport<br/>systems')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles')\n", + "\n", + "subgroup\n", + "of\n", + "cytoplasmic\n", + "organelles\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'metabolic<br/>organelles')\n", + "\n", + "metabolic\n", + "organelles\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'metabolic<br/>organelles')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family')\n", + "\n", + "ribonucleoprotein\n", + "complex\n", + "family\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'metabolic<br/>organelles', 'subgroup<br/>of<br/>metabolic<br/>organelles')\n", + "\n", + "subgroup\n", + "of\n", + "metabolic\n", + "organelles\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'metabolic<br/>organelles')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'metabolic<br/>organelles', 'subgroup<br/>of<br/>metabolic<br/>organelles')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'metabolic<br/>organelles', 'mitochondrion')\n", + "\n", + "mitochondrion\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'metabolic<br/>organelles')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'metabolic<br/>organelles', 'mitochondrion')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'RNA<br/>processing<br/>complex<br/>1')\n", + "\n", + "RNA\n", + "processing\n", + "complex\n", + "1\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'RNA<br/>processing<br/>complex<br/>1')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community')\n", + "\n", + "ribosome\n", + "biogenesis\n", + "community\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'RNA<br/>processing<br/>complex<br/>1', 'RNA<br/>splicing<br/>complex<br/>1')\n", + "\n", + "RNA\n", + "splicing\n", + "complex\n", + "1\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'RNA<br/>processing<br/>complex<br/>1')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'RNA<br/>processing<br/>complex<br/>1', 'RNA<br/>splicing<br/>complex<br/>1')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome')\n", + "\n", + "ribosome\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'nucleic<br/>acid<br/>binding<br/>complex')\n", + "\n", + "nucleic\n", + "acid\n", + "binding\n", + "complex\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'nucleic<br/>acid<br/>binding<br/>complex')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit')\n", + "\n", + "ribosomal\n", + "subunit\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'mitochondirial<br/>large<br/>ribosomal<br/>subunit')\n", + "\n", + "mitochondirial\n", + "large\n", + "ribosomal\n", + "subunit\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'mitochondirial<br/>large<br/>ribosomal<br/>subunit')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'mito-cyto<br/>ribosomal<br/>cluster')\n", + "\n", + "mito-cyto\n", + "ribosomal\n", + "cluster\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'mito-cyto<br/>ribosomal<br/>cluster')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'cotranslational<br/>protein<br/>targeting<br/>to<br/>membrane<br/>system')\n", + "\n", + "cotranslational\n", + "protein\n", + "targeting\n", + "to\n", + "membrane\n", + "system\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'cotranslational<br/>protein<br/>targeting<br/>to<br/>membrane<br/>system')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'ribosomal<br/>complex<br/>5')\n", + "\n", + "ribosomal\n", + "complex\n", + "5\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'ribosomal<br/>complex<br/>5')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'ribosomal<br/>complex<br/>2')\n", + "\n", + "ribosomal\n", + "complex\n", + "2\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'ribosomal<br/>complex<br/>2')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'transcriptional<br/>regulation<br/>complex<br/>family', 'transcriptional<br/>regulation<br/>complexes')\n", + "\n", + "transcriptional\n", + "regulation\n", + "complexes\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'transcriptional<br/>regulation<br/>complex<br/>family')->('cell', 'cytoplasm', 'transcriptional<br/>regulation<br/>complex<br/>family', 'transcriptional<br/>regulation<br/>complexes')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'DNA<br/>metabolic<br/>assembly')\n", + "\n", + "DNA\n", + "metabolic\n", + "assembly\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus')->('cell', 'nucleus', 'DNA<br/>metabolic<br/>assembly')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'nuclear<br/>lumen')\n", + "\n", + "nuclear\n", + "lumen\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus')->('cell', 'nucleus', 'nuclear<br/>lumen')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'nuclear<br/>body')\n", + "\n", + "nuclear\n", + "body\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus')->('cell', 'nucleus', 'nuclear<br/>body')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'nucleo-plasm<br/>1')\n", + "\n", + "nucleo-plasm\n", + "1\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus')->('cell', 'nucleus', 'nucleo-plasm<br/>1')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'nucleo-plasm<br/>2')\n", + "\n", + "nucleo-plasm\n", + "2\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus')->('cell', 'nucleus', 'nucleo-plasm<br/>2')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'nuclear<br/>transcriptional<br/>speckle')\n", + "\n", + "nuclear\n", + "transcriptional\n", + "speckle\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus')->('cell', 'nucleus', 'nuclear<br/>transcriptional<br/>speckle')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus')\n", + "\n", + "nucleolus\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'nuclear<br/>lumen')->('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'nuclear<br/>lumen', 'nuclear<br/>splicing<br/>speckle')\n", + "\n", + "nuclear\n", + "splicing\n", + "speckle\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'nuclear<br/>lumen')->('cell', 'nucleus', 'nuclear<br/>lumen', 'nuclear<br/>splicing<br/>speckle')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'ribonucleprotein<br/>complex<br/>family')\n", + "\n", + "ribonucleprotein\n", + "complex\n", + "family\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus')->('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'ribonucleprotein<br/>complex<br/>family')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'RNA<br/>processing<br/>complex<br/>family')\n", + "\n", + "RNA\n", + "processing\n", + "complex\n", + "family\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus')->('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'RNA<br/>processing<br/>complex<br/>family')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'splicosomal<br/>complex<br/>family')\n", + "\n", + "splicosomal\n", + "complex\n", + "family\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus')->('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'splicosomal<br/>complex<br/>family')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'RNA<br/>processing<br/>complex<br/>family', 'RNA<br/>processing<br/>complex<br/>1')\n", + "\n", + "RNA\n", + "processing\n", + "complex\n", + "1\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'RNA<br/>processing<br/>complex<br/>family')->('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'RNA<br/>processing<br/>complex<br/>family', 'RNA<br/>processing<br/>complex<br/>1')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'RNA<br/>processing<br/>complex<br/>family', 'RNA<br/>splicing<br/>complex<br/>family')\n", + "\n", + "RNA\n", + "splicing\n", + "complex\n", + "family\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'RNA<br/>processing<br/>complex<br/>family')->('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'RNA<br/>processing<br/>complex<br/>family', 'RNA<br/>splicing<br/>complex<br/>family')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family')\n", + "\n", + "chromosome\n", + "organization\n", + "complex\n", + "family\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'nucleo-plasm<br/>1')->('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family', 'chromatin<br/>organization<br/>complex<br/>family')\n", + "\n", + "chromatin\n", + "organization\n", + "complex\n", + "family\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family')->('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family', 'chromatin<br/>organization<br/>complex<br/>family')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family', 'chromatin<br/>organization<br/>complex<br/>family', 'HAT<br/>complex<br/>family')\n", + "\n", + "HAT\n", + "complex\n", + "family\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family', 'chromatin<br/>organization<br/>complex<br/>family')->('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family', 'chromatin<br/>organization<br/>complex<br/>family', 'HAT<br/>complex<br/>family')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family', 'chromatin<br/>organization<br/>complex<br/>family', 'HAT<br/>complex<br/>family', 'NuA4<br/>HAT<br/>complex')\n", + "\n", + "NuA4\n", + "HAT\n", + "complex\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family', 'chromatin<br/>organization<br/>complex<br/>family', 'HAT<br/>complex<br/>family')->('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family', 'chromatin<br/>organization<br/>complex<br/>family', 'HAT<br/>complex<br/>family', 'NuA4<br/>HAT<br/>complex')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'nucleo-plasm<br/>2', 'chromatin<br/>regulation<br/>complex')\n", + "\n", + "chromatin\n", + "regulation\n", + "complex\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'nucleo-plasm<br/>2')->('cell', 'nucleus', 'nucleo-plasm<br/>2', 'chromatin<br/>regulation<br/>complex')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'nuclear<br/>transcriptional<br/>speckle', 'negative<br/>regulation<br/>of<br/>RNA<br/>biosynthesis<br/>process')\n", + "\n", + "negative\n", + "regulation\n", + "of\n", + "RNA\n", + "biosynthesis\n", + "process\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'nuclear<br/>transcriptional<br/>speckle')->('cell', 'nucleus', 'nuclear<br/>transcriptional<br/>speckle', 'negative<br/>regulation<br/>of<br/>RNA<br/>biosynthesis<br/>process')\n", + "\n", + "\n", + "\n", + "\n" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 15, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "music_map = {\n", " 'cell': {\n", @@ -1473,24 +2060,1005 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 16, "id": "ab431982-d156-4b7a-9918-384a5ea5132a", "metadata": { "tags": [] }, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "{'cell': {'cytoplasm': {'secretory organelles': {'transmembrane transport systems': {'ion transmembrane transport systems': {}}},\n", + " 'cytoplasmic organelles': {'subgroup of cytoplasmic organelles': {'metabolic organelles': {'subgroup of metabolic organelles': {},\n", + " 'mitochondrion': {}},\n", + " 'ribonucleoprotein complex family': {'RNA processing complex 1': {'RNA splicing complex 1': {}},\n", + " 'ribosome biogenesis community': {'ribosome': {'ribosomal subunit': {'mitochondirial large ribosomal subunit': {},\n", + " 'mito-cyto ribosomal cluster': {},\n", + " 'cotranslational protein targeting to membrane system': {},\n", + " 'ribosomal complex 5': {},\n", + " 'ribosomal complex 2': {}}},\n", + " 'nucleic acid binding complex': {}}}}},\n", + " 'transcriptional regulation complex family': {'transcriptional regulation complexes': {}}},\n", + " 'nucleus': {'DNA metabolic assembly': {},\n", + " 'nuclear lumen': {'nucleolus': {'ribonucleprotein complex family': {},\n", + " 'RNA processing complex family': {'RNA processing complex 1': {},\n", + " 'RNA splicing complex family': {}},\n", + " 'splicosomal complex family': {}},\n", + " 'nuclear splicing speckle': {}},\n", + " 'nuclear body': {},\n", + " 'nucleo-plasm 1': {'chromosome organization complex family': {'chromatin organization complex family': {'HAT complex family': {'NuA4 HAT complex': {}}}}},\n", + " 'nucleo-plasm 2': {'chromatin regulation complex': {}},\n", + " 'nuclear transcriptional speckle': {'negative regulation of RNA biosynthesis process': {}}}}}" + ] + }, + "execution_count": 16, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "music_map" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 17, "id": "5a76608a-fff0-4005-9f32-c02afef39d9e", "metadata": { "tags": [] }, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Writing out/cell_hierarchy_functions\n" + ] + }, + { + "data": { + "image/svg+xml": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "bigraph\n", + "\n", + "\n", + "\n", + "('cell',)\n", + "\n", + "cell\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm')\n", + "\n", + "cytoplasm\n", + "\n", + "\n", + "\n", + "('cell',)->('cell', 'cytoplasm')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus')\n", + "\n", + "nucleus\n", + "\n", + "\n", + "\n", + "('cell',)->('cell', 'nucleus')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'transcription')\n", + "\n", + "transcription\n", + "\n", + "\n", + "\n", + "('cell',)->('cell', 'transcription')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'translation')\n", + "\n", + "translation\n", + "\n", + "\n", + "\n", + "('cell',)->('cell', 'translation')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'metabolism')\n", + "\n", + "metabolism\n", + "\n", + "\n", + "\n", + "('cell',)->('cell', 'metabolism')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'cell<br/>cycle')\n", + "\n", + "cell\n", + "cycle\n", + "\n", + "\n", + "\n", + "('cell',)->('cell', 'cell<br/>cycle')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'signalling')\n", + "\n", + "signalling\n", + "\n", + "\n", + "\n", + "('cell',)->('cell', 'signalling')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'protein<br/>transport')\n", + "\n", + "protein\n", + "transport\n", + "\n", + "\n", + "\n", + "('cell',)->('cell', 'protein<br/>transport')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'RNA<br/>processing')\n", + "\n", + "RNA\n", + "processing\n", + "\n", + "\n", + "\n", + "('cell',)->('cell', 'RNA<br/>processing')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'secretory<br/>organelles')\n", + "\n", + "secretory\n", + "organelles\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm')->('cell', 'cytoplasm', 'secretory<br/>organelles')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles')\n", + "\n", + "cytoplasmic\n", + "organelles\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'transcriptional<br/>regulation<br/>complex<br/>family')\n", + "\n", + "transcriptional\n", + "regulation\n", + "complex\n", + "family\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm')->('cell', 'cytoplasm', 'transcriptional<br/>regulation<br/>complex<br/>family')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'secretory<br/>organelles', 'transmembrane<br/>transport<br/>systems')\n", + "\n", + "transmembrane\n", + "transport\n", + "systems\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'secretory<br/>organelles')->('cell', 'cytoplasm', 'secretory<br/>organelles', 'transmembrane<br/>transport<br/>systems')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'secretory<br/>organelles', 'transmembrane<br/>transport<br/>systems', 'ion<br/>transmembrane<br/>transport<br/>systems')\n", + "\n", + "ion\n", + "transmembrane\n", + "transport\n", + "systems\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'secretory<br/>organelles', 'transmembrane<br/>transport<br/>systems')->('cell', 'cytoplasm', 'secretory<br/>organelles', 'transmembrane<br/>transport<br/>systems', 'ion<br/>transmembrane<br/>transport<br/>systems')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles')\n", + "\n", + "subgroup\n", + "of\n", + "cytoplasmic\n", + "organelles\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'metabolic<br/>organelles')\n", + "\n", + "metabolic\n", + "organelles\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'metabolic<br/>organelles')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family')\n", + "\n", + "ribonucleoprotein\n", + "complex\n", + "family\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'metabolic<br/>organelles', 'subgroup<br/>of<br/>metabolic<br/>organelles')\n", + "\n", + "subgroup\n", + "of\n", + "metabolic\n", + "organelles\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'metabolic<br/>organelles')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'metabolic<br/>organelles', 'subgroup<br/>of<br/>metabolic<br/>organelles')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'metabolic<br/>organelles', 'mitochondrion')\n", + "\n", + "mitochondrion\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'metabolic<br/>organelles')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'metabolic<br/>organelles', 'mitochondrion')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'RNA<br/>processing<br/>complex<br/>1')\n", + "\n", + "RNA\n", + "processing\n", + "complex\n", + "1\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'RNA<br/>processing<br/>complex<br/>1')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community')\n", + "\n", + "ribosome\n", + "biogenesis\n", + "community\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'RNA<br/>processing<br/>complex<br/>1', 'RNA<br/>splicing<br/>complex<br/>1')\n", + "\n", + "RNA\n", + "splicing\n", + "complex\n", + "1\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'RNA<br/>processing<br/>complex<br/>1')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'RNA<br/>processing<br/>complex<br/>1', 'RNA<br/>splicing<br/>complex<br/>1')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome')\n", + "\n", + "ribosome\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'nucleic<br/>acid<br/>binding<br/>complex')\n", + "\n", + "nucleic\n", + "acid\n", + "binding\n", + "complex\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'nucleic<br/>acid<br/>binding<br/>complex')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit')\n", + "\n", + "ribosomal\n", + "subunit\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'mitochondirial<br/>large<br/>ribosomal<br/>subunit')\n", + "\n", + "mitochondirial\n", + "large\n", + "ribosomal\n", + "subunit\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'mitochondirial<br/>large<br/>ribosomal<br/>subunit')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'mito-cyto<br/>ribosomal<br/>cluster')\n", + "\n", + "mito-cyto\n", + "ribosomal\n", + "cluster\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'mito-cyto<br/>ribosomal<br/>cluster')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'cotranslational<br/>protein<br/>targeting<br/>to<br/>membrane<br/>system')\n", + "\n", + "cotranslational\n", + "protein\n", + "targeting\n", + "to\n", + "membrane\n", + "system\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'cotranslational<br/>protein<br/>targeting<br/>to<br/>membrane<br/>system')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'ribosomal<br/>complex<br/>5')\n", + "\n", + "ribosomal\n", + "complex\n", + "5\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'ribosomal<br/>complex<br/>5')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'ribosomal<br/>complex<br/>2')\n", + "\n", + "ribosomal\n", + "complex\n", + "2\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'ribosomal<br/>complex<br/>2')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'transcriptional<br/>regulation<br/>complex<br/>family', 'transcriptional<br/>regulation<br/>complexes')\n", + "\n", + "transcriptional\n", + "regulation\n", + "complexes\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'transcriptional<br/>regulation<br/>complex<br/>family')->('cell', 'cytoplasm', 'transcriptional<br/>regulation<br/>complex<br/>family', 'transcriptional<br/>regulation<br/>complexes')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'DNA<br/>metabolic<br/>assembly')\n", + "\n", + "DNA\n", + "metabolic\n", + "assembly\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus')->('cell', 'nucleus', 'DNA<br/>metabolic<br/>assembly')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'nuclear<br/>lumen')\n", + "\n", + "nuclear\n", + "lumen\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus')->('cell', 'nucleus', 'nuclear<br/>lumen')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'nuclear<br/>body')\n", + "\n", + "nuclear\n", + "body\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus')->('cell', 'nucleus', 'nuclear<br/>body')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'nucleo-plasm<br/>1')\n", + "\n", + "nucleo-plasm\n", + "1\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus')->('cell', 'nucleus', 'nucleo-plasm<br/>1')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'nucleo-plasm<br/>2')\n", + "\n", + "nucleo-plasm\n", + "2\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus')->('cell', 'nucleus', 'nucleo-plasm<br/>2')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'nuclear<br/>transcriptional<br/>speckle')\n", + "\n", + "nuclear\n", + "transcriptional\n", + "speckle\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus')->('cell', 'nucleus', 'nuclear<br/>transcriptional<br/>speckle')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus')\n", + "\n", + "nucleolus\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'nuclear<br/>lumen')->('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'nuclear<br/>lumen', 'nuclear<br/>splicing<br/>speckle')\n", + "\n", + "nuclear\n", + "splicing\n", + "speckle\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'nuclear<br/>lumen')->('cell', 'nucleus', 'nuclear<br/>lumen', 'nuclear<br/>splicing<br/>speckle')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'ribonucleprotein<br/>complex<br/>family')\n", + "\n", + "ribonucleprotein\n", + "complex\n", + "family\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus')->('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'ribonucleprotein<br/>complex<br/>family')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'RNA<br/>processing<br/>complex<br/>family')\n", + "\n", + "RNA\n", + "processing\n", + "complex\n", + "family\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus')->('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'RNA<br/>processing<br/>complex<br/>family')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'splicosomal<br/>complex<br/>family')\n", + "\n", + "splicosomal\n", + "complex\n", + "family\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus')->('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'splicosomal<br/>complex<br/>family')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'RNA<br/>processing<br/>complex<br/>family', 'RNA<br/>processing<br/>complex<br/>1')\n", + "\n", + "RNA\n", + "processing\n", + "complex\n", + "1\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'RNA<br/>processing<br/>complex<br/>family')->('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'RNA<br/>processing<br/>complex<br/>family', 'RNA<br/>processing<br/>complex<br/>1')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'RNA<br/>processing<br/>complex<br/>family', 'RNA<br/>splicing<br/>complex<br/>family')\n", + "\n", + "RNA\n", + "splicing\n", + "complex\n", + "family\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'RNA<br/>processing<br/>complex<br/>family')->('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'RNA<br/>processing<br/>complex<br/>family', 'RNA<br/>splicing<br/>complex<br/>family')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family')\n", + "\n", + "chromosome\n", + "organization\n", + "complex\n", + "family\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'nucleo-plasm<br/>1')->('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family', 'chromatin<br/>organization<br/>complex<br/>family')\n", + "\n", + "chromatin\n", + "organization\n", + "complex\n", + "family\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family')->('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family', 'chromatin<br/>organization<br/>complex<br/>family')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family', 'chromatin<br/>organization<br/>complex<br/>family', 'HAT<br/>complex<br/>family')\n", + "\n", + "HAT\n", + "complex\n", + "family\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family', 'chromatin<br/>organization<br/>complex<br/>family')->('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family', 'chromatin<br/>organization<br/>complex<br/>family', 'HAT<br/>complex<br/>family')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family', 'chromatin<br/>organization<br/>complex<br/>family', 'HAT<br/>complex<br/>family', 'NuA4<br/>HAT<br/>complex')\n", + "\n", + "NuA4\n", + "HAT\n", + "complex\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family', 'chromatin<br/>organization<br/>complex<br/>family', 'HAT<br/>complex<br/>family')->('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family', 'chromatin<br/>organization<br/>complex<br/>family', 'HAT<br/>complex<br/>family', 'NuA4<br/>HAT<br/>complex')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'nucleo-plasm<br/>2', 'chromatin<br/>regulation<br/>complex')\n", + "\n", + "chromatin\n", + "regulation\n", + "complex\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'nucleo-plasm<br/>2')->('cell', 'nucleus', 'nucleo-plasm<br/>2', 'chromatin<br/>regulation<br/>complex')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'nuclear<br/>transcriptional<br/>speckle', 'negative<br/>regulation<br/>of<br/>RNA<br/>biosynthesis<br/>process')\n", + "\n", + "negative\n", + "regulation\n", + "of\n", + "RNA\n", + "biosynthesis\n", + "process\n", + "\n", + "\n", + "\n", + "('cell', 'nucleus', 'nuclear<br/>transcriptional<br/>speckle')->('cell', 'nucleus', 'nuclear<br/>transcriptional<br/>speckle', 'negative<br/>regulation<br/>of<br/>RNA<br/>biosynthesis<br/>process')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'transcription', 'wires')\n", + "\n", + "wires\n", + "\n", + "\n", + "\n", + "('cell', 'transcription')->('cell', 'transcription', 'wires')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'transcription', 'wires', 'RNA<br/>processing')\n", + "\n", + "RNA\n", + "processing\n", + "\n", + "\n", + "\n", + "('cell', 'transcription', 'wires')->('cell', 'transcription', 'wires', 'RNA<br/>processing')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'transcription', 'wires', 'regulation')\n", + "\n", + "regulation\n", + "\n", + "\n", + "\n", + "('cell', 'transcription', 'wires')->('cell', 'transcription', 'wires', 'regulation')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'transcription', 'wires', 'nucleic<br/>acids')\n", + "\n", + "nucleic\n", + "acids\n", + "\n", + "\n", + "\n", + "('cell', 'transcription', 'wires')->('cell', 'transcription', 'wires', 'nucleic<br/>acids')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'transcription', 'wires', 'negative<br/>regulation')\n", + "\n", + "negative\n", + "regulation\n", + "\n", + "\n", + "\n", + "('cell', 'transcription', 'wires')->('cell', 'transcription', 'wires', 'negative<br/>regulation')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'translation', 'wires')\n", + "\n", + "wires\n", + "\n", + "\n", + "\n", + "('cell', 'translation')->('cell', 'translation', 'wires')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'translation', 'wires', 'ribosomes')\n", + "\n", + "ribosomes\n", + "\n", + "\n", + "\n", + "('cell', 'translation', 'wires')->('cell', 'translation', 'wires', 'ribosomes')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'metabolism', 'wires')\n", + "\n", + "wires\n", + "\n", + "\n", + "\n", + "('cell', 'metabolism')->('cell', 'metabolism', 'wires')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'metabolism', 'wires', 'organelles')\n", + "\n", + "organelles\n", + "\n", + "\n", + "\n", + "('cell', 'metabolism', 'wires')->('cell', 'metabolism', 'wires', 'organelles')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'metabolism', 'wires', 'mitochondrion')\n", + "\n", + "mitochondrion\n", + "\n", + "\n", + "\n", + "('cell', 'metabolism', 'wires')->('cell', 'metabolism', 'wires', 'mitochondrion')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'metabolism', 'wires', 'ion<br/>transport')\n", + "\n", + "ion\n", + "transport\n", + "\n", + "\n", + "\n", + "('cell', 'metabolism', 'wires')->('cell', 'metabolism', 'wires', 'ion<br/>transport')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'cell<br/>cycle', 'wires')\n", + "\n", + "wires\n", + "\n", + "\n", + "\n", + "('cell', 'cell<br/>cycle')->('cell', 'cell<br/>cycle', 'wires')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'cell<br/>cycle', 'wires', 'DNA')\n", + "\n", + "DNA\n", + "\n", + "\n", + "\n", + "('cell', 'cell<br/>cycle', 'wires')->('cell', 'cell<br/>cycle', 'wires', 'DNA')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'cell<br/>cycle', 'wires', 'chromosome')\n", + "\n", + "chromosome\n", + "\n", + "\n", + "\n", + "('cell', 'cell<br/>cycle', 'wires')->('cell', 'cell<br/>cycle', 'wires', 'chromosome')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'cell<br/>cycle', 'wires', 'chromatin')\n", + "\n", + "chromatin\n", + "\n", + "\n", + "\n", + "('cell', 'cell<br/>cycle', 'wires')->('cell', 'cell<br/>cycle', 'wires', 'chromatin')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'signalling', 'wires')\n", + "\n", + "wires\n", + "\n", + "\n", + "\n", + "('cell', 'signalling')->('cell', 'signalling', 'wires')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'signalling', 'wires', 'transport')\n", + "\n", + "transport\n", + "\n", + "\n", + "\n", + "('cell', 'signalling', 'wires')->('cell', 'signalling', 'wires', 'transport')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'signalling', 'wires', 'trancript<br/>regulation')\n", + "\n", + "trancript\n", + "regulation\n", + "\n", + "\n", + "\n", + "('cell', 'signalling', 'wires')->('cell', 'signalling', 'wires', 'trancript<br/>regulation')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'protein<br/>transport', 'wires')\n", + "\n", + "wires\n", + "\n", + "\n", + "\n", + "('cell', 'protein<br/>transport')->('cell', 'protein<br/>transport', 'wires')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'protein<br/>transport', 'wires', 'transmembrane<br/>transport')\n", + "\n", + "transmembrane\n", + "transport\n", + "\n", + "\n", + "\n", + "('cell', 'protein<br/>transport', 'wires')->('cell', 'protein<br/>transport', 'wires', 'transmembrane<br/>transport')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'protein<br/>transport', 'wires', 'secretory')\n", + "\n", + "secretory\n", + "\n", + "\n", + "\n", + "('cell', 'protein<br/>transport', 'wires')->('cell', 'protein<br/>transport', 'wires', 'secretory')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'protein<br/>transport', 'wires', 'cotranslation')\n", + "\n", + "cotranslation\n", + "\n", + "\n", + "\n", + "('cell', 'protein<br/>transport', 'wires')->('cell', 'protein<br/>transport', 'wires', 'cotranslation')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'RNA<br/>processing', 'wires')\n", + "\n", + "wires\n", + "\n", + "\n", + "\n", + "('cell', 'RNA<br/>processing')->('cell', 'RNA<br/>processing', 'wires')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'RNA<br/>processing', 'wires', 'processing<br/>complex')\n", + "\n", + "processing\n", + "complex\n", + "\n", + "\n", + "\n", + "('cell', 'RNA<br/>processing', 'wires')->('cell', 'RNA<br/>processing', 'wires', 'processing<br/>complex')\n", + "\n", + "\n", + "\n", + "\n" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 17, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "import copy\n", "\n", @@ -1624,12 +3192,52 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 18, "id": "fe3008ad-498e-449f-8521-6ea29fd903f1", "metadata": { "tags": [] }, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Writing out/hypothesized_mechanism\n" + ] + }, + { + "data": { + "image/svg+xml": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "bigraph\n", + "\n", + "\n", + "\n", + "('hypothesized<br/>mechanism',)\n", + "\n", + "hypothesized\n", + "mechanism\n", + "\n", + "\n", + "\n" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 18, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "new_process = {\n", " 'hypothesized mechanism': {\n", @@ -1663,12 +3271,215 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 24, "id": "b39417ce-d9a1-4985-abce-ce22df816897", "metadata": { "tags": [] }, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Writing out/cell\n" + ] + }, + { + "data": { + "image/svg+xml": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "bigraph\n", + "\n", + "\n", + "\n", + "('outputs',)\n", + "\n", + "outputs\n", + "\n", + "\n", + "\n", + "('outputs', 'p1')\n", + "\n", + "p1\n", + "\n", + "\n", + "\n", + "('outputs',)->('outputs', 'p1')\n", + "\n", + "\n", + "\n", + "\n", + "('outputs', 'p2')\n", + "\n", + "p2\n", + "\n", + "\n", + "\n", + "('outputs',)->('outputs', 'p2')\n", + "\n", + "\n", + "\n", + "\n", + "('cell',)\n", + "\n", + "cell\n", + "\n", + "\n", + "\n", + "('cell', 'membrane')\n", + "\n", + "membrane\n", + "\n", + "\n", + "\n", + "('cell',)->('cell', 'membrane')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm')\n", + "\n", + "cytoplasm\n", + "\n", + "\n", + "\n", + "('cell',)->('cell', 'cytoplasm')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'nucleoid')\n", + "\n", + "nucleoid\n", + "\n", + "\n", + "\n", + "('cell',)->('cell', 'nucleoid')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'membrane', 'transmembrane<br/>transport')\n", + "\n", + "transmembrane\n", + "transport\n", + "\n", + "\n", + "\n", + "('cell', 'membrane')->('cell', 'membrane', 'transmembrane<br/>transport')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'membrane', 'transmembrane<br/>transport', 'wires')\n", + "\n", + "wires\n", + "\n", + "\n", + "\n", + "('cell', 'membrane', 'transmembrane<br/>transport')->('cell', 'membrane', 'transmembrane<br/>transport', 'wires')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'metabolites')\n", + "\n", + "metabolites\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm')->('cell', 'cytoplasm', 'metabolites')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'ribosomal<br/>complexes')\n", + "\n", + "ribosomal\n", + "complexes\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm')->('cell', 'cytoplasm', 'ribosomal<br/>complexes')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'transcript<br/>regulation<br/>complex')\n", + "\n", + "transcript\n", + "regulation\n", + "complex\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm')->('cell', 'cytoplasm', 'transcript<br/>regulation<br/>complex')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'translation')\n", + "\n", + "translation\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm')->('cell', 'cytoplasm', 'translation')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'transcript<br/>regulation<br/>complex', 'transcripts')\n", + "\n", + "transcripts\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'transcript<br/>regulation<br/>complex')->('cell', 'cytoplasm', 'transcript<br/>regulation<br/>complex', 'transcripts')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'translation', 'outputs')\n", + "\n", + "outputs\n", + "\n", + "\n", + "\n", + "('cell', 'cytoplasm', 'translation')->('cell', 'cytoplasm', 'translation', 'outputs')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'nucleoid', 'chromosome')\n", + "\n", + "chromosome\n", + "\n", + "\n", + "\n", + "('cell', 'nucleoid')->('cell', 'nucleoid', 'chromosome')\n", + "\n", + "\n", + "\n", + "\n" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 24, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "cell_struct_func = {\n", " 'cell': {\n", @@ -1680,10 +3491,10 @@ " '_process': 'transport URI',\n", " '_config': {'parameter': 1}\n", " },\n", - " 'wires': {\n", + " 'outputs': {\n", " 'transporters': 'transporters',\n", " 'internal': ['..', 'cytoplasm', 'metabolites']},\n", - " '_ports': {\n", + " '_outputs': {\n", " 'transporters': 'concentrations',\n", " 'internal': 'concentrations',\n", " 'external': 'concentrations'\n", @@ -1707,8 +3518,9 @@ " }\n", " },\n", " 'translation': {\n", - " 'wires': {\n", - " 'p1': 'ribosomal complexes',\n", + " '_type': 'process',\n", + " 'outputs': {\n", + " 'p1': ['ribosomal complexes'],\n", " 'p2': ['transcript regulation complex', 'transcripts']}}},\n", " 'nucleoid': {\n", " 'chromosome': {\n", @@ -1717,7 +3529,10 @@ " }\n", " }\n", "}\n", - "plot_bigraph(cell_struct_func, remove_process_place_edges=True, out_dir='out', filename='cell')" + "core = TypeSystem()\n", + "core.register('concentrations', 'float')\n", + "cell_struct_func2 = replace_regex_recursive(cell_struct_func)\n", + "plot_bigraph(cell_struct_func2, core=core, remove_process_place_edges=True, out_dir='out', filename='cell')" ] }, { From b6ec198c4cda5ba87b3bbba7bdfc34dc46da1bfc Mon Sep 17 00:00:00 2001 From: Eran Date: Sun, 25 Feb 2024 22:39:00 -0500 Subject: [PATCH 07/11] WIP --- bigraph_viz/__init__.py | 3 - bigraph_viz/diagram.py | 18 +- bigraph_viz/{plot.py => plot_old.py} | 0 notebooks/basics.ipynb | 2748 +++++++++---------- notebooks/basics2.ipynb | 3750 -------------------------- 5 files changed, 1236 insertions(+), 5283 deletions(-) rename bigraph_viz/{plot.py => plot_old.py} (100%) delete mode 100644 notebooks/basics2.ipynb diff --git a/bigraph_viz/__init__.py b/bigraph_viz/__init__.py index bcbb4ff..1d78ba1 100644 --- a/bigraph_viz/__init__.py +++ b/bigraph_viz/__init__.py @@ -1,5 +1,2 @@ from bigraph_viz.diagram import plot_bigraph from bigraph_schema import TypeSystem -# from bigraph_viz.plot import plot_bigraph, plot_flow, plot_multitimestep -# from bigraph_viz.dict_utils import pp, pf, schema_state_to_dict -# from bigraph_viz.convert import convert_vivarium_composite diff --git a/bigraph_viz/diagram.py b/bigraph_viz/diagram.py index 8ef1b8f..556f8a3 100644 --- a/bigraph_viz/diagram.py +++ b/bigraph_viz/diagram.py @@ -3,7 +3,7 @@ """ import os from bigraph_schema import TypeSystem, Edge -from bigraph_viz.plot import absolute_path, make_label, check_if_path_in_removed_nodes +from bigraph_viz.plot_old import absolute_path, make_label, check_if_path_in_removed_nodes import graphviz @@ -11,10 +11,21 @@ REMOVE_KEYS = ['global_time'] +updated_path_type = { + '_type': 'path', + '_inherit': 'list[string]~string', + # '_apply': apply_path +} + step_type = { '_type': 'step', '_inherit': 'edge', 'address': 'string', + # '_default': { + # 'inputs': {}, + # 'outputs': {}}, + # '_inputs': 'string~tuple', + # '_outputs': 'string~tuple', 'config': 'schema'} @@ -74,7 +85,9 @@ def get_graph_wires(schema, wires, graph_dict, schema_key, edge_path, port): subschema = schema.get(port, schema) graph_dict = get_graph_wires( subschema, subwire, graph_dict, schema_key, edge_path, port) - elif isinstance(wires, (list, tuple)): + elif isinstance(wires, (list, tuple, str)): + if isinstance(wires, str): + wires = [wires] target_path = absolute_path(edge_path[:-1], tuple(wires)) # TODO -- make sure this resolves ".." if schema_key == 'inputs': edge_key = 'input_edges' @@ -397,6 +410,7 @@ def plot_bigraph( core = core or TypeSystem() schema = schema or {} + core.register('path', updated_path_type, force=True) if not core.exists('step'): core.register('step', step_type) if not core.exists('process'): diff --git a/bigraph_viz/plot.py b/bigraph_viz/plot_old.py similarity index 100% rename from bigraph_viz/plot.py rename to bigraph_viz/plot_old.py diff --git a/notebooks/basics.ipynb b/notebooks/basics.ipynb index 40f3b64..d485be6 100644 --- a/notebooks/basics.ipynb +++ b/notebooks/basics.ipynb @@ -35,8 +35,9 @@ "name": "stdout", "output_type": "stream", "text": [ - "bigraph-schema==0.0.17\n", - "bigraph-viz==0.0.30\n" + "-e git+https://github.com/vivarium-collective/bigraph-schema.git@01a8525182a2de039a16223f086852ee602ac3a3#egg=bigraph_schema\n", + "-e git+https://github.com/vivarium-collective/bigraph-viz.git@84569678815db0194e2ce453dcd6443c798266ea#egg=bigraph_viz\n", + "-e git+https://github.com/vivarium-collective/process-bigraph.git@830e3ae01fe4e9c6d81ce9c29c47868b2c74a1d1#egg=process_bigraph\n" ] } ], @@ -63,10 +64,13 @@ }, "outputs": [], "source": [ - "from bigraph_viz import plot_bigraph, plot_flow, plot_multitimestep, pf\n", + "# from bigraph_viz import plot_bigraph, plot_flow, plot_multitimestep, pf\n", "from bigraph_viz.dict_utils import replace_regex_recursive\n", + "from bigraph_viz import plot_bigraph, TypeSystem\n", "\n", - "plot_settings = {'remove_process_place_edges': True}\n", + "plot_settings = {\n", + " 'remove_process_place_edges': True\n", + "}\n", "save_images = False\n", "if save_images:\n", " plot_settings.update({'out_dir': 'out','dpi': '250'})" @@ -99,32 +103,38 @@ "tags": [] }, "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Writing out/simple_store\n" + ] + }, { "data": { "image/svg+xml": [ "\n", "\n", - "\n", "\n", - "\n", - "\n", + "\n", + "\n", "bigraph\n", - "\n", + "\n", "\n", "\n", "('store1',)\n", - "\n", - "store1\n", - "1.0\n", + "\n", + "store1: 1.0\n", "\n", "\n", "\n" ], "text/plain": [ - "" + "" ] }, "execution_count": 3, @@ -153,32 +163,39 @@ "id": "f3e5fa71-7ffc-4a8f-a1a0-dc547c886f84", "metadata": {}, "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Writing out/store\n" + ] + }, { "data": { "image/svg+xml": [ "\n", "\n", - "\n", "\n", - "\n", - "\n", + "\n", + "\n", "bigraph\n", - "\n", + "\n", "\n", "\n", "('store1',)\n", - "\n", - "store1\n", - "1.0::float\n", + "\n", + "store1\n", + "[float]\n", "\n", "\n", "\n" ], "text/plain": [ - "" + "" ] }, "execution_count": 4, @@ -211,97 +228,104 @@ "id": "0f3f0824-f89d-4c6e-830e-2c5a321f7b33", "metadata": {}, "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Writing out/hierarchy\n" + ] + }, { "data": { "image/svg+xml": [ "\n", "\n", - "\n", "\n", - "\n", - "\n", + "\n", + "\n", "bigraph\n", - "\n", + "\n", "\n", "\n", "('store1',)\n", - "\n", - "store1\n", + "\n", + "store1\n", "\n", "\n", "\n", "('store1', 'store1.1')\n", - "\n", - "store1.1\n", + "\n", + "store1.1\n", "\n", "\n", "\n", "('store1',)->('store1', 'store1.1')\n", - "\n", + "\n", "\n", "\n", "\n", "('store1', 'store1.2')\n", - "\n", - "store1.2\n", + "\n", + "store1.2\n", "\n", "\n", "\n", "('store1',)->('store1', 'store1.2')\n", - "\n", + "\n", "\n", "\n", "\n", "('store1', 'store1.1', 'store1.1.1')\n", - "\n", - "store1.1.1\n", + "\n", + "store1.1.1\n", "\n", "\n", "\n", "('store1', 'store1.1')->('store1', 'store1.1', 'store1.1.1')\n", - "\n", + "\n", "\n", "\n", "\n", "('store1', 'store1.1', 'store1.1.2')\n", - "\n", - "store1.1.2\n", + "\n", + "store1.1.2\n", "\n", "\n", "\n", "('store1', 'store1.1')->('store1', 'store1.1', 'store1.1.2')\n", - "\n", + "\n", "\n", "\n", "\n", "('store1', 'store1.1', 'store1.1.3')\n", - "\n", - "store1.1.3\n", + "\n", + "store1.1.3\n", "\n", "\n", "\n", "('store1', 'store1.1')->('store1', 'store1.1', 'store1.1.3')\n", - "\n", + "\n", "\n", "\n", "\n", "('store1', 'store1.1', 'store1.1.3', 'store1.1.3.1')\n", - "\n", - "store1.1.3.1\n", + "\n", + "store1.1.3.1\n", "\n", "\n", "\n", "('store1', 'store1.1', 'store1.1.3')->('store1', 'store1.1', 'store1.1.3', 'store1.1.3.1')\n", - "\n", + "\n", "\n", "\n", "\n" ], "text/plain": [ - "" + "" ] }, "execution_count": 5, @@ -348,47 +372,54 @@ "id": "7c74237b-0d66-4e8f-a8ca-79174fadad8b", "metadata": {}, "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Writing out/process\n" + ] + }, { "data": { "image/svg+xml": [ "\n", "\n", - "\n", "\n", - "\n", - "\n", + "\n", + "\n", "bigraph\n", - "\n", + "\n", "\n", "\n", "('process1',)\n", - "\n", - "process1\n", + "\n", + "process1\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", - "('process1', 'port1')->('process1',)\n", - "\n", - "\n", - "port1\n", + "('process1', 'p', 'o', 'r', 't', '1')->('process1',)\n", + "\n", + "\n", + "port1\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", - "('process1', 'port2')->('process1',)\n", - "\n", - "\n", - "port2\n", + "('process1', 'p', 'o', 'r', 't', '2')->('process1',)\n", + "\n", + "\n", + "port2\n", "\n", "\n", "\n" ], "text/plain": [ - "" + "" ] }, "execution_count": 6, @@ -398,10 +429,9 @@ ], "source": [ "process_spec = {\n", - " '_type': 'python_process',\n", " 'process1': {\n", " '_type': 'edge',\n", - " '_ports': {\n", + " '_inputs': {\n", " 'port1': 'Any',\n", " 'port2': 'Any',\n", " },\n", @@ -424,91 +454,98 @@ "id": "8c2457a3-fc47-4850-8b9e-9ee98e81567d", "metadata": {}, "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Writing out/multiple_processes\n" + ] + }, { "data": { "image/svg+xml": [ "\n", "\n", - "\n", "\n", - "\n", - "\n", + "\n", + "\n", "bigraph\n", - "\n", + "\n", "\n", "\n", "('process1',)\n", - "\n", - "process1\n", + "\n", + "process1\n", "\n", "\n", "\n", "('process2',)\n", - "\n", - "process2\n", + "\n", + "process2\n", "\n", "\n", "\n", "('process3',)\n", - "\n", - "process3\n", + "\n", + "process3\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", - "('process1', 'port1')->('process1',)\n", - "\n", - "\n", - "port1\n", + "('process1', 'p', 'o', 'r', 't', '1')->('process1',)\n", + "\n", + "\n", + "port1\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", - "('process1', 'port2')->('process1',)\n", - "\n", - "\n", - "port2\n", + "('process2', 'p', 'o', 'r', 't', '1')->('process2',)\n", + "\n", + "\n", + "port1\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", - "('process2', 'port1')->('process2',)\n", - "\n", - "\n", - "port1\n", + "('process3', 'p', 'o', 'r', 't', '1')->('process3',)\n", + "\n", + "\n", + "port1\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", - "('process2', 'port2')->('process2',)\n", - "\n", - "\n", - "port2\n", + "('process1', 'p', 'o', 'r', 't', '2')->('process1',)\n", + "\n", + "\n", + "port2\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", - "('process3', 'port1')->('process3',)\n", - "\n", - "\n", - "port1\n", + "('process2', 'p', 'o', 'r', 't', '2')->('process2',)\n", + "\n", + "\n", + "port2\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", - "('process3', 'port2')->('process3',)\n", - "\n", - "\n", - "port2\n", + "('process3', 'p', 'o', 'r', 't', '2')->('process3',)\n", + "\n", + "\n", + "port2\n", "\n", "\n", "\n" ], "text/plain": [ - "" + "" ] }, "execution_count": 7, @@ -518,11 +555,13 @@ ], "source": [ "process_schema = {\n", - " '_type': 'python_process',\n", - " '_ports': {\n", + " '_type': 'process',\n", + " '_inputs': {\n", " 'port1': 'Any',\n", + " },\n", + " '_outputs': {\n", " 'port2': 'Any'\n", - " }\n", + " },\n", "}\n", "\n", "processes_spec = {\n", @@ -548,70 +587,77 @@ "id": "a6ecad5d-8948-4636-910c-79284a3e8679", "metadata": {}, "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Writing out/wires\n" + ] + }, { "data": { "image/svg+xml": [ "\n", "\n", - "\n", "\n", - "\n", - "\n", + "\n", + "\n", "bigraph\n", - "\n", + "\n", "\n", "\n", "('node1',)\n", - "\n", - "node1\n", + "\n", + "node1\n", "\n", "\n", "\n", "('process1',)\n", - "\n", - "process1\n", + "\n", + "process1\n", "\n", "\n", "\n", "('node1',)->('process1',)\n", - "\n", - "\n", - "port1\n", + "\n", + "\n", + "port1\n", "\n", "\n", "\n", "('node2',)\n", - "\n", - "node2\n", + "\n", + "node2\n", "\n", "\n", "\n", "('node2',)->('process1',)\n", - "\n", - "\n", - "port2\n", + "\n", + "\n", + "port2\n", "\n", "\n", "\n", "('node3',)\n", - "\n", - "node3\n", + "\n", + "node3\n", "\n", "\n", "\n", "('node3',)->('process1',)\n", - "\n", - "\n", - "port3\n", + "\n", + "\n", + "port3\n", "\n", "\n", "\n" ], "text/plain": [ - "" + "" ] }, "execution_count": 8, @@ -622,19 +668,19 @@ "source": [ "connected_process_spec = {\n", " 'process1': {\n", - " '_type': 'process',\n", - " '_ports': {\n", + " '_type': 'edge',\n", + " '_inputs': {\n", " 'port1': 'float',\n", " 'port2': 'int',\n", " 'port3': 'int',\n", " },\n", - " 'wires': {\n", - " 'port1': 'node1',\n", - " 'port2': 'node2',\n", - " 'port3': 'node3',\n", + " 'inputs': {\n", + " 'port1': ['node1'],\n", + " 'port2': ['node2'],\n", + " 'port3': ['node3'],\n", " }\n", " },\n", - " 'node1': 'float',\n", + " 'node1': 'float', # TODO -- shouldn't these fill?\n", " 'node2': 'int',\n", " 'node3': 'int',\n", "}\n", @@ -673,77 +719,84 @@ "id": "781a84e6-bbe2-4708-b441-47efc611b46f", "metadata": {}, "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Writing out/flat_composite\n" + ] + }, { "data": { "image/svg+xml": [ "\n", "\n", - "\n", "\n", - "\n", - "\n", + "\n", + "\n", "bigraph\n", - "\n", + "\n", "\n", "\n", "('store1.1',)\n", - "\n", - "store1.1\n", + "\n", + "store1.1\n", "\n", "\n", "\n", "('process1',)\n", - "\n", - "process1\n", + "\n", + "process1\n", "\n", "\n", - "\n", + "\n", "('store1.1',)->('process1',)\n", - "\n", - "\n", - "port1\n", + "\n", + "\n", + "port1\n", "\n", "\n", "\n", "('process2',)\n", - "\n", - "process2\n", + "\n", + "process2\n", "\n", "\n", - "\n", + "\n", "('store1.1',)->('process2',)\n", - "\n", - "\n", - "port1\n", + "\n", + "\n", + "port1\n", "\n", "\n", "\n", "('store1.2',)\n", - "\n", - "store1.2\n", + "\n", + "store1.2\n", "\n", "\n", - "\n", + "\n", "('store1.2',)->('process1',)\n", - "\n", - "\n", - "port2\n", + "\n", + "\n", + "port2\n", "\n", "\n", - "\n", + "\n", "('store1.2',)->('process2',)\n", - "\n", - "\n", - "port2\n", + "\n", + "\n", + "port2\n", "\n", "\n", "\n" ], "text/plain": [ - "" + "" ] }, "execution_count": 9, @@ -756,17 +809,17 @@ " 'store1.1': 'float',\n", " 'store1.2': 'int',\n", " 'process1': {\n", - " '_type': 'python_process:temporal',\n", - " 'wires': {\n", - " 'port1': 'store1.1',\n", - " 'port2': 'store1.2',\n", + " '_type': 'process',\n", + " 'outputs': {\n", + " 'port1': ['store1.1'],\n", + " 'port2': ['store1.2'],\n", " }\n", " },\n", " 'process2': {\n", - " '_type': 'python_process:temporal',\n", - " 'wires': {\n", - " 'port1': 'store1.1',\n", - " 'port2': 'store1.2',\n", + " '_type': 'process',\n", + " 'inputs': {\n", + " 'port1': ['store1.1'],\n", + " 'port2': ['store1.2'],\n", " }\n", " },\n", "}\n", @@ -788,108 +841,123 @@ "id": "701e759d-7f9b-41bb-911c-a8208c892462", "metadata": {}, "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Writing out/nested_composite\n" + ] + }, { "data": { "image/svg+xml": [ "\n", "\n", - "\n", "\n", - "\n", - "\n", + "\n", + "\n", "bigraph\n", - "\n", + "\n", "\n", "\n", "('store1',)\n", - "\n", - "store1\n", + "\n", + "store1\n", "\n", "\n", "\n", "('store1', 'store1.1')\n", - "\n", - "store1.1\n", + "\n", + "store1.1\n", "\n", "\n", "\n", "('store1',)->('store1', 'store1.1')\n", - "\n", + "\n", "\n", "\n", "\n", "('store1', 'store1.2')\n", - "\n", - "store1.2\n", + "\n", + "store1.2\n", "\n", "\n", "\n", "('store1',)->('store1', 'store1.2')\n", - "\n", + "\n", "\n", "\n", "\n", "('store1', 'process1')\n", "\n", - "process1\n", + "process1\n", "\n", "\n", + "\n", + "('store1',)->('store1', 'process1')\n", + "\n", + "\n", "\n", "\n", "('store1', 'process2')\n", - "\n", - "process2\n", + "\n", + "process2\n", "\n", "\n", + "\n", + "('store1',)->('store1', 'process2')\n", + "\n", + "\n", "\n", "\n", "('process3',)\n", - "\n", - "process3\n", + "\n", + "process3\n", "\n", "\n", - "\n", + "\n", "('store1',)->('process3',)\n", - "\n", - "\n", - "port1\n", + "\n", + "\n", + "port1\n", "\n", "\n", "\n", "('store1', 'store1.1')->('store1', 'process1')\n", - "\n", - "\n", - "port1\n", + "\n", + "\n", + "port1\n", "\n", "\n", - "\n", + "\n", "('store1', 'store1.1')->('store1', 'process2')\n", - "\n", - "\n", - "port1\n", + "\n", + "\n", + "port1\n", "\n", "\n", "\n", "('store1', 'store1.2')->('store1', 'process1')\n", - "\n", - "\n", - "port2\n", + "\n", + "\n", + "port2\n", "\n", "\n", - "\n", + "\n", "('store1', 'store1.2')->('store1', 'process2')\n", - "\n", - "\n", - "port2\n", + "\n", + "\n", + "port2\n", "\n", "\n", "\n" ], "text/plain": [ - "" + "" ] }, "execution_count": 10, @@ -903,28 +971,30 @@ " 'store1.1': 'float',\n", " 'store1.2': 'int',\n", " 'process1': {\n", - " '_type': 'python_process:temporal',\n", - " 'wires': {\n", - " 'port1': 'store1.1',\n", - " 'port2': 'store1.2',\n", + " '_type': 'process',\n", + " 'inputs': {\n", + " 'port1': ['store1.1'],\n", + " 'port2': ['store1.2'],\n", " }\n", " },\n", " 'process2': {\n", - " '_type': 'python_process:temporal',\n", - " 'wires': {\n", - " 'port1': 'store1.1',\n", - " 'port2': 'store1.2',\n", + " '_type': 'process',\n", + " 'outputs': {\n", + " 'port1': ['store1.1'],\n", + " 'port2': ['store1.2'],\n", " }\n", " },\n", " },\n", " 'process3': {\n", - " '_type': 'python_process:temporal',\n", - " 'wires': {\n", - " 'port1': 'store1',\n", + " '_type': 'process',\n", + " 'inputs': {\n", + " 'port1': ['store1'],\n", " }\n", " }\n", "}\n", - "plot_bigraph(nested_composite_spec, **plot_settings, filename='nested_composite')" + "plot_bigraph(nested_composite_spec, \n", + " # **plot_settings, \n", + " filename='nested_composite')" ] }, { @@ -938,167 +1008,43 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": null, "id": "638c5dc7-4cfd-46e4-b66a-8c42ca98ff1d", "metadata": {}, - "outputs": [ - { - "data": { - "image/svg+xml": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "bigraph\n", - "\n", - "\n", - "\n", - "('composite_process', 'store1.1')\n", - "\n", - "store1.1\n", - "\n", - "\n", - "\n", - "('composite_process', 'process1')\n", - "\n", - "process1\n", - "\n", - "\n", - "\n", - "('composite_process', 'store1.1')->('composite_process', 'process1')\n", - "\n", - "\n", - "port1\n", - "\n", - "\n", - "\n", - "('composite_process', 'process2')\n", - "\n", - "process2\n", - "\n", - "\n", - "\n", - "('composite_process', 'store1.1')->('composite_process', 'process2')\n", - "\n", - "\n", - "port1\n", - "\n", - "\n", - "\n", - "('composite_process', 'store1.2')\n", - "\n", - "store1.2\n", - "\n", - "\n", - "\n", - "('composite_process', 'store1.2')->('composite_process', 'process1')\n", - "\n", - "\n", - "port2\n", - "\n", - "\n", - "\n", - "('composite_process', 'store1.2')->('composite_process', 'process2')\n", - "\n", - "\n", - "port2\n", - "\n", - "\n", - "\n", - "('composite_process',)\n", - "\n", - "\n", - "composite_process\n", - "\n", - "\n", - "\n", - "('composite_process',)->('composite_process', 'store1.1')\n", - "\n", - "\n", - "\n", - "\n", - "('composite_process',)->('composite_process', 'store1.1')\n", - "\n", - "\n", - "tunnel port1\n", - "\n", - "\n", - "\n", - "('composite_process',)->('composite_process', 'store1.2')\n", - "\n", - "\n", - "\n", - "\n", - "('composite_process',)->('composite_process', 'store1.2')\n", - "\n", - "\n", - "tunnel port2\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "('composite_process', 'port1')->('composite_process',)\n", - "\n", - "\n", - "port1\n", - "\n", - "\n", - "\n", - "\n", - "('composite_process', 'port2')->('composite_process',)\n", - "\n", - "\n", - "port2\n", - "\n", - "\n", - "\n" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 11, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "composite_process_spec = {\n", " 'composite_process': {\n", - " 'store1.1': 'Any',\n", - " 'store1.2': 'Any',\n", + " 'store1.1': 'any',\n", + " 'store1.2': 'any',\n", " 'process1': {\n", - " '_type': 'python_process:temporal',\n", - " 'wires': {\n", + " '_type': 'process',\n", + " 'outputs': {\n", " 'port1': 'store1.1',\n", " 'port2': 'store1.2',\n", " }\n", " },\n", " 'process2': {\n", - " '_type': 'python_process:temporal',\n", - " 'wires': {\n", + " '_type': 'process',\n", + " 'outputs': {\n", " 'port1': 'store1.1',\n", " 'port2': 'store1.2',\n", " }\n", " },\n", - " '_ports': {\n", - " 'port1': 'Any', \n", - " 'port2': 'Any', \n", - " },\n", - " '_tunnels': {\n", - " 'port1': 'store1.1',\n", - " 'port2': 'store1.2',\n", - " }\n", + " # '_inputs': {\n", + " # 'port1': 'Any', \n", + " # 'port2': 'Any', \n", + " # },\n", + " # '_tunnels': {\n", + " # 'port1': 'store1.1',\n", + " # 'port2': 'store1.2',\n", + " # }\n", " }\n", "}\n", - "plot_bigraph(composite_process_spec, **plot_settings, filename='composite_process')" + "\n", + "plot_bigraph(\n", + " composite_process_spec, \n", + " **plot_settings, filename='composite_process')" ] }, { @@ -1139,198 +1085,22 @@ "execution_count": 13, "id": "f0eff7b0-f0e2-4d56-8b16-ef0fc1ce5aba", "metadata": {}, - "outputs": [ - { - "data": { - "image/svg+xml": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "flow\n", - "\n", - "\n", - "\n", - "('temporal<br/>process2',)\n", - "\n", - "temporal\n", - "process2\n", - "\n", - "\n", - "\n", - "('temporal<br/>process2',) 1.0\n", - "\n", - "1.0\n", - "\n", - "\n", - "\n", - "('temporal<br/>process2',)->('temporal<br/>process2',) 1.0\n", - "\n", - "\n", - "\n", - "\n", - "('temporal<br/>process2',) 2.0\n", - "\n", - "2.0\n", - "\n", - "\n", - "\n", - "('temporal<br/>process2',) 1.0->('temporal<br/>process2',) 2.0\n", - "\n", - "\n", - "\n", - "\n", - "('state',)\n", - "\n", - "state\n", - "\n", - "\n", - "\n", - "('temporal<br/>process2',) 1.0->('state',)\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "('temporal<br/>process2',) end\n", - "\n", - "\n", - "\n", - "\n", - "('temporal<br/>process2',) 2.0->('temporal<br/>process2',) end\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "('temporal<br/>process2',) 2.0->('state',)\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "('temporal<br/>process1',)\n", - "\n", - "temporal\n", - "process1\n", - "\n", - "\n", - "\n", - "('temporal<br/>process1',) 0.5\n", - "\n", - "0.5\n", - "\n", - "\n", - "\n", - "('temporal<br/>process1',)->('temporal<br/>process1',) 0.5\n", - "\n", - "\n", - "\n", - "\n", - "('temporal<br/>process1',) 1.0\n", - "\n", - "1.0\n", - "\n", - "\n", - "\n", - "('temporal<br/>process1',) 0.5->('temporal<br/>process1',) 1.0\n", - "\n", - "\n", - "\n", - "\n", - "('temporal<br/>process1',) 0.5->('state',)\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "('temporal<br/>process1',) 1.5\n", - "\n", - "1.5\n", - "\n", - "\n", - "\n", - "('temporal<br/>process1',) 1.0->('temporal<br/>process1',) 1.5\n", - "\n", - "\n", - "\n", - "\n", - "('temporal<br/>process1',) 1.0->('state',)\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "('temporal<br/>process1',) 2.0\n", - "\n", - "2.0\n", - "\n", - "\n", - "\n", - "('temporal<br/>process1',) 1.5->('temporal<br/>process1',) 2.0\n", - "\n", - "\n", - "\n", - "\n", - "('temporal<br/>process1',) 1.5->('state',)\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "('temporal<br/>process1',) end\n", - "\n", - "\n", - "\n", - "\n", - "('temporal<br/>process1',) 2.0->('temporal<br/>process1',) end\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "('temporal<br/>process1',) 2.0->('state',)\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 13, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ - "multitimestep_spec = {\n", - " 'temporal process2': {\n", - " '_ports': {'port1': 'Any'},\n", - " 'wires': {'port1': 'state'},\n", - " '_sync_step': 1.0,\n", - " },\n", - " 'temporal process1': {\n", - " '_ports': {'port1': 'Any'},\n", - " 'wires': {'port1': 'state'},\n", - " '_sync_step': 0.5,\n", - " },\n", - "}\n", - "multitimestep_spec = replace_regex_recursive(multitimestep_spec)\n", - "plot_multitimestep(multitimestep_spec, total_time=2.0, **plot_settings2, filename='multitimestep')" + "# multitimestep_spec = {\n", + "# 'temporal process2': {\n", + "# '_ports': {'port1': 'Any'},\n", + "# 'wires': {'port1': 'state'},\n", + "# '_sync_step': 1.0,\n", + "# },\n", + "# 'temporal process1': {\n", + "# '_ports': {'port1': 'Any'},\n", + "# 'wires': {'port1': 'state'},\n", + "# '_sync_step': 0.5,\n", + "# },\n", + "# }\n", + "# multitimestep_spec = replace_regex_recursive(multitimestep_spec)\n", + "# plot_multitimestep(multitimestep_spec, total_time=2.0, **plot_settings2, filename='multitimestep')" ] }, { @@ -1348,100 +1118,32 @@ "execution_count": 14, "id": "db45c99b-b97b-47bc-a73e-c669882f3969", "metadata": {}, - "outputs": [ - { - "data": { - "image/svg+xml": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "flow\n", - "\n", - "\n", - "\n", - "('step1',)\n", - "\n", - "step1\n", - "\n", - "\n", - "\n", - "('step2',)\n", - "\n", - "step2\n", - "\n", - "\n", - "\n", - "('step1',)->('step2',)\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "('step4',)\n", - "\n", - "step4\n", - "\n", - "\n", - "\n", - "('step2',)->('step4',)\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "('step3',)\n", - "\n", - "step3\n", - "\n", - "\n", - "\n", - "('step3',)->('step4',)\n", - "\n", - "\n", - "\n", - "\n", - "\n" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 14, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ - "flow = {\n", - " 'step1': {\n", - " '_type': 'step_process',\n", - " '_ports': {},\n", - " '_depends_on': [], \n", - " },\n", - " 'step2': {\n", - " '_type': 'step_process',\n", - " '_ports': {},\n", - " '_depends_on': 'step1', \n", - " },\n", - " 'step3': {\n", - " '_type': 'step_process',\n", - " '_ports': {},\n", - " '_depends_on': [], \n", - " },\n", - " 'step4': {\n", - " '_type': 'step_process',\n", - " '_ports': {},\n", - " '_depends_on': ['step2', 'step3'], \n", - " },\n", - "}\n", + "# flow = {\n", + "# 'step1': {\n", + "# '_type': 'step_process',\n", + "# '_ports': {},\n", + "# '_depends_on': [], \n", + "# },\n", + "# 'step2': {\n", + "# '_type': 'step_process',\n", + "# '_ports': {},\n", + "# '_depends_on': 'step1', \n", + "# },\n", + "# 'step3': {\n", + "# '_type': 'step_process',\n", + "# '_ports': {},\n", + "# '_depends_on': [], \n", + "# },\n", + "# 'step4': {\n", + "# '_type': 'step_process',\n", + "# '_ports': {},\n", + "# '_depends_on': ['step2', 'step3'], \n", + "# },\n", + "# }\n", "\n", - "plot_flow(flow, **plot_settings2, filename='flow')" + "# plot_flow(flow, **plot_settings2, filename='flow')" ] }, { @@ -1472,591 +1174,598 @@ "tags": [] }, "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Writing out/cell_hierarchy\n" + ] + }, { "data": { "image/svg+xml": [ "\n", "\n", - "\n", "\n", - "\n", - "\n", + "\n", + "\n", "bigraph\n", - "\n", + "\n", "\n", "\n", "('cell',)\n", - "\n", - "cell\n", + "\n", + "cell\n", "\n", "\n", "\n", "('cell', 'cytoplasm')\n", - "\n", - "cytoplasm\n", + "\n", + "cytoplasm\n", "\n", "\n", "\n", "('cell',)->('cell', 'cytoplasm')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'nucleus')\n", - "\n", - "nucleus\n", + "\n", + "nucleus\n", "\n", "\n", "\n", "('cell',)->('cell', 'nucleus')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'secretory<br/>organelles')\n", - "\n", - "secretory\n", - "organelles\n", + "\n", + "secretory\n", + "organelles\n", "\n", "\n", "\n", "('cell', 'cytoplasm')->('cell', 'cytoplasm', 'secretory<br/>organelles')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles')\n", - "\n", - "cytoplasmic\n", - "organelles\n", + "\n", + "cytoplasmic\n", + "organelles\n", "\n", "\n", "\n", "('cell', 'cytoplasm')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'transcriptional<br/>regulation<br/>complex<br/>family')\n", - "\n", - "transcriptional\n", - "regulation\n", - "complex\n", - "family\n", + "\n", + "transcriptional\n", + "regulation\n", + "complex\n", + "family\n", "\n", "\n", "\n", "('cell', 'cytoplasm')->('cell', 'cytoplasm', 'transcriptional<br/>regulation<br/>complex<br/>family')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'secretory<br/>organelles', 'transmembrane<br/>transport<br/>systems')\n", - "\n", - "transmembrane\n", - "transport\n", - "systems\n", + "\n", + "transmembrane\n", + "transport\n", + "systems\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'secretory<br/>organelles')->('cell', 'cytoplasm', 'secretory<br/>organelles', 'transmembrane<br/>transport<br/>systems')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'secretory<br/>organelles', 'transmembrane<br/>transport<br/>systems', 'ion<br/>transmembrane<br/>transport<br/>systems')\n", - "\n", - "ion\n", - "transmembrane\n", - "transport\n", - "systems\n", + "\n", + "ion\n", + "transmembrane\n", + "transport\n", + "systems\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'secretory<br/>organelles', 'transmembrane<br/>transport<br/>systems')->('cell', 'cytoplasm', 'secretory<br/>organelles', 'transmembrane<br/>transport<br/>systems', 'ion<br/>transmembrane<br/>transport<br/>systems')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles')\n", - "\n", - "subgroup\n", - "of\n", - "cytoplasmic\n", - "organelles\n", + "\n", + "subgroup\n", + "of\n", + "cytoplasmic\n", + "organelles\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'metabolic<br/>organelles')\n", - "\n", - "metabolic\n", - "organelles\n", + "\n", + "metabolic\n", + "organelles\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'metabolic<br/>organelles')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family')\n", - "\n", - "ribonucleoprotein\n", - "complex\n", - "family\n", + "\n", + "ribonucleoprotein\n", + "complex\n", + "family\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'metabolic<br/>organelles', 'subgroup<br/>of<br/>metabolic<br/>organelles')\n", - "\n", - "subgroup\n", - "of\n", - "metabolic\n", - "organelles\n", + "\n", + "subgroup\n", + "of\n", + "metabolic\n", + "organelles\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'metabolic<br/>organelles')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'metabolic<br/>organelles', 'subgroup<br/>of<br/>metabolic<br/>organelles')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'metabolic<br/>organelles', 'mitochondrion')\n", - "\n", - "mitochondrion\n", + "\n", + "mitochondrion\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'metabolic<br/>organelles')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'metabolic<br/>organelles', 'mitochondrion')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'RNA<br/>processing<br/>complex<br/>1')\n", - "\n", - "RNA\n", - "processing\n", - "complex\n", - "1\n", + "\n", + "RNA\n", + "processing\n", + "complex\n", + "1\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'RNA<br/>processing<br/>complex<br/>1')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community')\n", - "\n", - "ribosome\n", - "biogenesis\n", - "community\n", + "\n", + "ribosome\n", + "biogenesis\n", + "community\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'RNA<br/>processing<br/>complex<br/>1', 'RNA<br/>splicing<br/>complex<br/>1')\n", - "\n", - "RNA\n", - "splicing\n", - "complex\n", - "1\n", + "\n", + "RNA\n", + "splicing\n", + "complex\n", + "1\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'RNA<br/>processing<br/>complex<br/>1')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'RNA<br/>processing<br/>complex<br/>1', 'RNA<br/>splicing<br/>complex<br/>1')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome')\n", - "\n", - "ribosome\n", + "\n", + "ribosome\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'nucleic<br/>acid<br/>binding<br/>complex')\n", - "\n", - "nucleic\n", - "acid\n", - "binding\n", - "complex\n", + "\n", + "nucleic\n", + "acid\n", + "binding\n", + "complex\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'nucleic<br/>acid<br/>binding<br/>complex')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit')\n", - "\n", - "ribosomal\n", - "subunit\n", + "\n", + "ribosomal\n", + "subunit\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'mitochondirial<br/>large<br/>ribosomal<br/>subunit')\n", - "\n", - "mitochondirial\n", - "large\n", - "ribosomal\n", - "subunit\n", + "\n", + "mitochondirial\n", + "large\n", + "ribosomal\n", + "subunit\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'mitochondirial<br/>large<br/>ribosomal<br/>subunit')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'mito-cyto<br/>ribosomal<br/>cluster')\n", - "\n", - "mito-cyto\n", - "ribosomal\n", - "cluster\n", + "\n", + "mito-cyto\n", + "ribosomal\n", + "cluster\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'mito-cyto<br/>ribosomal<br/>cluster')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'cotranslational<br/>protein<br/>targeting<br/>to<br/>membrane<br/>system')\n", - "\n", - "cotranslational\n", - "protein\n", - "targeting\n", - "to\n", - "membrane\n", - "system\n", + "\n", + "cotranslational\n", + "protein\n", + "targeting\n", + "to\n", + "membrane\n", + "system\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'cotranslational<br/>protein<br/>targeting<br/>to<br/>membrane<br/>system')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'ribosomal<br/>complex<br/>5')\n", - "\n", - "ribosomal\n", - "complex\n", - "5\n", + "\n", + "ribosomal\n", + "complex\n", + "5\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'ribosomal<br/>complex<br/>5')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'ribosomal<br/>complex<br/>2')\n", - "\n", - "ribosomal\n", - "complex\n", - "2\n", + "\n", + "ribosomal\n", + "complex\n", + "2\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'ribosomal<br/>complex<br/>2')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'transcriptional<br/>regulation<br/>complex<br/>family', 'transcriptional<br/>regulation<br/>complexes')\n", - "\n", - "transcriptional\n", - "regulation\n", - "complexes\n", + "\n", + "transcriptional\n", + "regulation\n", + "complexes\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'transcriptional<br/>regulation<br/>complex<br/>family')->('cell', 'cytoplasm', 'transcriptional<br/>regulation<br/>complex<br/>family', 'transcriptional<br/>regulation<br/>complexes')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'nucleus', 'DNA<br/>metabolic<br/>assembly')\n", - "\n", - "DNA\n", - "metabolic\n", - "assembly\n", + "\n", + "DNA\n", + "metabolic\n", + "assembly\n", "\n", "\n", "\n", "('cell', 'nucleus')->('cell', 'nucleus', 'DNA<br/>metabolic<br/>assembly')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'nucleus', 'nuclear<br/>lumen')\n", - "\n", - "nuclear\n", - "lumen\n", + "\n", + "nuclear\n", + "lumen\n", "\n", "\n", "\n", "('cell', 'nucleus')->('cell', 'nucleus', 'nuclear<br/>lumen')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'nucleus', 'nuclear<br/>body')\n", - "\n", - "nuclear\n", - "body\n", + "\n", + "nuclear\n", + "body\n", "\n", "\n", "\n", "('cell', 'nucleus')->('cell', 'nucleus', 'nuclear<br/>body')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'nucleus', 'nucleo-plasm<br/>1')\n", - "\n", - "nucleo-plasm\n", - "1\n", + "\n", + "nucleo-plasm\n", + "1\n", "\n", "\n", "\n", "('cell', 'nucleus')->('cell', 'nucleus', 'nucleo-plasm<br/>1')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'nucleus', 'nucleo-plasm<br/>2')\n", - "\n", - "nucleo-plasm\n", - "2\n", + "\n", + "nucleo-plasm\n", + "2\n", "\n", "\n", "\n", "('cell', 'nucleus')->('cell', 'nucleus', 'nucleo-plasm<br/>2')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'nucleus', 'nuclear<br/>transcriptional<br/>speckle')\n", - "\n", - "nuclear\n", - "transcriptional\n", - "speckle\n", + "\n", + "nuclear\n", + "transcriptional\n", + "speckle\n", "\n", "\n", "\n", "('cell', 'nucleus')->('cell', 'nucleus', 'nuclear<br/>transcriptional<br/>speckle')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus')\n", - "\n", - "nucleolus\n", + "\n", + "nucleolus\n", "\n", "\n", "\n", "('cell', 'nucleus', 'nuclear<br/>lumen')->('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'nucleus', 'nuclear<br/>lumen', 'nuclear<br/>splicing<br/>speckle')\n", - "\n", - "nuclear\n", - "splicing\n", - "speckle\n", + "\n", + "nuclear\n", + "splicing\n", + "speckle\n", "\n", "\n", "\n", "('cell', 'nucleus', 'nuclear<br/>lumen')->('cell', 'nucleus', 'nuclear<br/>lumen', 'nuclear<br/>splicing<br/>speckle')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'ribonucleprotein<br/>complex<br/>family')\n", - "\n", - "ribonucleprotein\n", - "complex\n", - "family\n", + "\n", + "ribonucleprotein\n", + "complex\n", + "family\n", "\n", "\n", "\n", "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus')->('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'ribonucleprotein<br/>complex<br/>family')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'RNA<br/>processing<br/>complex<br/>family')\n", - "\n", - "RNA\n", - "processing\n", - "complex\n", - "family\n", + "\n", + "RNA\n", + "processing\n", + "complex\n", + "family\n", "\n", "\n", "\n", "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus')->('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'RNA<br/>processing<br/>complex<br/>family')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'splicosomal<br/>complex<br/>family')\n", - "\n", - "splicosomal\n", - "complex\n", - "family\n", + "\n", + "splicosomal\n", + "complex\n", + "family\n", "\n", "\n", "\n", "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus')->('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'splicosomal<br/>complex<br/>family')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'RNA<br/>processing<br/>complex<br/>family', 'RNA<br/>processing<br/>complex<br/>1')\n", - "\n", - "RNA\n", - "processing\n", - "complex\n", - "1\n", + "\n", + "RNA\n", + "processing\n", + "complex\n", + "1\n", "\n", "\n", "\n", "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'RNA<br/>processing<br/>complex<br/>family')->('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'RNA<br/>processing<br/>complex<br/>family', 'RNA<br/>processing<br/>complex<br/>1')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'RNA<br/>processing<br/>complex<br/>family', 'RNA<br/>splicing<br/>complex<br/>family')\n", - "\n", - "RNA\n", - "splicing\n", - "complex\n", - "family\n", + "\n", + "RNA\n", + "splicing\n", + "complex\n", + "family\n", "\n", "\n", "\n", "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'RNA<br/>processing<br/>complex<br/>family')->('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'RNA<br/>processing<br/>complex<br/>family', 'RNA<br/>splicing<br/>complex<br/>family')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family')\n", - "\n", - "chromosome\n", - "organization\n", - "complex\n", - "family\n", + "\n", + "chromosome\n", + "organization\n", + "complex\n", + "family\n", "\n", "\n", "\n", "('cell', 'nucleus', 'nucleo-plasm<br/>1')->('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family', 'chromatin<br/>organization<br/>complex<br/>family')\n", - "\n", - "chromatin\n", - "organization\n", - "complex\n", - "family\n", + "\n", + "chromatin\n", + "organization\n", + "complex\n", + "family\n", "\n", "\n", "\n", "('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family')->('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family', 'chromatin<br/>organization<br/>complex<br/>family')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family', 'chromatin<br/>organization<br/>complex<br/>family', 'HAT<br/>complex<br/>family')\n", - "\n", - "HAT\n", - "complex\n", - "family\n", + "\n", + "HAT\n", + "complex\n", + "family\n", "\n", "\n", "\n", "('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family', 'chromatin<br/>organization<br/>complex<br/>family')->('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family', 'chromatin<br/>organization<br/>complex<br/>family', 'HAT<br/>complex<br/>family')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family', 'chromatin<br/>organization<br/>complex<br/>family', 'HAT<br/>complex<br/>family', 'NuA4<br/>HAT<br/>complex')\n", - "\n", - "NuA4\n", - "HAT\n", - "complex\n", + "\n", + "NuA4\n", + "HAT\n", + "complex\n", "\n", "\n", "\n", "('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family', 'chromatin<br/>organization<br/>complex<br/>family', 'HAT<br/>complex<br/>family')->('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family', 'chromatin<br/>organization<br/>complex<br/>family', 'HAT<br/>complex<br/>family', 'NuA4<br/>HAT<br/>complex')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'nucleus', 'nucleo-plasm<br/>2', 'chromatin<br/>regulation<br/>complex')\n", - "\n", - "chromatin\n", - "regulation\n", - "complex\n", + "\n", + "chromatin\n", + "regulation\n", + "complex\n", "\n", "\n", "\n", "('cell', 'nucleus', 'nucleo-plasm<br/>2')->('cell', 'nucleus', 'nucleo-plasm<br/>2', 'chromatin<br/>regulation<br/>complex')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'nucleus', 'nuclear<br/>transcriptional<br/>speckle', 'negative<br/>regulation<br/>of<br/>RNA<br/>biosynthesis<br/>process')\n", - "\n", - "negative\n", - "regulation\n", - "of\n", - "RNA\n", - "biosynthesis\n", - "process\n", + "\n", + "negative\n", + "regulation\n", + "of\n", + "RNA\n", + "biosynthesis\n", + "process\n", "\n", "\n", "\n", "('cell', 'nucleus', 'nuclear<br/>transcriptional<br/>speckle')->('cell', 'nucleus', 'nuclear<br/>transcriptional<br/>speckle', 'negative<br/>regulation<br/>of<br/>RNA<br/>biosynthesis<br/>process')\n", - "\n", + "\n", "\n", "\n", "\n" ], "text/plain": [ - "" + "" ] }, "execution_count": 15, @@ -2166,777 +1875,949 @@ "tags": [] }, "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Writing out/cell_hierarchy_functions\n" + ] + }, { "data": { "image/svg+xml": [ "\n", "\n", - "\n", "\n", - "\n", - "\n", + "\n", + "\n", "bigraph\n", - "\n", + "\n", "\n", "\n", "('cell',)\n", - "\n", - "cell\n", + "\n", + "cell\n", "\n", "\n", "\n", "('cell', 'cytoplasm')\n", - "\n", - "cytoplasm\n", + "\n", + "cytoplasm\n", "\n", "\n", - "\n", + "\n", "('cell',)->('cell', 'cytoplasm')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'nucleus')\n", - "\n", - "nucleus\n", + "\n", + "nucleus\n", "\n", "\n", - "\n", + "\n", "('cell',)->('cell', 'nucleus')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'transcription')\n", - "\n", - "transcription\n", + "\n", + "transcription\n", "\n", "\n", + "\n", + "('cell',)->('cell', 'transcription')\n", + "\n", + "\n", "\n", - "\n", + "\n", "('cell', 'translation')\n", - "\n", - "translation\n", + "\n", + "translation\n", "\n", "\n", + "\n", + "('cell',)->('cell', 'translation')\n", + "\n", + "\n", "\n", - "\n", + "\n", "('cell', 'metabolism')\n", - "\n", - "metabolism\n", + "\n", + "metabolism\n", "\n", "\n", + "\n", + "('cell',)->('cell', 'metabolism')\n", + "\n", + "\n", "\n", - "\n", + "\n", "('cell', 'cell<br/>cycle')\n", - "\n", - "cell\n", - "cycle\n", + "\n", + "cell\n", + "cycle\n", "\n", "\n", + "\n", + "('cell',)->('cell', 'cell<br/>cycle')\n", + "\n", + "\n", "\n", - "\n", + "\n", "('cell', 'signalling')\n", - "\n", - "signalling\n", + "\n", + "signalling\n", "\n", "\n", + "\n", + "('cell',)->('cell', 'signalling')\n", + "\n", + "\n", "\n", - "\n", + "\n", "('cell', 'protein<br/>transport')\n", - "\n", - "protein\n", - "transport\n", + "\n", + "protein\n", + "transport\n", "\n", "\n", + "\n", + "('cell',)->('cell', 'protein<br/>transport')\n", + "\n", + "\n", "\n", - "\n", + "\n", "('cell', 'RNA<br/>processing')\n", - "\n", - "RNA\n", - "processing\n", + "\n", + "RNA\n", + "processing\n", "\n", "\n", + "\n", + "('cell',)->('cell', 'RNA<br/>processing')\n", + "\n", + "\n", "\n", "\n", "('cell', 'cytoplasm', 'secretory<br/>organelles')\n", - "\n", - "secretory\n", - "organelles\n", + "\n", + "secretory\n", + "organelles\n", "\n", "\n", "\n", "('cell', 'cytoplasm')->('cell', 'cytoplasm', 'secretory<br/>organelles')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles')\n", - "\n", - "cytoplasmic\n", - "organelles\n", + "\n", + "cytoplasmic\n", + "organelles\n", "\n", "\n", "\n", "('cell', 'cytoplasm')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'transcriptional<br/>regulation<br/>complex<br/>family')\n", - "\n", - "transcriptional\n", - "regulation\n", - "complex\n", - "family\n", + "\n", + "transcriptional\n", + "regulation\n", + "complex\n", + "family\n", "\n", "\n", "\n", "('cell', 'cytoplasm')->('cell', 'cytoplasm', 'transcriptional<br/>regulation<br/>complex<br/>family')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'secretory<br/>organelles', 'transmembrane<br/>transport<br/>systems')\n", - "\n", - "transmembrane\n", - "transport\n", - "systems\n", + "\n", + "transmembrane\n", + "transport\n", + "systems\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'secretory<br/>organelles')->('cell', 'cytoplasm', 'secretory<br/>organelles', 'transmembrane<br/>transport<br/>systems')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'secretory<br/>organelles')->('cell', 'protein<br/>transport')\n", - "\n", - "\n", - "secretory\n", + "\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'secretory<br/>organelles', 'transmembrane<br/>transport<br/>systems', 'ion<br/>transmembrane<br/>transport<br/>systems')\n", - "\n", - "ion\n", - "transmembrane\n", - "transport\n", - "systems\n", + "\n", + "ion\n", + "transmembrane\n", + "transport\n", + "systems\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'secretory<br/>organelles', 'transmembrane<br/>transport<br/>systems')->('cell', 'cytoplasm', 'secretory<br/>organelles', 'transmembrane<br/>transport<br/>systems', 'ion<br/>transmembrane<br/>transport<br/>systems')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'secretory<br/>organelles', 'transmembrane<br/>transport<br/>systems')->('cell', 'signalling')\n", - "\n", - "\n", - "transport\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'secretory<br/>organelles', 'transmembrane<br/>transport<br/>systems')->('cell', 'protein<br/>transport')\n", - "\n", - "\n", - "transmembrane\n", - "transport\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'secretory<br/>organelles', 'transmembrane<br/>transport<br/>systems', 'ion<br/>transmembrane<br/>transport<br/>systems')->('cell', 'metabolism')\n", - "\n", - "\n", - "ion\n", - "transport\n", + "\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles')\n", - "\n", - "subgroup\n", - "of\n", - "cytoplasmic\n", - "organelles\n", + "\n", + "subgroup\n", + "of\n", + "cytoplasmic\n", + "organelles\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'metabolic<br/>organelles')\n", - "\n", - "metabolic\n", - "organelles\n", + "\n", + "metabolic\n", + "organelles\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'metabolic<br/>organelles')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family')\n", - "\n", - "ribonucleoprotein\n", - "complex\n", - "family\n", + "\n", + "ribonucleoprotein\n", + "complex\n", + "family\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'metabolic<br/>organelles', 'subgroup<br/>of<br/>metabolic<br/>organelles')\n", - "\n", - "subgroup\n", - "of\n", - "metabolic\n", - "organelles\n", + "\n", + "subgroup\n", + "of\n", + "metabolic\n", + "organelles\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'metabolic<br/>organelles')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'metabolic<br/>organelles', 'subgroup<br/>of<br/>metabolic<br/>organelles')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'metabolic<br/>organelles', 'mitochondrion')\n", - "\n", - "mitochondrion\n", + "\n", + "mitochondrion\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'metabolic<br/>organelles')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'metabolic<br/>organelles', 'mitochondrion')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'metabolic<br/>organelles')->('cell', 'metabolism')\n", - "\n", - "\n", - "organelles\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'metabolic<br/>organelles', 'mitochondrion')->('cell', 'metabolism')\n", - "\n", - "\n", - "mitochondrion\n", + "\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'RNA<br/>processing<br/>complex<br/>1')\n", - "\n", - "RNA\n", - "processing\n", - "complex\n", - "1\n", + "\n", + "RNA\n", + "processing\n", + "complex\n", + "1\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'RNA<br/>processing<br/>complex<br/>1')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community')\n", - "\n", - "ribosome\n", - "biogenesis\n", - "community\n", + "\n", + "ribosome\n", + "biogenesis\n", + "community\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'RNA<br/>processing<br/>complex<br/>1', 'RNA<br/>splicing<br/>complex<br/>1')\n", - "\n", - "RNA\n", - "splicing\n", - "complex\n", - "1\n", + "\n", + "RNA\n", + "splicing\n", + "complex\n", + "1\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'RNA<br/>processing<br/>complex<br/>1')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'RNA<br/>processing<br/>complex<br/>1', 'RNA<br/>splicing<br/>complex<br/>1')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome')\n", - "\n", - "ribosome\n", + "\n", + "ribosome\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'nucleic<br/>acid<br/>binding<br/>complex')\n", - "\n", - "nucleic\n", - "acid\n", - "binding\n", - "complex\n", + "\n", + "nucleic\n", + "acid\n", + "binding\n", + "complex\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'nucleic<br/>acid<br/>binding<br/>complex')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit')\n", - "\n", - "ribosomal\n", - "subunit\n", + "\n", + "ribosomal\n", + "subunit\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome')->('cell', 'translation')\n", - "\n", - "\n", - "ribosomes\n", + "\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'mitochondirial<br/>large<br/>ribosomal<br/>subunit')\n", - "\n", - "mitochondirial\n", - "large\n", - "ribosomal\n", - "subunit\n", + "\n", + "mitochondirial\n", + "large\n", + "ribosomal\n", + "subunit\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'mitochondirial<br/>large<br/>ribosomal<br/>subunit')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'mito-cyto<br/>ribosomal<br/>cluster')\n", - "\n", - "mito-cyto\n", - "ribosomal\n", - "cluster\n", + "\n", + "mito-cyto\n", + "ribosomal\n", + "cluster\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'mito-cyto<br/>ribosomal<br/>cluster')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'cotranslational<br/>protein<br/>targeting<br/>to<br/>membrane<br/>system')\n", - "\n", - "cotranslational\n", - "protein\n", - "targeting\n", - "to\n", - "membrane\n", - "system\n", + "\n", + "cotranslational\n", + "protein\n", + "targeting\n", + "to\n", + "membrane\n", + "system\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'cotranslational<br/>protein<br/>targeting<br/>to<br/>membrane<br/>system')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'ribosomal<br/>complex<br/>5')\n", - "\n", - "ribosomal\n", - "complex\n", - "5\n", + "\n", + "ribosomal\n", + "complex\n", + "5\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'ribosomal<br/>complex<br/>5')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'ribosomal<br/>complex<br/>2')\n", - "\n", - "ribosomal\n", - "complex\n", - "2\n", + "\n", + "ribosomal\n", + "complex\n", + "2\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'ribosomal<br/>complex<br/>2')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'cotranslational<br/>protein<br/>targeting<br/>to<br/>membrane<br/>system')->('cell', 'protein<br/>transport')\n", - "\n", - "\n", - "cotranslation\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'nucleic<br/>acid<br/>binding<br/>complex')->('cell', 'transcription')\n", - "\n", - "\n", - "nucleic\n", - "acids\n", + "\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'transcriptional<br/>regulation<br/>complex<br/>family', 'transcriptional<br/>regulation<br/>complexes')\n", - "\n", - "transcriptional\n", - "regulation\n", - "complexes\n", + "\n", + "transcriptional\n", + "regulation\n", + "complexes\n", "\n", "\n", "\n", "('cell', 'cytoplasm', 'transcriptional<br/>regulation<br/>complex<br/>family')->('cell', 'cytoplasm', 'transcriptional<br/>regulation<br/>complex<br/>family', 'transcriptional<br/>regulation<br/>complexes')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'transcriptional<br/>regulation<br/>complex<br/>family', 'transcriptional<br/>regulation<br/>complexes')->('cell', 'transcription')\n", - "\n", - "\n", - "regulation\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'transcriptional<br/>regulation<br/>complex<br/>family', 'transcriptional<br/>regulation<br/>complexes')->('cell', 'signalling')\n", - "\n", - "\n", - "trancript\n", - "regulation\n", + "\n", "\n", "\n", "\n", "('cell', 'nucleus', 'DNA<br/>metabolic<br/>assembly')\n", - "\n", - "DNA\n", - "metabolic\n", - "assembly\n", + "\n", + "DNA\n", + "metabolic\n", + "assembly\n", "\n", "\n", "\n", "('cell', 'nucleus')->('cell', 'nucleus', 'DNA<br/>metabolic<br/>assembly')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'nucleus', 'nuclear<br/>lumen')\n", - "\n", - "nuclear\n", - "lumen\n", + "\n", + "nuclear\n", + "lumen\n", "\n", "\n", "\n", "('cell', 'nucleus')->('cell', 'nucleus', 'nuclear<br/>lumen')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'nucleus', 'nuclear<br/>body')\n", - "\n", - "nuclear\n", - "body\n", + "\n", + "nuclear\n", + "body\n", "\n", "\n", "\n", "('cell', 'nucleus')->('cell', 'nucleus', 'nuclear<br/>body')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'nucleus', 'nucleo-plasm<br/>1')\n", - "\n", - "nucleo-plasm\n", - "1\n", + "\n", + "nucleo-plasm\n", + "1\n", "\n", "\n", "\n", "('cell', 'nucleus')->('cell', 'nucleus', 'nucleo-plasm<br/>1')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'nucleus', 'nucleo-plasm<br/>2')\n", - "\n", - "nucleo-plasm\n", - "2\n", + "\n", + "nucleo-plasm\n", + "2\n", "\n", "\n", "\n", "('cell', 'nucleus')->('cell', 'nucleus', 'nucleo-plasm<br/>2')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'nucleus', 'nuclear<br/>transcriptional<br/>speckle')\n", - "\n", - "nuclear\n", - "transcriptional\n", - "speckle\n", + "\n", + "nuclear\n", + "transcriptional\n", + "speckle\n", "\n", "\n", "\n", "('cell', 'nucleus')->('cell', 'nucleus', 'nuclear<br/>transcriptional<br/>speckle')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'DNA<br/>metabolic<br/>assembly')->('cell', 'cell<br/>cycle')\n", - "\n", - "\n", - "DNA\n", + "\n", "\n", "\n", "\n", "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus')\n", - "\n", - "nucleolus\n", + "\n", + "nucleolus\n", "\n", "\n", "\n", "('cell', 'nucleus', 'nuclear<br/>lumen')->('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'nucleus', 'nuclear<br/>lumen', 'nuclear<br/>splicing<br/>speckle')\n", - "\n", - "nuclear\n", - "splicing\n", - "speckle\n", + "\n", + "nuclear\n", + "splicing\n", + "speckle\n", "\n", "\n", "\n", "('cell', 'nucleus', 'nuclear<br/>lumen')->('cell', 'nucleus', 'nuclear<br/>lumen', 'nuclear<br/>splicing<br/>speckle')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'ribonucleprotein<br/>complex<br/>family')\n", - "\n", - "ribonucleprotein\n", - "complex\n", - "family\n", + "\n", + "ribonucleprotein\n", + "complex\n", + "family\n", "\n", "\n", "\n", "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus')->('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'ribonucleprotein<br/>complex<br/>family')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'RNA<br/>processing<br/>complex<br/>family')\n", - "\n", - "RNA\n", - "processing\n", - "complex\n", - "family\n", + "\n", + "RNA\n", + "processing\n", + "complex\n", + "family\n", "\n", "\n", "\n", "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus')->('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'RNA<br/>processing<br/>complex<br/>family')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'splicosomal<br/>complex<br/>family')\n", - "\n", - "splicosomal\n", - "complex\n", - "family\n", + "\n", + "splicosomal\n", + "complex\n", + "family\n", "\n", "\n", "\n", "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus')->('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'splicosomal<br/>complex<br/>family')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'RNA<br/>processing<br/>complex<br/>family', 'RNA<br/>processing<br/>complex<br/>1')\n", - "\n", - "RNA\n", - "processing\n", - "complex\n", - "1\n", + "\n", + "RNA\n", + "processing\n", + "complex\n", + "1\n", "\n", "\n", "\n", "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'RNA<br/>processing<br/>complex<br/>family')->('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'RNA<br/>processing<br/>complex<br/>family', 'RNA<br/>processing<br/>complex<br/>1')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'RNA<br/>processing<br/>complex<br/>family', 'RNA<br/>splicing<br/>complex<br/>family')\n", - "\n", - "RNA\n", - "splicing\n", - "complex\n", - "family\n", + "\n", + "RNA\n", + "splicing\n", + "complex\n", + "family\n", "\n", "\n", "\n", "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'RNA<br/>processing<br/>complex<br/>family')->('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'RNA<br/>processing<br/>complex<br/>family', 'RNA<br/>splicing<br/>complex<br/>family')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'RNA<br/>processing<br/>complex<br/>family')->('cell', 'transcription')\n", - "\n", - "\n", - "RNA\n", - "processing\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'RNA<br/>processing<br/>complex<br/>family')->('cell', 'RNA<br/>processing')\n", - "\n", - "\n", - "processing\n", - "complex\n", + "\n", "\n", "\n", "\n", "('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family')\n", - "\n", - "chromosome\n", - "organization\n", - "complex\n", - "family\n", + "\n", + "chromosome\n", + "organization\n", + "complex\n", + "family\n", "\n", "\n", "\n", "('cell', 'nucleus', 'nucleo-plasm<br/>1')->('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family', 'chromatin<br/>organization<br/>complex<br/>family')\n", - "\n", - "chromatin\n", - "organization\n", - "complex\n", - "family\n", + "\n", + "chromatin\n", + "organization\n", + "complex\n", + "family\n", "\n", "\n", "\n", "('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family')->('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family', 'chromatin<br/>organization<br/>complex<br/>family')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family')->('cell', 'cell<br/>cycle')\n", - "\n", - "\n", - "chromosome\n", + "\n", "\n", "\n", "\n", "('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family', 'chromatin<br/>organization<br/>complex<br/>family', 'HAT<br/>complex<br/>family')\n", - "\n", - "HAT\n", - "complex\n", - "family\n", + "\n", + "HAT\n", + "complex\n", + "family\n", "\n", "\n", "\n", "('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family', 'chromatin<br/>organization<br/>complex<br/>family')->('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family', 'chromatin<br/>organization<br/>complex<br/>family', 'HAT<br/>complex<br/>family')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family', 'chromatin<br/>organization<br/>complex<br/>family')->('cell', 'cell<br/>cycle')\n", - "\n", - "\n", - "chromatin\n", + "\n", "\n", "\n", "\n", "('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family', 'chromatin<br/>organization<br/>complex<br/>family', 'HAT<br/>complex<br/>family', 'NuA4<br/>HAT<br/>complex')\n", - "\n", - "NuA4\n", - "HAT\n", - "complex\n", + "\n", + "NuA4\n", + "HAT\n", + "complex\n", "\n", "\n", "\n", "('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family', 'chromatin<br/>organization<br/>complex<br/>family', 'HAT<br/>complex<br/>family')->('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family', 'chromatin<br/>organization<br/>complex<br/>family', 'HAT<br/>complex<br/>family', 'NuA4<br/>HAT<br/>complex')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'nucleus', 'nucleo-plasm<br/>2', 'chromatin<br/>regulation<br/>complex')\n", - "\n", - "chromatin\n", - "regulation\n", - "complex\n", + "\n", + "chromatin\n", + "regulation\n", + "complex\n", "\n", "\n", "\n", "('cell', 'nucleus', 'nucleo-plasm<br/>2')->('cell', 'nucleus', 'nucleo-plasm<br/>2', 'chromatin<br/>regulation<br/>complex')\n", - "\n", + "\n", "\n", "\n", "\n", "('cell', 'nucleus', 'nuclear<br/>transcriptional<br/>speckle', 'negative<br/>regulation<br/>of<br/>RNA<br/>biosynthesis<br/>process')\n", - "\n", - "negative\n", - "regulation\n", - "of\n", - "RNA\n", - "biosynthesis\n", - "process\n", + "\n", + "negative\n", + "regulation\n", + "of\n", + "RNA\n", + "biosynthesis\n", + "process\n", "\n", "\n", "\n", "('cell', 'nucleus', 'nuclear<br/>transcriptional<br/>speckle')->('cell', 'nucleus', 'nuclear<br/>transcriptional<br/>speckle', 'negative<br/>regulation<br/>of<br/>RNA<br/>biosynthesis<br/>process')\n", - "\n", + "\n", "\n", - "\n", + "\n", + "\n", + "('cell', 'transcription', 'outputs')\n", + "\n", + "outputs\n", + "\n", + "\n", + "\n", + "('cell', 'transcription')->('cell', 'transcription', 'outputs')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'transcription', 'outputs', 'RNA<br/>processing')\n", + "\n", + "RNA\n", + "processing\n", + "\n", + "\n", + "\n", + "('cell', 'transcription', 'outputs')->('cell', 'transcription', 'outputs', 'RNA<br/>processing')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'transcription', 'outputs', 'regulation')\n", + "\n", + "regulation\n", + "\n", + "\n", + "\n", + "('cell', 'transcription', 'outputs')->('cell', 'transcription', 'outputs', 'regulation')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'transcription', 'outputs', 'nucleic<br/>acids')\n", + "\n", + "nucleic\n", + "acids\n", + "\n", + "\n", + "\n", + "('cell', 'transcription', 'outputs')->('cell', 'transcription', 'outputs', 'nucleic<br/>acids')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'transcription', 'outputs', 'negative<br/>regulation')\n", + "\n", + "negative\n", + "regulation\n", + "\n", + "\n", + "\n", + "('cell', 'transcription', 'outputs')->('cell', 'transcription', 'outputs', 'negative<br/>regulation')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'translation', 'outputs')\n", + "\n", + "outputs\n", + "\n", + "\n", + "\n", + "('cell', 'translation')->('cell', 'translation', 'outputs')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'translation', 'outputs', 'ribosomes')\n", + "\n", + "ribosomes\n", + "\n", + "\n", + "\n", + "('cell', 'translation', 'outputs')->('cell', 'translation', 'outputs', 'ribosomes')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'metabolism', 'outputs')\n", + "\n", + "outputs\n", + "\n", + "\n", + "\n", + "('cell', 'metabolism')->('cell', 'metabolism', 'outputs')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'metabolism', 'outputs', 'organelles')\n", + "\n", + "organelles\n", + "\n", + "\n", + "\n", + "('cell', 'metabolism', 'outputs')->('cell', 'metabolism', 'outputs', 'organelles')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'metabolism', 'outputs', 'mitochondrion')\n", + "\n", + "mitochondrion\n", + "\n", + "\n", + "\n", + "('cell', 'metabolism', 'outputs')->('cell', 'metabolism', 'outputs', 'mitochondrion')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'metabolism', 'outputs', 'ion<br/>transport')\n", + "\n", + "ion\n", + "transport\n", + "\n", + "\n", + "\n", + "('cell', 'metabolism', 'outputs')->('cell', 'metabolism', 'outputs', 'ion<br/>transport')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'cell<br/>cycle', 'outputs')\n", + "\n", + "outputs\n", + "\n", + "\n", + "\n", + "('cell', 'cell<br/>cycle')->('cell', 'cell<br/>cycle', 'outputs')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'cell<br/>cycle', 'outputs', 'DNA')\n", + "\n", + "DNA\n", + "\n", + "\n", + "\n", + "('cell', 'cell<br/>cycle', 'outputs')->('cell', 'cell<br/>cycle', 'outputs', 'DNA')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'cell<br/>cycle', 'outputs', 'chromosome')\n", + "\n", + "chromosome\n", + "\n", + "\n", "\n", - "('cell', 'nucleus', 'nuclear<br/>transcriptional<br/>speckle', 'negative<br/>regulation<br/>of<br/>RNA<br/>biosynthesis<br/>process')->('cell', 'transcription')\n", - "\n", - "\n", - "negative\n", - "regulation\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'translation', 'membrane')->('cell', 'translation')\n", - "\n", - "\n", - "membrane\n", + "('cell', 'cell<br/>cycle', 'outputs')->('cell', 'cell<br/>cycle', 'outputs', 'chromosome')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'cell<br/>cycle', 'outputs', 'chromatin')\n", + "\n", + "chromatin\n", + "\n", + "\n", + "\n", + "('cell', 'cell<br/>cycle', 'outputs')->('cell', 'cell<br/>cycle', 'outputs', 'chromatin')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'signalling', 'outputs')\n", + "\n", + "outputs\n", + "\n", + "\n", + "\n", + "('cell', 'signalling')->('cell', 'signalling', 'outputs')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'signalling', 'outputs', 'transport')\n", + "\n", + "transport\n", + "\n", + "\n", + "\n", + "('cell', 'signalling', 'outputs')->('cell', 'signalling', 'outputs', 'transport')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'signalling', 'outputs', 'trancript<br/>regulation')\n", + "\n", + "trancript\n", + "regulation\n", + "\n", + "\n", + "\n", + "('cell', 'signalling', 'outputs')->('cell', 'signalling', 'outputs', 'trancript<br/>regulation')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'protein<br/>transport', 'outputs')\n", + "\n", + "outputs\n", + "\n", + "\n", + "\n", + "('cell', 'protein<br/>transport')->('cell', 'protein<br/>transport', 'outputs')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'protein<br/>transport', 'outputs', 'transmembrane<br/>transport')\n", + "\n", + "transmembrane\n", + "transport\n", + "\n", + "\n", + "\n", + "('cell', 'protein<br/>transport', 'outputs')->('cell', 'protein<br/>transport', 'outputs', 'transmembrane<br/>transport')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'protein<br/>transport', 'outputs', 'secretory')\n", + "\n", + "secretory\n", + "\n", + "\n", + "\n", + "('cell', 'protein<br/>transport', 'outputs')->('cell', 'protein<br/>transport', 'outputs', 'secretory')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'protein<br/>transport', 'outputs', 'cotranslation')\n", + "\n", + "cotranslation\n", + "\n", + "\n", + "\n", + "('cell', 'protein<br/>transport', 'outputs')->('cell', 'protein<br/>transport', 'outputs', 'cotranslation')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'RNA<br/>processing', 'outputs')\n", + "\n", + "outputs\n", + "\n", + "\n", + "\n", + "('cell', 'RNA<br/>processing')->('cell', 'RNA<br/>processing', 'outputs')\n", + "\n", + "\n", + "\n", + "\n", + "('cell', 'RNA<br/>processing', 'outputs', 'processing<br/>complex')\n", + "\n", + "processing\n", + "complex\n", + "\n", + "\n", + "\n", + "('cell', 'RNA<br/>processing', 'outputs')->('cell', 'RNA<br/>processing', 'outputs', 'processing<br/>complex')\n", + "\n", "\n", "\n", "\n" ], "text/plain": [ - "" + "" ] }, "execution_count": 17, @@ -2948,13 +2829,13 @@ "import copy\n", "\n", "transcription_process = {\n", - " '_ports': {\n", + " '_outputs': {\n", " 'RNA processing': 'Any',\n", " 'regulation': 'Any',\n", " 'nucleic acids': 'Any',\n", " 'negative regulation': 'Any'\n", " },\n", - " 'wires': {\n", + " 'outputs': {\n", " 'RNA processing': [\n", " 'nucleus', 'nuclear lumen', 'nucleolus', 'RNA processing complex family'],\n", " 'regulation': [\n", @@ -2968,11 +2849,11 @@ "}\n", "\n", "translation_process = {\n", - " '_ports': {\n", + " '_outputs': {\n", " 'ribosomes': 'Any',\n", " 'membrane': 'Any'\n", " },\n", - " 'wires': {\n", + " 'outputs': {\n", " 'ribosomes': [\n", " 'cytoplasm', 'cytoplasmic organelles', 'subgroup of cytoplasmic organelles', 'ribonucleoprotein complex family', 'ribosome biogenesis community', 'ribosome'],\n", " # 'membrane': ['],\n", @@ -2980,12 +2861,12 @@ "}\n", "\n", "metabolism_process = {\n", - " '_ports': {\n", + " '_outputs': {\n", " 'organelles': 'Any',\n", " 'mitochondrion': 'Any',\n", " 'ion transport': 'Any',\n", " },\n", - " 'wires': {\n", + " 'outputs': {\n", " 'organelles': [\n", " 'cytoplasm', 'cytoplasmic organelles', 'subgroup of cytoplasmic organelles', 'metabolic organelles', ],\n", " 'mitochondrion': [\n", @@ -2996,12 +2877,12 @@ "}\n", "\n", "cell_cycle_process = {\n", - " '_ports': {\n", + " '_outputs': {\n", " 'DNA': 'Any',\n", " 'chromosome': 'Any',\n", " 'chromatin': 'Any',\n", " },\n", - " 'wires': { \n", + " 'outputs': { \n", " 'DNA': ['nucleus', 'DNA metabolic assembly'],\n", " 'chromosome': ['nucleus', 'nucleo-plasm 1', 'chromosome organization complex family',],\n", " 'chromatin': ['nucleus', 'nucleo-plasm 1', 'chromosome organization complex family', 'chromatin organization complex family'],\n", @@ -3009,11 +2890,11 @@ "}\n", "\n", "signalling_process = {\n", - " '_ports': {\n", + " '_outputs': {\n", " 'transport': 'Any',\n", " 'trancript regulation': 'Any',\n", " },\n", - " 'wires': { \n", + " 'outputs': { \n", " 'transport': [\n", " 'cytoplasm', 'secretory organelles', 'transmembrane transport systems'],\n", " 'trancript regulation': [\n", @@ -3022,12 +2903,12 @@ "}\n", "\n", "protein_transport_process = {\n", - " '_ports': {\n", + " '_outputs': {\n", " 'transmembrane transport': 'Any',\n", " 'secretory': 'Any',\n", " 'cotranslation': 'Any',\n", " },\n", - " 'wires': { \n", + " 'outputs': { \n", " 'transmembrane transport': [\n", " 'cytoplasm', 'secretory organelles', 'transmembrane transport systems'],\n", " 'secretory': [\n", @@ -3039,10 +2920,10 @@ "}\n", "\n", "rna_processing_process = {\n", - " '_ports': {\n", + " '_outputs': {\n", " 'processing complex': 'Any',\n", " },\n", - " 'wires': { \n", + " 'outputs': { \n", " 'processing complex': [\n", " 'nucleus', 'nuclear lumen', 'nucleolus', 'RNA processing complex family'],\n", " }\n", @@ -3083,46 +2964,39 @@ "tags": [] }, "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Writing out/hypothesized_mechanism\n" + ] + }, { "data": { "image/svg+xml": [ "\n", "\n", - "\n", "\n", - "\n", - "\n", + "\n", + "\n", "bigraph\n", - "\n", + "\n", "\n", "\n", "('hypothesized<br/>mechanism',)\n", - "\n", - "hypothesized\n", - "mechanism\n", - "\n", - "\n", - "\n", - "\n", - "('hypothesized<br/>mechanism', '1')->('hypothesized<br/>mechanism',)\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "('hypothesized<br/>mechanism', '2')->('hypothesized<br/>mechanism',)\n", - "\n", - "\n", + "\n", + "hypothesized\n", + "mechanism\n", "\n", "\n", "\n" ], "text/plain": [ - "" + "" ] }, "execution_count": 18, @@ -3170,213 +3044,35 @@ }, "outputs": [ { - "name": "stdout", - "output_type": "stream", - "text": [ - "Writing out/cell\n" + "ename": "RecursionError", + "evalue": "maximum recursion depth exceeded while calling a Python object", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mRecursionError\u001b[0m Traceback (most recent call last)", + "Cell \u001b[0;32mIn[19], line 52\u001b[0m\n\u001b[1;32m 50\u001b[0m core\u001b[38;5;241m.\u001b[39mregister(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mconcentrations\u001b[39m\u001b[38;5;124m'\u001b[39m, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mfloat\u001b[39m\u001b[38;5;124m'\u001b[39m)\n\u001b[1;32m 51\u001b[0m cell_struct_func2 \u001b[38;5;241m=\u001b[39m replace_regex_recursive(cell_struct_func)\n\u001b[0;32m---> 52\u001b[0m \u001b[43mplot_bigraph\u001b[49m\u001b[43m(\u001b[49m\u001b[43mcell_struct_func2\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mcore\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mcore\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mremove_process_place_edges\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43;01mTrue\u001b[39;49;00m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mout_dir\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mout\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mfilename\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mcell\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m~/code/bigraph-viz/bigraph_viz/diagram.py:410\u001b[0m, in \u001b[0;36mplot_bigraph\u001b[0;34m(state, schema, core, out_dir, filename, file_format, size, node_label_size, show_values, show_types, port_labels, port_label_size, rankdir, print_source, dpi, label_margin, node_border_colors, node_fill_colors, node_groups, remove_nodes, invisible_edges, remove_process_place_edges)\u001b[0m\n\u001b[1;32m 407\u001b[0m schema, state \u001b[38;5;241m=\u001b[39m core\u001b[38;5;241m.\u001b[39mcomplete(schema, state)\n\u001b[1;32m 409\u001b[0m \u001b[38;5;66;03m# parse out the network\u001b[39;00m\n\u001b[0;32m--> 410\u001b[0m graph_dict \u001b[38;5;241m=\u001b[39m \u001b[43mget_graph_dict\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 411\u001b[0m \u001b[43m \u001b[49m\u001b[43mschema\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mschema\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 412\u001b[0m \u001b[43m \u001b[49m\u001b[43mstate\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mstate\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 413\u001b[0m \u001b[43m \u001b[49m\u001b[43mcore\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mcore\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 414\u001b[0m \u001b[43m \u001b[49m\u001b[43mremove_nodes\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mremove_nodes\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 415\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 417\u001b[0m \u001b[38;5;66;03m# make a figure\u001b[39;00m\n\u001b[1;32m 418\u001b[0m graph \u001b[38;5;241m=\u001b[39m get_graphviz_fig(graph_dict, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n", + "File \u001b[0;32m~/code/bigraph-viz/bigraph_viz/diagram.py:176\u001b[0m, in \u001b[0;36mget_graph_dict\u001b[0;34m(schema, state, core, graph_dict, path, top_state, retain_type_keys, retain_process_keys, remove_nodes)\u001b[0m\n\u001b[1;32m 173\u001b[0m removed_process_schema_keys \u001b[38;5;241m=\u001b[39m [subpath \u001b[38;5;241m+\u001b[39m (schema_key,) \u001b[38;5;28;01mfor\u001b[39;00m schema_key \u001b[38;5;129;01min\u001b[39;00m PROCESS_SCHEMA_KEYS]\n\u001b[1;32m 174\u001b[0m remove_nodes\u001b[38;5;241m.\u001b[39mextend(removed_process_schema_keys)\n\u001b[0;32m--> 176\u001b[0m graph_dict \u001b[38;5;241m=\u001b[39m \u001b[43mget_graph_dict\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 177\u001b[0m \u001b[43m \u001b[49m\u001b[43mschema\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mschema\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget\u001b[49m\u001b[43m(\u001b[49m\u001b[43mkey\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mschema\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 178\u001b[0m \u001b[43m \u001b[49m\u001b[43mstate\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mvalue\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 179\u001b[0m \u001b[43m \u001b[49m\u001b[43mcore\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mcore\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 180\u001b[0m \u001b[43m \u001b[49m\u001b[43mgraph_dict\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mgraph_dict\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 181\u001b[0m \u001b[43m \u001b[49m\u001b[43mpath\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43msubpath\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 182\u001b[0m \u001b[43m \u001b[49m\u001b[43mtop_state\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mtop_state\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 183\u001b[0m \u001b[43m \u001b[49m\u001b[43mremove_nodes\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mremove_nodes\u001b[49m\n\u001b[1;32m 184\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 186\u001b[0m \u001b[38;5;66;03m# get the place edge\u001b[39;00m\n\u001b[1;32m 187\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m node \u001b[38;5;129;01min\u001b[39;00m value\u001b[38;5;241m.\u001b[39mkeys():\n", + "File \u001b[0;32m~/code/bigraph-viz/bigraph_viz/diagram.py:176\u001b[0m, in \u001b[0;36mget_graph_dict\u001b[0;34m(schema, state, core, graph_dict, path, top_state, retain_type_keys, retain_process_keys, remove_nodes)\u001b[0m\n\u001b[1;32m 173\u001b[0m removed_process_schema_keys \u001b[38;5;241m=\u001b[39m [subpath \u001b[38;5;241m+\u001b[39m (schema_key,) \u001b[38;5;28;01mfor\u001b[39;00m schema_key \u001b[38;5;129;01min\u001b[39;00m PROCESS_SCHEMA_KEYS]\n\u001b[1;32m 174\u001b[0m remove_nodes\u001b[38;5;241m.\u001b[39mextend(removed_process_schema_keys)\n\u001b[0;32m--> 176\u001b[0m graph_dict \u001b[38;5;241m=\u001b[39m \u001b[43mget_graph_dict\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 177\u001b[0m \u001b[43m \u001b[49m\u001b[43mschema\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mschema\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget\u001b[49m\u001b[43m(\u001b[49m\u001b[43mkey\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mschema\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 178\u001b[0m \u001b[43m \u001b[49m\u001b[43mstate\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mvalue\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 179\u001b[0m \u001b[43m \u001b[49m\u001b[43mcore\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mcore\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 180\u001b[0m \u001b[43m \u001b[49m\u001b[43mgraph_dict\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mgraph_dict\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 181\u001b[0m \u001b[43m \u001b[49m\u001b[43mpath\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43msubpath\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 182\u001b[0m \u001b[43m \u001b[49m\u001b[43mtop_state\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mtop_state\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 183\u001b[0m \u001b[43m \u001b[49m\u001b[43mremove_nodes\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mremove_nodes\u001b[49m\n\u001b[1;32m 184\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 186\u001b[0m \u001b[38;5;66;03m# get the place edge\u001b[39;00m\n\u001b[1;32m 187\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m node \u001b[38;5;129;01min\u001b[39;00m value\u001b[38;5;241m.\u001b[39mkeys():\n", + " \u001b[0;31m[... skipping similar frames: get_graph_dict at line 176 (2954 times)]\u001b[0m\n", + "File \u001b[0;32m~/code/bigraph-viz/bigraph_viz/diagram.py:176\u001b[0m, in \u001b[0;36mget_graph_dict\u001b[0;34m(schema, state, core, graph_dict, path, top_state, retain_type_keys, retain_process_keys, remove_nodes)\u001b[0m\n\u001b[1;32m 173\u001b[0m removed_process_schema_keys \u001b[38;5;241m=\u001b[39m [subpath \u001b[38;5;241m+\u001b[39m (schema_key,) \u001b[38;5;28;01mfor\u001b[39;00m schema_key \u001b[38;5;129;01min\u001b[39;00m PROCESS_SCHEMA_KEYS]\n\u001b[1;32m 174\u001b[0m remove_nodes\u001b[38;5;241m.\u001b[39mextend(removed_process_schema_keys)\n\u001b[0;32m--> 176\u001b[0m graph_dict \u001b[38;5;241m=\u001b[39m \u001b[43mget_graph_dict\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 177\u001b[0m \u001b[43m \u001b[49m\u001b[43mschema\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mschema\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget\u001b[49m\u001b[43m(\u001b[49m\u001b[43mkey\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mschema\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 178\u001b[0m \u001b[43m \u001b[49m\u001b[43mstate\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mvalue\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 179\u001b[0m \u001b[43m \u001b[49m\u001b[43mcore\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mcore\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 180\u001b[0m \u001b[43m \u001b[49m\u001b[43mgraph_dict\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mgraph_dict\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 181\u001b[0m \u001b[43m \u001b[49m\u001b[43mpath\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43msubpath\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 182\u001b[0m \u001b[43m \u001b[49m\u001b[43mtop_state\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mtop_state\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 183\u001b[0m \u001b[43m \u001b[49m\u001b[43mremove_nodes\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mremove_nodes\u001b[49m\n\u001b[1;32m 184\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 186\u001b[0m \u001b[38;5;66;03m# get the place edge\u001b[39;00m\n\u001b[1;32m 187\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m node \u001b[38;5;129;01min\u001b[39;00m value\u001b[38;5;241m.\u001b[39mkeys():\n", + "File \u001b[0;32m~/code/bigraph-viz/bigraph_viz/diagram.py:141\u001b[0m, in \u001b[0;36mget_graph_dict\u001b[0;34m(schema, state, core, graph_dict, path, top_state, retain_type_keys, retain_process_keys, remove_nodes)\u001b[0m\n\u001b[1;32m 132\u001b[0m \u001b[38;5;28;01mcontinue\u001b[39;00m\n\u001b[1;32m 134\u001b[0m node_spec \u001b[38;5;241m=\u001b[39m {\n\u001b[1;32m 135\u001b[0m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mname\u001b[39m\u001b[38;5;124m'\u001b[39m: key,\n\u001b[1;32m 136\u001b[0m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mpath\u001b[39m\u001b[38;5;124m'\u001b[39m: subpath,\n\u001b[1;32m 137\u001b[0m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mvalue\u001b[39m\u001b[38;5;124m'\u001b[39m: \u001b[38;5;28;01mNone\u001b[39;00m,\n\u001b[1;32m 138\u001b[0m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mtype\u001b[39m\u001b[38;5;124m'\u001b[39m: \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[1;32m 139\u001b[0m }\n\u001b[0;32m--> 141\u001b[0m is_edge \u001b[38;5;241m=\u001b[39m \u001b[43mcore\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcheck\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43medge\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mvalue\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 142\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m is_edge: \u001b[38;5;66;03m# this is a process/edge node\u001b[39;00m\n\u001b[1;32m 143\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m key \u001b[38;5;129;01min\u001b[39;00m PROCESS_SCHEMA_KEYS \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m retain_process_keys:\n", + "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:469\u001b[0m, in \u001b[0;36mTypeSystem.check\u001b[0;34m(self, initial_schema, state)\u001b[0m\n\u001b[1;32m 467\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m schema \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m 468\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mException\u001b[39;00m(\u001b[38;5;124mf\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mno type registered for the given schema: \u001b[39m\u001b[38;5;132;01m{\u001b[39;00minitial_schema\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m'\u001b[39m)\n\u001b[0;32m--> 469\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcheck_state\u001b[49m\u001b[43m(\u001b[49m\u001b[43mschema\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mstate\u001b[49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:440\u001b[0m, in \u001b[0;36mTypeSystem.check_state\u001b[0;34m(self, schema, state)\u001b[0m\n\u001b[1;32m 436\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124m_check\u001b[39m\u001b[38;5;124m'\u001b[39m \u001b[38;5;129;01min\u001b[39;00m schema \u001b[38;5;129;01mand\u001b[39;00m schema[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m_check\u001b[39m\u001b[38;5;124m'\u001b[39m] \u001b[38;5;241m!=\u001b[39m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124many\u001b[39m\u001b[38;5;124m'\u001b[39m:\n\u001b[1;32m 437\u001b[0m check_function \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mtype_registry\u001b[38;5;241m.\u001b[39mcheck_registry\u001b[38;5;241m.\u001b[39maccess(\n\u001b[1;32m 438\u001b[0m schema[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m_check\u001b[39m\u001b[38;5;124m'\u001b[39m])\n\u001b[0;32m--> 440\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mcheck_function\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 441\u001b[0m \u001b[43m \u001b[49m\u001b[43mstate\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 442\u001b[0m \u001b[43m \u001b[49m\u001b[43mschema\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 443\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m)\u001b[49m\n\u001b[1;32m 445\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(state, \u001b[38;5;28mdict\u001b[39m):\n\u001b[1;32m 446\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m key, branch \u001b[38;5;129;01min\u001b[39;00m state\u001b[38;5;241m.\u001b[39mitems():\n", + "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:1791\u001b[0m, in \u001b[0;36mcheck_edge\u001b[0;34m(state, schema, core)\u001b[0m\n\u001b[1;32m 1790\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mcheck_edge\u001b[39m(state, schema, core):\n\u001b[0;32m-> 1791\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(state, \u001b[38;5;28mdict\u001b[39m) \u001b[38;5;129;01mand\u001b[39;00m check_ports(state, core, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124minputs\u001b[39m\u001b[38;5;124m'\u001b[39m) \u001b[38;5;129;01mand\u001b[39;00m \u001b[43mcheck_ports\u001b[49m\u001b[43m(\u001b[49m\u001b[43mstate\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mcore\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43moutputs\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:1785\u001b[0m, in \u001b[0;36mcheck_ports\u001b[0;34m(state, core, key)\u001b[0m\n\u001b[1;32m 1784\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mcheck_ports\u001b[39m(state, core, key):\n\u001b[0;32m-> 1785\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m key \u001b[38;5;129;01min\u001b[39;00m state \u001b[38;5;129;01mand\u001b[39;00m \u001b[43mcore\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcheck\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 1786\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mwires\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1787\u001b[0m \u001b[43m \u001b[49m\u001b[43mstate\u001b[49m\u001b[43m[\u001b[49m\u001b[43mkey\u001b[49m\u001b[43m]\u001b[49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:469\u001b[0m, in \u001b[0;36mTypeSystem.check\u001b[0;34m(self, initial_schema, state)\u001b[0m\n\u001b[1;32m 467\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m schema \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m 468\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mException\u001b[39;00m(\u001b[38;5;124mf\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mno type registered for the given schema: \u001b[39m\u001b[38;5;132;01m{\u001b[39;00minitial_schema\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m'\u001b[39m)\n\u001b[0;32m--> 469\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcheck_state\u001b[49m\u001b[43m(\u001b[49m\u001b[43mschema\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mstate\u001b[49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:440\u001b[0m, in \u001b[0;36mTypeSystem.check_state\u001b[0;34m(self, schema, state)\u001b[0m\n\u001b[1;32m 436\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124m_check\u001b[39m\u001b[38;5;124m'\u001b[39m \u001b[38;5;129;01min\u001b[39;00m schema \u001b[38;5;129;01mand\u001b[39;00m schema[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m_check\u001b[39m\u001b[38;5;124m'\u001b[39m] \u001b[38;5;241m!=\u001b[39m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124many\u001b[39m\u001b[38;5;124m'\u001b[39m:\n\u001b[1;32m 437\u001b[0m check_function \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mtype_registry\u001b[38;5;241m.\u001b[39mcheck_registry\u001b[38;5;241m.\u001b[39maccess(\n\u001b[1;32m 438\u001b[0m schema[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m_check\u001b[39m\u001b[38;5;124m'\u001b[39m])\n\u001b[0;32m--> 440\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mcheck_function\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 441\u001b[0m \u001b[43m \u001b[49m\u001b[43mstate\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 442\u001b[0m \u001b[43m \u001b[49m\u001b[43mschema\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 443\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m)\u001b[49m\n\u001b[1;32m 445\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(state, \u001b[38;5;28mdict\u001b[39m):\n\u001b[1;32m 446\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m key, branch \u001b[38;5;129;01min\u001b[39;00m state\u001b[38;5;241m.\u001b[39mitems():\n", + "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:1541\u001b[0m, in \u001b[0;36mcheck_tree\u001b[0;34m(state, schema, core)\u001b[0m\n\u001b[1;32m 1539\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(state, \u001b[38;5;28mdict\u001b[39m):\n\u001b[1;32m 1540\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m key, value \u001b[38;5;129;01min\u001b[39;00m state\u001b[38;5;241m.\u001b[39mitems():\n\u001b[0;32m-> 1541\u001b[0m check \u001b[38;5;241m=\u001b[39m \u001b[43mcore\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcheck\u001b[49m\u001b[43m(\u001b[49m\u001b[43m{\u001b[49m\n\u001b[1;32m 1542\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43m_type\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mtree\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1543\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43m_leaf\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mleaf_type\u001b[49m\u001b[43m}\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1544\u001b[0m \u001b[43m \u001b[49m\u001b[43mvalue\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1546\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m check:\n\u001b[1;32m 1547\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m core\u001b[38;5;241m.\u001b[39mcheck(\n\u001b[1;32m 1548\u001b[0m leaf_type,\n\u001b[1;32m 1549\u001b[0m value)\n", + "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:466\u001b[0m, in \u001b[0;36mTypeSystem.check\u001b[0;34m(self, initial_schema, state)\u001b[0m\n\u001b[1;32m 465\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mcheck\u001b[39m(\u001b[38;5;28mself\u001b[39m, initial_schema, state):\n\u001b[0;32m--> 466\u001b[0m schema \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43maccess\u001b[49m\u001b[43m(\u001b[49m\u001b[43minitial_schema\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 467\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m schema \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m 468\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mException\u001b[39;00m(\u001b[38;5;124mf\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mno type registered for the given schema: \u001b[39m\u001b[38;5;132;01m{\u001b[39;00minitial_schema\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m'\u001b[39m)\n", + "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:109\u001b[0m, in \u001b[0;36mTypeSystem.access\u001b[0;34m(self, schema)\u001b[0m\n\u001b[1;32m 108\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21maccess\u001b[39m(\u001b[38;5;28mself\u001b[39m, schema):\n\u001b[0;32m--> 109\u001b[0m found \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mtype_registry\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43maccess\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 110\u001b[0m \u001b[43m \u001b[49m\u001b[43mschema\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 111\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m found\n", + "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/registry.py:776\u001b[0m, in \u001b[0;36mTypeRegistry.access\u001b[0;34m(self, schema)\u001b[0m\n\u001b[1;32m 772\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m bad_keys:\n\u001b[1;32m 773\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mException\u001b[39;00m(\n\u001b[1;32m 774\u001b[0m \u001b[38;5;124mf\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mtrying to override a non-overridable key: \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mbad_keys\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m'\u001b[39m)\n\u001b[0;32m--> 776\u001b[0m found \u001b[38;5;241m=\u001b[39m \u001b[43mcopy\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mdeepcopy\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfound\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 777\u001b[0m found \u001b[38;5;241m=\u001b[39m deep_merge(found, schema)\n\u001b[1;32m 779\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124m_type_parameters\u001b[39m\u001b[38;5;124m'\u001b[39m \u001b[38;5;129;01min\u001b[39;00m found:\n", + "File \u001b[0;32m/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/copy.py:146\u001b[0m, in \u001b[0;36mdeepcopy\u001b[0;34m(x, memo, _nil)\u001b[0m\n\u001b[1;32m 144\u001b[0m copier \u001b[38;5;241m=\u001b[39m _deepcopy_dispatch\u001b[38;5;241m.\u001b[39mget(\u001b[38;5;28mcls\u001b[39m)\n\u001b[1;32m 145\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m copier \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[0;32m--> 146\u001b[0m y \u001b[38;5;241m=\u001b[39m \u001b[43mcopier\u001b[49m\u001b[43m(\u001b[49m\u001b[43mx\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mmemo\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 147\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 148\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28missubclass\u001b[39m(\u001b[38;5;28mcls\u001b[39m, \u001b[38;5;28mtype\u001b[39m):\n", + "File \u001b[0;32m/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/copy.py:230\u001b[0m, in \u001b[0;36m_deepcopy_dict\u001b[0;34m(x, memo, deepcopy)\u001b[0m\n\u001b[1;32m 228\u001b[0m memo[\u001b[38;5;28mid\u001b[39m(x)] \u001b[38;5;241m=\u001b[39m y\n\u001b[1;32m 229\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m key, value \u001b[38;5;129;01min\u001b[39;00m x\u001b[38;5;241m.\u001b[39mitems():\n\u001b[0;32m--> 230\u001b[0m y[deepcopy(key, memo)] \u001b[38;5;241m=\u001b[39m \u001b[43mdeepcopy\u001b[49m\u001b[43m(\u001b[49m\u001b[43mvalue\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mmemo\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 231\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m y\n", + "File \u001b[0;32m/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/copy.py:146\u001b[0m, in \u001b[0;36mdeepcopy\u001b[0;34m(x, memo, _nil)\u001b[0m\n\u001b[1;32m 144\u001b[0m copier \u001b[38;5;241m=\u001b[39m _deepcopy_dispatch\u001b[38;5;241m.\u001b[39mget(\u001b[38;5;28mcls\u001b[39m)\n\u001b[1;32m 145\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m copier \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[0;32m--> 146\u001b[0m y \u001b[38;5;241m=\u001b[39m \u001b[43mcopier\u001b[49m\u001b[43m(\u001b[49m\u001b[43mx\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mmemo\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 147\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 148\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28missubclass\u001b[39m(\u001b[38;5;28mcls\u001b[39m, \u001b[38;5;28mtype\u001b[39m):\n", + "File \u001b[0;32m/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/copy.py:228\u001b[0m, in \u001b[0;36m_deepcopy_dict\u001b[0;34m(x, memo, deepcopy)\u001b[0m\n\u001b[1;32m 226\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m_deepcopy_dict\u001b[39m(x, memo, deepcopy\u001b[38;5;241m=\u001b[39mdeepcopy):\n\u001b[1;32m 227\u001b[0m y \u001b[38;5;241m=\u001b[39m {}\n\u001b[0;32m--> 228\u001b[0m memo[\u001b[38;5;28;43mid\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43mx\u001b[49m\u001b[43m)\u001b[49m] \u001b[38;5;241m=\u001b[39m y\n\u001b[1;32m 229\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m key, value \u001b[38;5;129;01min\u001b[39;00m x\u001b[38;5;241m.\u001b[39mitems():\n\u001b[1;32m 230\u001b[0m y[deepcopy(key, memo)] \u001b[38;5;241m=\u001b[39m deepcopy(value, memo)\n", + "\u001b[0;31mRecursionError\u001b[0m: maximum recursion depth exceeded while calling a Python object" ] - }, - { - "data": { - "image/svg+xml": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "bigraph\n", - "\n", - "\n", - "\n", - "('cell',)\n", - "\n", - "cell\n", - "\n", - "\n", - "\n", - "('cell', 'membrane')\n", - "\n", - "membrane\n", - "\n", - "\n", - "\n", - "('cell',)->('cell', 'membrane')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm')\n", - "\n", - "cytoplasm\n", - "\n", - "\n", - "\n", - "('cell',)->('cell', 'cytoplasm')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleoid')\n", - "\n", - "nucleoid\n", - "\n", - "\n", - "\n", - "('cell',)->('cell', 'nucleoid')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'membrane', 'transporters')\n", - "\n", - "transporters\n", - "\n", - "\n", - "\n", - "('cell', 'membrane')->('cell', 'membrane', 'transporters')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'membrane', 'lipids')\n", - "\n", - "lipids\n", - "\n", - "\n", - "\n", - "('cell', 'membrane')->('cell', 'membrane', 'lipids')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'membrane', 'transmembrane transport')\n", - "\n", - "transmembrane transport\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'membrane', 'transporters')->('cell', 'membrane', 'transmembrane transport')\n", - "\n", - "\n", - "transporters\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'metabolites')\n", - "\n", - "metabolites\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm')->('cell', 'cytoplasm', 'metabolites')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'ribosomal complexes')\n", - "\n", - "ribosomal complexes\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm')->('cell', 'cytoplasm', 'ribosomal complexes')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'transcript regulation complex')\n", - "\n", - "transcript regulation complex\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm')->('cell', 'cytoplasm', 'transcript regulation complex')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'translation')\n", - "\n", - "translation\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'metabolites')->('cell', 'membrane', 'transmembrane transport')\n", - "\n", - "\n", - "internal\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'ribosomal complexes')->('cell', 'cytoplasm', 'translation')\n", - "\n", - "\n", - "p1\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'transcript regulation complex', 'transcripts')\n", - "\n", - "transcripts\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'transcript regulation complex')->('cell', 'cytoplasm', 'transcript regulation complex', 'transcripts')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'transcript regulation complex', 'transcripts')->('cell', 'cytoplasm', 'translation')\n", - "\n", - "\n", - "p2\n", - "\n", - "\n", - "\n", - "('cell', 'nucleoid', 'chromosome')\n", - "\n", - "chromosome\n", - "\n", - "\n", - "\n", - "('cell', 'nucleoid')->('cell', 'nucleoid', 'chromosome')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleoid', 'chromosome', 'genes')\n", - "\n", - "genes\n", - "\n", - "\n", - "\n", - "('cell', 'nucleoid', 'chromosome')->('cell', 'nucleoid', 'chromosome', 'genes')\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'membrane', 'transmembrane transport', 'external')->('cell', 'membrane', 'transmembrane transport')\n", - "\n", - "\n", - "external\n", - "\n", - "\n", - "\n" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 19, - "metadata": {}, - "output_type": "execute_result" } ], "source": [ @@ -3390,10 +3086,10 @@ " '_process': 'transport URI',\n", " '_config': {'parameter': 1}\n", " },\n", - " 'wires': {\n", + " 'outputs': {\n", " 'transporters': 'transporters',\n", " 'internal': ['..', 'cytoplasm', 'metabolites']},\n", - " '_ports': {\n", + " '_outputs': {\n", " 'transporters': 'concentrations',\n", " 'internal': 'concentrations',\n", " 'external': 'concentrations'\n", @@ -3417,8 +3113,9 @@ " }\n", " },\n", " 'translation': {\n", - " 'wires': {\n", - " 'p1': 'ribosomal complexes',\n", + " '_type': 'process',\n", + " 'outputs': {\n", + " 'p1': ['ribosomal complexes'],\n", " 'p2': ['transcript regulation complex', 'transcripts']}}},\n", " 'nucleoid': {\n", " 'chromosome': {\n", @@ -3427,7 +3124,10 @@ " }\n", " }\n", "}\n", - "plot_bigraph(cell_struct_func, remove_process_place_edges=True, out_dir='out', filename='cell')" + "core = TypeSystem()\n", + "core.register('concentrations', 'float')\n", + "cell_struct_func2 = replace_regex_recursive(cell_struct_func)\n", + "plot_bigraph(cell_struct_func2, core=core, remove_process_place_edges=True, out_dir='out', filename='cell')" ] }, { @@ -3442,20 +3142,12 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": null, "id": "16960d1b-6e35-421e-bb7d-3efe5052e4fc", "metadata": { "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Writing out/ecoli\n" - ] - } - ], + "outputs": [], "source": [ "ecoli = { \n", " 'chromosome-structure': { \n", diff --git a/notebooks/basics2.ipynb b/notebooks/basics2.ipynb deleted file mode 100644 index 588677a..0000000 --- a/notebooks/basics2.ipynb +++ /dev/null @@ -1,3750 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "id": "5338cfab-cf15-4c63-a091-c1cbb51bf8dd", - "metadata": {}, - "source": [ - "# Process Bigraph Schema\n", - "This tutorial covers Process Bigraph Schema, starting with single `store` and increasing in detail as you scroll towards the bottom. It uses the libraries [bigraph-schema](https://github.com/vivarium-collective/bigraph-schema) for the schema validation and type registry and [bigraph-viz](https://github.com/vivarium-collective/bigraph-viz) for visualization.\n", - "\n", - "## Bigraph-schema and Bigraph-viz\n", - "\n", - "[Bigraph-schema](https://github.com/vivarium-collective/bigraph-schema) is a serializable type schema for Process Bigraph simulations. From this library, we will use the `validate_schema` method to check our schemas, and `fill` to fill in missing details to prepare the schema for simulation. We will also use the `type_registry` to access different schemas, and register new ones.\n", - "\n", - "[Bigraph-viz](https://github.com/vivarium-collective/bigraph-viz) is an easy-to-use plotting tool for compositional bigraph schema, built on top of Graphviz. It reads raw Compositional Bigraph Schemas and generates a figure that can be displayed in a notebook or saved to file. Bigraph-viz's main plotting function is `plot_bigraph` for the bigraph structure. `plot_flow` and `plot_multitimestep` make plots of process orchestration." - ] - }, - { - "cell_type": "markdown", - "id": "df69e36f-3da8-4bfb-8bc0-0aeb04a6f7d7", - "metadata": {}, - "source": [ - "### Installation" - ] - }, - { - "cell_type": "code", - "execution_count": 1, - "id": "63fb7d1a-cd49-4aac-8d4f-31bb54496a51", - "metadata": { - "tags": [] - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "-e git+https://github.com/vivarium-collective/bigraph-schema.git@01a8525182a2de039a16223f086852ee602ac3a3#egg=bigraph_schema\n", - "-e git+https://github.com/vivarium-collective/bigraph-viz.git@c264e1854c88a26c4092eb0097eec472a5aa629f#egg=bigraph_viz\n", - "-e git+https://github.com/vivarium-collective/process-bigraph.git@830e3ae01fe4e9c6d81ce9c29c47868b2c74a1d1#egg=process_bigraph\n" - ] - } - ], - "source": [ - "# !pip install bigraph-schema\n", - "# !pip install bigraph-viz\n", - "!pip freeze | grep bigraph" - ] - }, - { - "cell_type": "markdown", - "id": "f700afa2-bfee-49bf-a4b1-e23f0540461d", - "metadata": {}, - "source": [ - "### Imports" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "id": "2ab3cb32-e007-45c4-807e-b1b442ac1608", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "# from bigraph_viz import plot_bigraph, plot_flow, plot_multitimestep, pf\n", - "from bigraph_viz.dict_utils import replace_regex_recursive\n", - "from bigraph_viz import plot_bigraph, TypeSystem\n", - "\n", - "plot_settings = {\n", - " 'remove_process_place_edges': True\n", - "}\n", - "save_images = False\n", - "if save_images:\n", - " plot_settings.update({'out_dir': 'out','dpi': '250'})" - ] - }, - { - "cell_type": "markdown", - "id": "0e716c23-5fbe-4c08-a868-09611ca40ec4", - "metadata": { - "tags": [] - }, - "source": [ - "## Stores" - ] - }, - { - "cell_type": "markdown", - "id": "9a6e9cc2-e0df-4f73-b4c3-eddb1055b088", - "metadata": {}, - "source": [ - "### Simple stores\n", - "A store can be declared in a JSON dictionary with the store's name mapped to its `value`. " - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "id": "d711b952-089a-4938-817d-d1ccad9de56e", - "metadata": { - "tags": [] - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Writing out/simple_store\n" - ] - }, - { - "data": { - "image/svg+xml": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "bigraph\n", - "\n", - "\n", - "\n", - "('store1',)\n", - "\n", - "store1: 1.0\n", - "\n", - "\n", - "\n" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 3, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "simple_store_state = {\n", - " 'store1': 1.0,\n", - "}\n", - "plot_bigraph(simple_store_state, **plot_settings, show_values=True, filename='simple_store')" - ] - }, - { - "cell_type": "markdown", - "id": "db1cead7-e691-4291-920e-827d69c00727", - "metadata": {}, - "source": [ - "To include values *and* types in a node label, you can instead have the store name map to a dict with `_value` and `_type` keys." - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "id": "f3e5fa71-7ffc-4a8f-a1a0-dc547c886f84", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Writing out/store\n" - ] - }, - { - "data": { - "image/svg+xml": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "bigraph\n", - "\n", - "\n", - "\n", - "('store1',)\n", - "\n", - "store1\n", - "[float]\n", - "\n", - "\n", - "\n" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 4, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "typed_store_spec = {\n", - " 'store1': {\n", - " '_value': 1.0, \n", - " '_type': 'float',\n", - " },\n", - "}\n", - "plot_bigraph(typed_store_spec, **plot_settings, show_values=True, show_types=True, filename='store')" - ] - }, - { - "cell_type": "markdown", - "id": "de1011cb-903b-4c15-baed-a62f4afdd6b9", - "metadata": {}, - "source": [ - "### Hierarchy\n", - "A hierarchy is a place graph of nested stores. Stores can be placed within stores using JSON dictionary nesting." - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "id": "0f3f0824-f89d-4c6e-830e-2c5a321f7b33", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Writing out/hierarchy\n" - ] - }, - { - "data": { - "image/svg+xml": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "bigraph\n", - "\n", - "\n", - "\n", - "('store1',)\n", - "\n", - "store1\n", - "\n", - "\n", - "\n", - "('store1', 'store1.1')\n", - "\n", - "store1.1\n", - "\n", - "\n", - "\n", - "('store1',)->('store1', 'store1.1')\n", - "\n", - "\n", - "\n", - "\n", - "('store1', 'store1.2')\n", - "\n", - "store1.2\n", - "\n", - "\n", - "\n", - "('store1',)->('store1', 'store1.2')\n", - "\n", - "\n", - "\n", - "\n", - "('store1', 'store1.1', 'store1.1.1')\n", - "\n", - "store1.1.1\n", - "\n", - "\n", - "\n", - "('store1', 'store1.1')->('store1', 'store1.1', 'store1.1.1')\n", - "\n", - "\n", - "\n", - "\n", - "('store1', 'store1.1', 'store1.1.2')\n", - "\n", - "store1.1.2\n", - "\n", - "\n", - "\n", - "('store1', 'store1.1')->('store1', 'store1.1', 'store1.1.2')\n", - "\n", - "\n", - "\n", - "\n", - "('store1', 'store1.1', 'store1.1.3')\n", - "\n", - "store1.1.3\n", - "\n", - "\n", - "\n", - "('store1', 'store1.1')->('store1', 'store1.1', 'store1.1.3')\n", - "\n", - "\n", - "\n", - "\n", - "('store1', 'store1.1', 'store1.1.3', 'store1.1.3.1')\n", - "\n", - "store1.1.3.1\n", - "\n", - "\n", - "\n", - "('store1', 'store1.1', 'store1.1.3')->('store1', 'store1.1', 'store1.1.3', 'store1.1.3.1')\n", - "\n", - "\n", - "\n", - "\n" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 5, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "hierarchy_spec = {\n", - " 'store1': {\n", - " 'store1.1': {\n", - " 'store1.1.1': 'Any',\n", - " 'store1.1.2': 'Any',\n", - " 'store1.1.3': {\n", - " 'store1.1.3.1': 'Any',\n", - " },\n", - " },\n", - " 'store1.2': 'Any',\n", - " },\n", - "}\n", - "plot_bigraph(hierarchy_spec, **plot_settings, filename='hierarchy')" - ] - }, - { - "cell_type": "markdown", - "id": "c825e07c-8cd5-4df1-8958-aa0f36d61045", - "metadata": {}, - "source": [ - "## Processes" - ] - }, - { - "cell_type": "markdown", - "id": "47ea1a83-aeac-4048-9593-7b30588b0ad8", - "metadata": {}, - "source": [ - "### Single process\n", - "Processes require ports, which are declared with the `_ports` key mapped to a dict that has port names matched to types." - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "id": "7c74237b-0d66-4e8f-a8ca-79174fadad8b", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Writing out/process\n" - ] - }, - { - "data": { - "image/svg+xml": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "bigraph\n", - "\n", - "\n", - "\n", - "('process1',)\n", - "\n", - "process1\n", - "\n", - "\n", - "\n", - "\n", - "('process1', 'p', 'o', 'r', 't', '1')->('process1',)\n", - "\n", - "\n", - "port1\n", - "\n", - "\n", - "\n", - "\n", - "('process1', 'p', 'o', 'r', 't', '2')->('process1',)\n", - "\n", - "\n", - "port2\n", - "\n", - "\n", - "\n" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 6, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "process_spec = {\n", - " 'process1': {\n", - " '_type': 'edge',\n", - " '_inputs': {\n", - " 'port1': 'Any',\n", - " 'port2': 'Any',\n", - " },\n", - " },\n", - "}\n", - "plot_bigraph(process_spec, **plot_settings, rankdir='RL', filename='process')" - ] - }, - { - "cell_type": "markdown", - "id": "68a2c480-32fe-43d3-b618-8fc6c647b8ca", - "metadata": {}, - "source": [ - "### Multiple processes" - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "id": "8c2457a3-fc47-4850-8b9e-9ee98e81567d", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Writing out/multiple_processes\n" - ] - }, - { - "data": { - "image/svg+xml": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "bigraph\n", - "\n", - "\n", - "\n", - "('process1',)\n", - "\n", - "process1\n", - "\n", - "\n", - "\n", - "('process2',)\n", - "\n", - "process2\n", - "\n", - "\n", - "\n", - "('process3',)\n", - "\n", - "process3\n", - "\n", - "\n", - "\n", - "\n", - "('process1', 'p', 'o', 'r', 't', '1')->('process1',)\n", - "\n", - "\n", - "port1\n", - "\n", - "\n", - "\n", - "\n", - "('process2', 'p', 'o', 'r', 't', '1')->('process2',)\n", - "\n", - "\n", - "port1\n", - "\n", - "\n", - "\n", - "\n", - "('process3', 'p', 'o', 'r', 't', '1')->('process3',)\n", - "\n", - "\n", - "port1\n", - "\n", - "\n", - "\n", - "\n", - "('process1', 'p', 'o', 'r', 't', '2')->('process1',)\n", - "\n", - "\n", - "port2\n", - "\n", - "\n", - "\n", - "\n", - "('process2', 'p', 'o', 'r', 't', '2')->('process2',)\n", - "\n", - "\n", - "port2\n", - "\n", - "\n", - "\n", - "\n", - "('process3', 'p', 'o', 'r', 't', '2')->('process3',)\n", - "\n", - "\n", - "port2\n", - "\n", - "\n", - "\n" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 7, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "process_schema = {\n", - " '_type': 'process',\n", - " '_inputs': {\n", - " 'port1': 'Any',\n", - " },\n", - " '_outputs': {\n", - " 'port2': 'Any'\n", - " },\n", - "}\n", - "\n", - "processes_spec = {\n", - " 'process1': process_schema,\n", - " 'process2': process_schema,\n", - " 'process3': process_schema,\n", - "}\n", - "plot_bigraph(processes_spec, **plot_settings, rankdir='BT', filename='multiple_processes')" - ] - }, - { - "cell_type": "markdown", - "id": "15e5f5a6-8dd4-41c3-ba37-33ed9e3e0830", - "metadata": {}, - "source": [ - "## Wires\n", - "To connect a process's ports to stores, add wiring with a `_wires` key that maps port names to relative paths in the store hierarchy. The ports used by the wires need to match the ports in the schema." - ] - }, - { - "cell_type": "code", - "execution_count": 8, - "id": "a6ecad5d-8948-4636-910c-79284a3e8679", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Writing out/wires\n" - ] - }, - { - "data": { - "image/svg+xml": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "bigraph\n", - "\n", - "\n", - "\n", - "('node1',)\n", - "\n", - "node1\n", - "\n", - "\n", - "\n", - "('process1',)\n", - "\n", - "process1\n", - "\n", - "\n", - "\n", - "('node1',)->('process1',)\n", - "\n", - "\n", - "port1\n", - "\n", - "\n", - "\n", - "('node2',)\n", - "\n", - "node2\n", - "\n", - "\n", - "\n", - "('node2',)->('process1',)\n", - "\n", - "\n", - "port2\n", - "\n", - "\n", - "\n", - "('node3',)\n", - "\n", - "node3\n", - "\n", - "\n", - "\n", - "('node3',)->('process1',)\n", - "\n", - "\n", - "port3\n", - "\n", - "\n", - "\n" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 8, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "connected_process_spec = {\n", - " 'process1': {\n", - " '_type': 'edge',\n", - " '_inputs': {\n", - " 'port1': 'float',\n", - " 'port2': 'int',\n", - " 'port3': 'int',\n", - " },\n", - " 'inputs': {\n", - " 'port1': ['node1'],\n", - " 'port2': ['node2'],\n", - " 'port3': ['node3'],\n", - " }\n", - " },\n", - " 'node1': 'float', # TODO -- shouldn't these fill?\n", - " 'node2': 'int',\n", - " 'node3': 'int',\n", - "}\n", - "plot_bigraph(connected_process_spec, **plot_settings, filename='wires')" - ] - }, - { - "cell_type": "markdown", - "id": "e037285d-116a-404d-96ec-ba47318a2e8b", - "metadata": {}, - "source": [ - "### Advanced wiring\n", - "**TODO**" - ] - }, - { - "cell_type": "markdown", - "id": "01b17201-2489-45c8-a06b-9fdc29a714a7", - "metadata": {}, - "source": [ - "## Composites" - ] - }, - { - "cell_type": "markdown", - "id": "daf5d428-db23-4985-80ff-6b93d22973aa", - "metadata": {}, - "source": [ - "### Flat composite\n", - "A flat composite connects stores with multiple connected processes, without nesting." - ] - }, - { - "cell_type": "code", - "execution_count": 9, - "id": "781a84e6-bbe2-4708-b441-47efc611b46f", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Writing out/flat_composite\n" - ] - }, - { - "data": { - "image/svg+xml": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "bigraph\n", - "\n", - "\n", - "\n", - "('store1.1',)\n", - "\n", - "store1.1\n", - "\n", - "\n", - "\n", - "('process1',)\n", - "\n", - "process1\n", - "\n", - "\n", - "\n", - "('store1.1',)->('process1',)\n", - "\n", - "\n", - "port1\n", - "\n", - "\n", - "\n", - "('process2',)\n", - "\n", - "process2\n", - "\n", - "\n", - "\n", - "('store1.1',)->('process2',)\n", - "\n", - "\n", - "port1\n", - "\n", - "\n", - "\n", - "('store1.2',)\n", - "\n", - "store1.2\n", - "\n", - "\n", - "\n", - "('store1.2',)->('process1',)\n", - "\n", - "\n", - "port2\n", - "\n", - "\n", - "\n", - "('store1.2',)->('process2',)\n", - "\n", - "\n", - "port2\n", - "\n", - "\n", - "\n" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 9, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "flat_composite_spec = {\n", - " 'store1.1': 'float',\n", - " 'store1.2': 'int',\n", - " 'process1': {\n", - " '_type': 'process',\n", - " 'outputs': {\n", - " 'port1': ['store1.1'],\n", - " 'port2': ['store1.2'],\n", - " }\n", - " },\n", - " 'process2': {\n", - " '_type': 'process',\n", - " 'inputs': {\n", - " 'port1': ['store1.1'],\n", - " 'port2': ['store1.2'],\n", - " }\n", - " },\n", - "}\n", - "plot_bigraph(flat_composite_spec, **plot_settings, rankdir='RL', filename='flat_composite')" - ] - }, - { - "cell_type": "markdown", - "id": "398509c7-cf5c-4cce-a179-3a39752b0dde", - "metadata": {}, - "source": [ - "### Nested composite\n", - "A nested composite has store hierarchies with multiple connected processes." - ] - }, - { - "cell_type": "code", - "execution_count": 10, - "id": "701e759d-7f9b-41bb-911c-a8208c892462", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Writing out/nested_composite\n" - ] - }, - { - "data": { - "image/svg+xml": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "bigraph\n", - "\n", - "\n", - "\n", - "('store1',)\n", - "\n", - "store1\n", - "\n", - "\n", - "\n", - "('store1', 'store1.1')\n", - "\n", - "store1.1\n", - "\n", - "\n", - "\n", - "('store1',)->('store1', 'store1.1')\n", - "\n", - "\n", - "\n", - "\n", - "('store1', 'store1.2')\n", - "\n", - "store1.2\n", - "\n", - "\n", - "\n", - "('store1',)->('store1', 'store1.2')\n", - "\n", - "\n", - "\n", - "\n", - "('store1', 'process1')\n", - "\n", - "process1\n", - "\n", - "\n", - "\n", - "('store1',)->('store1', 'process1')\n", - "\n", - "\n", - "\n", - "\n", - "('store1', 'process2')\n", - "\n", - "process2\n", - "\n", - "\n", - "\n", - "('store1',)->('store1', 'process2')\n", - "\n", - "\n", - "\n", - "\n", - "('process3',)\n", - "\n", - "process3\n", - "\n", - "\n", - "\n", - "('store1',)->('process3',)\n", - "\n", - "\n", - "port1\n", - "\n", - "\n", - "\n", - "('store1', 'store1.1')->('store1', 'process1')\n", - "\n", - "\n", - "port1\n", - "\n", - "\n", - "\n", - "('store1', 'store1.1')->('store1', 'process2')\n", - "\n", - "\n", - "port1\n", - "\n", - "\n", - "\n", - "('store1', 'store1.2')->('store1', 'process1')\n", - "\n", - "\n", - "port2\n", - "\n", - "\n", - "\n", - "('store1', 'store1.2')->('store1', 'process2')\n", - "\n", - "\n", - "port2\n", - "\n", - "\n", - "\n" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 10, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "nested_composite_spec = {\n", - " 'store1': {\n", - " 'store1.1': 'float',\n", - " 'store1.2': 'int',\n", - " 'process1': {\n", - " '_type': 'process',\n", - " 'inputs': {\n", - " 'port1': ['store1.1'],\n", - " 'port2': ['store1.2'],\n", - " }\n", - " },\n", - " 'process2': {\n", - " '_type': 'process',\n", - " 'outputs': {\n", - " 'port1': ['store1.1'],\n", - " 'port2': ['store1.2'],\n", - " }\n", - " },\n", - " },\n", - " 'process3': {\n", - " '_type': 'process',\n", - " 'inputs': {\n", - " 'port1': ['store1'],\n", - " }\n", - " }\n", - "}\n", - "plot_bigraph(nested_composite_spec, \n", - " # **plot_settings, \n", - " filename='nested_composite')" - ] - }, - { - "cell_type": "markdown", - "id": "0c8c1704-2331-44eb-bd05-72e36ccb6858", - "metadata": {}, - "source": [ - "### Composite process\n", - "Composite processes are processes with internal stores and internal processes, which can run as their own simulation. The composite process has schema, allowing it to connect to a super-simulation. This allows for improved distributed computation, with composite processes able to run on their own computer and syncronize to the super-simulation via message passing." - ] - }, - { - "cell_type": "code", - "execution_count": 11, - "id": "638c5dc7-4cfd-46e4-b66a-8c42ca98ff1d", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Writing out/composite_process\n" - ] - }, - { - "data": { - "image/svg+xml": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "bigraph\n", - "\n", - "\n", - "\n", - "('composite_process',)\n", - "\n", - "composite_process\n", - "\n", - "\n", - "\n", - "('composite_process', 'store1.1')\n", - "\n", - "store1.1\n", - "\n", - "\n", - "\n", - "('composite_process',)->('composite_process', 'store1.1')\n", - "\n", - "\n", - "\n", - "\n", - "('composite_process', 'store1.2')\n", - "\n", - "store1.2\n", - "\n", - "\n", - "\n", - "('composite_process',)->('composite_process', 'store1.2')\n", - "\n", - "\n", - "\n", - "\n", - "('composite_process', 'process1')\n", - "\n", - "process1\n", - "\n", - "\n", - "\n", - "('composite_process',)->('composite_process', 'process1')\n", - "\n", - "\n", - "\n", - "\n", - "('composite_process', 'process2')\n", - "\n", - "process2\n", - "\n", - "\n", - "\n", - "('composite_process',)->('composite_process', 'process2')\n", - "\n", - "\n", - "\n", - "\n", - "('composite_process', 'process1', 'outputs')\n", - "\n", - "outputs\n", - "\n", - "\n", - "\n", - "('composite_process', 'process1')->('composite_process', 'process1', 'outputs')\n", - "\n", - "\n", - "\n", - "\n", - "('composite_process', 'process1', 'inputs')\n", - "\n", - "inputs\n", - "\n", - "\n", - "\n", - "('composite_process', 'process1')->('composite_process', 'process1', 'inputs')\n", - "\n", - "\n", - "\n", - "\n", - "('composite_process', 'process1', 'address')\n", - "\n", - "address\n", - "\n", - "\n", - "\n", - "('composite_process', 'process1')->('composite_process', 'process1', 'address')\n", - "\n", - "\n", - "\n", - "\n", - "('composite_process', 'process1', 'config')\n", - "\n", - "config\n", - "\n", - "\n", - "\n", - "('composite_process', 'process1')->('composite_process', 'process1', 'config')\n", - "\n", - "\n", - "\n", - "\n", - "('composite_process', 'process1', 'interval')\n", - "\n", - "interval\n", - "\n", - "\n", - "\n", - "('composite_process', 'process1')->('composite_process', 'process1', 'interval')\n", - "\n", - "\n", - "\n", - "\n", - "('composite_process', 'process1', 'outputs', 'port1')\n", - "\n", - "port1\n", - "\n", - "\n", - "\n", - "('composite_process', 'process1', 'outputs')->('composite_process', 'process1', 'outputs', 'port1')\n", - "\n", - "\n", - "\n", - "\n", - "('composite_process', 'process1', 'outputs', 'port2')\n", - "\n", - "port2\n", - "\n", - "\n", - "\n", - "('composite_process', 'process1', 'outputs')->('composite_process', 'process1', 'outputs', 'port2')\n", - "\n", - "\n", - "\n", - "\n", - "('composite_process', 'process2', 'outputs')\n", - "\n", - "outputs\n", - "\n", - "\n", - "\n", - "('composite_process', 'process2')->('composite_process', 'process2', 'outputs')\n", - "\n", - "\n", - "\n", - "\n", - "('composite_process', 'process2', 'inputs')\n", - "\n", - "inputs\n", - "\n", - "\n", - "\n", - "('composite_process', 'process2')->('composite_process', 'process2', 'inputs')\n", - "\n", - "\n", - "\n", - "\n", - "('composite_process', 'process2', 'address')\n", - "\n", - "address\n", - "\n", - "\n", - "\n", - "('composite_process', 'process2')->('composite_process', 'process2', 'address')\n", - "\n", - "\n", - "\n", - "\n", - "('composite_process', 'process2', 'config')\n", - "\n", - "config\n", - "\n", - "\n", - "\n", - "('composite_process', 'process2')->('composite_process', 'process2', 'config')\n", - "\n", - "\n", - "\n", - "\n", - "('composite_process', 'process2', 'interval')\n", - "\n", - "interval\n", - "\n", - "\n", - "\n", - "('composite_process', 'process2')->('composite_process', 'process2', 'interval')\n", - "\n", - "\n", - "\n", - "\n", - "('composite_process', 'process2', 'outputs', 'port1')\n", - "\n", - "port1\n", - "\n", - "\n", - "\n", - "('composite_process', 'process2', 'outputs')->('composite_process', 'process2', 'outputs', 'port1')\n", - "\n", - "\n", - "\n", - "\n", - "('composite_process', 'process2', 'outputs', 'port2')\n", - "\n", - "port2\n", - "\n", - "\n", - "\n", - "('composite_process', 'process2', 'outputs')->('composite_process', 'process2', 'outputs', 'port2')\n", - "\n", - "\n", - "\n", - "\n" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 11, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "composite_process_spec = {\n", - " 'composite_process': {\n", - " 'store1.1': 'any',\n", - " 'store1.2': 'any',\n", - " 'process1': {\n", - " '_type': 'process',\n", - " 'outputs': {\n", - " 'port1': 'store1.1',\n", - " 'port2': 'store1.2',\n", - " }\n", - " },\n", - " 'process2': {\n", - " '_type': 'process',\n", - " 'outputs': {\n", - " 'port1': 'store1.1',\n", - " 'port2': 'store1.2',\n", - " }\n", - " },\n", - " '_inputs': {\n", - " 'port1': 'Any', \n", - " 'port2': 'Any', \n", - " },\n", - " # '_tunnels': {\n", - " # 'port1': 'store1.1',\n", - " # 'port2': 'store1.2',\n", - " # }\n", - " }\n", - "}\n", - "plot_bigraph(composite_process_spec, **plot_settings, filename='composite_process')" - ] - }, - { - "cell_type": "markdown", - "id": "847cef26-65a1-4da6-9dd3-eb5839277970", - "metadata": {}, - "source": [ - "## Orchestration" - ] - }, - { - "cell_type": "code", - "execution_count": 12, - "id": "e76c97a8-3037-464a-929e-ba4414c73c34", - "metadata": {}, - "outputs": [], - "source": [ - "plot_settings2={}\n", - "if save_images:\n", - " plot_settings2.update({\n", - " 'out_dir': 'out',\n", - " 'dpi': '250'\n", - " })" - ] - }, - { - "cell_type": "markdown", - "id": "48975890-06a4-462a-9b1d-6bddd51779fe", - "metadata": {}, - "source": [ - "### Multi-timestepping\n", - "\n", - "Temporal processes can be run by multi-timestepping, with each process updating the state according to its `sync_state` state, which it can update adaptively." - ] - }, - { - "cell_type": "code", - "execution_count": 13, - "id": "f0eff7b0-f0e2-4d56-8b16-ef0fc1ce5aba", - "metadata": {}, - "outputs": [], - "source": [ - "# multitimestep_spec = {\n", - "# 'temporal process2': {\n", - "# '_ports': {'port1': 'Any'},\n", - "# 'wires': {'port1': 'state'},\n", - "# '_sync_step': 1.0,\n", - "# },\n", - "# 'temporal process1': {\n", - "# '_ports': {'port1': 'Any'},\n", - "# 'wires': {'port1': 'state'},\n", - "# '_sync_step': 0.5,\n", - "# },\n", - "# }\n", - "# multitimestep_spec = replace_regex_recursive(multitimestep_spec)\n", - "# plot_multitimestep(multitimestep_spec, total_time=2.0, **plot_settings2, filename='multitimestep')" - ] - }, - { - "cell_type": "markdown", - "id": "a00cf677-ebac-4309-8ac9-a5b2855724af", - "metadata": {}, - "source": [ - "### Flows\n", - "\n", - "A directed acyclic graph (DAG) – a type of workflow that declares the dependencies between processes. A flow run is not temporal, and the order is entirely based on dependencies. It can triggered between time steps, running the steps in the order as determined by their dependencies." - ] - }, - { - "cell_type": "code", - "execution_count": 14, - "id": "db45c99b-b97b-47bc-a73e-c669882f3969", - "metadata": {}, - "outputs": [], - "source": [ - "# flow = {\n", - "# 'step1': {\n", - "# '_type': 'step_process',\n", - "# '_ports': {},\n", - "# '_depends_on': [], \n", - "# },\n", - "# 'step2': {\n", - "# '_type': 'step_process',\n", - "# '_ports': {},\n", - "# '_depends_on': 'step1', \n", - "# },\n", - "# 'step3': {\n", - "# '_type': 'step_process',\n", - "# '_ports': {},\n", - "# '_depends_on': [], \n", - "# },\n", - "# 'step4': {\n", - "# '_type': 'step_process',\n", - "# '_ports': {},\n", - "# '_depends_on': ['step2', 'step3'], \n", - "# },\n", - "# }\n", - "\n", - "# plot_flow(flow, **plot_settings2, filename='flow')" - ] - }, - { - "cell_type": "markdown", - "id": "5882581a-c5ef-40b5-acbd-efddad269807", - "metadata": {}, - "source": [ - "## Examples" - ] - }, - { - "cell_type": "markdown", - "id": "ff81178f-36e4-4200-982a-ed8155b87934", - "metadata": { - "tags": [] - }, - "source": [ - "### Multiscale map of a cell\n", - "\n", - "Bigraphs can represent the hierarchical nesting of cellular structures. Below is a multiscale map of a cell from [Qin et al. A multi-scale map of cell structure fusing protein images and interactions. Nature. 2021.](https://pubmed.ncbi.nlm.nih.gov/34819669/)" - ] - }, - { - "cell_type": "code", - "execution_count": 15, - "id": "47bdf8e5-0bdd-4cac-b57e-2449c75fa178", - "metadata": { - "tags": [] - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Writing out/cell_hierarchy\n" - ] - }, - { - "data": { - "image/svg+xml": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "bigraph\n", - "\n", - "\n", - "\n", - "('cell',)\n", - "\n", - "cell\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm')\n", - "\n", - "cytoplasm\n", - "\n", - "\n", - "\n", - "('cell',)->('cell', 'cytoplasm')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus')\n", - "\n", - "nucleus\n", - "\n", - "\n", - "\n", - "('cell',)->('cell', 'nucleus')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'secretory<br/>organelles')\n", - "\n", - "secretory\n", - "organelles\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm')->('cell', 'cytoplasm', 'secretory<br/>organelles')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles')\n", - "\n", - "cytoplasmic\n", - "organelles\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'transcriptional<br/>regulation<br/>complex<br/>family')\n", - "\n", - "transcriptional\n", - "regulation\n", - "complex\n", - "family\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm')->('cell', 'cytoplasm', 'transcriptional<br/>regulation<br/>complex<br/>family')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'secretory<br/>organelles', 'transmembrane<br/>transport<br/>systems')\n", - "\n", - "transmembrane\n", - "transport\n", - "systems\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'secretory<br/>organelles')->('cell', 'cytoplasm', 'secretory<br/>organelles', 'transmembrane<br/>transport<br/>systems')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'secretory<br/>organelles', 'transmembrane<br/>transport<br/>systems', 'ion<br/>transmembrane<br/>transport<br/>systems')\n", - "\n", - "ion\n", - "transmembrane\n", - "transport\n", - "systems\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'secretory<br/>organelles', 'transmembrane<br/>transport<br/>systems')->('cell', 'cytoplasm', 'secretory<br/>organelles', 'transmembrane<br/>transport<br/>systems', 'ion<br/>transmembrane<br/>transport<br/>systems')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles')\n", - "\n", - "subgroup\n", - "of\n", - "cytoplasmic\n", - "organelles\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'metabolic<br/>organelles')\n", - "\n", - "metabolic\n", - "organelles\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'metabolic<br/>organelles')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family')\n", - "\n", - "ribonucleoprotein\n", - "complex\n", - "family\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'metabolic<br/>organelles', 'subgroup<br/>of<br/>metabolic<br/>organelles')\n", - "\n", - "subgroup\n", - "of\n", - "metabolic\n", - "organelles\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'metabolic<br/>organelles')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'metabolic<br/>organelles', 'subgroup<br/>of<br/>metabolic<br/>organelles')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'metabolic<br/>organelles', 'mitochondrion')\n", - "\n", - "mitochondrion\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'metabolic<br/>organelles')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'metabolic<br/>organelles', 'mitochondrion')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'RNA<br/>processing<br/>complex<br/>1')\n", - "\n", - "RNA\n", - "processing\n", - "complex\n", - "1\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'RNA<br/>processing<br/>complex<br/>1')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community')\n", - "\n", - "ribosome\n", - "biogenesis\n", - "community\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'RNA<br/>processing<br/>complex<br/>1', 'RNA<br/>splicing<br/>complex<br/>1')\n", - "\n", - "RNA\n", - "splicing\n", - "complex\n", - "1\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'RNA<br/>processing<br/>complex<br/>1')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'RNA<br/>processing<br/>complex<br/>1', 'RNA<br/>splicing<br/>complex<br/>1')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome')\n", - "\n", - "ribosome\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'nucleic<br/>acid<br/>binding<br/>complex')\n", - "\n", - "nucleic\n", - "acid\n", - "binding\n", - "complex\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'nucleic<br/>acid<br/>binding<br/>complex')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit')\n", - "\n", - "ribosomal\n", - "subunit\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'mitochondirial<br/>large<br/>ribosomal<br/>subunit')\n", - "\n", - "mitochondirial\n", - "large\n", - "ribosomal\n", - "subunit\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'mitochondirial<br/>large<br/>ribosomal<br/>subunit')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'mito-cyto<br/>ribosomal<br/>cluster')\n", - "\n", - "mito-cyto\n", - "ribosomal\n", - "cluster\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'mito-cyto<br/>ribosomal<br/>cluster')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'cotranslational<br/>protein<br/>targeting<br/>to<br/>membrane<br/>system')\n", - "\n", - "cotranslational\n", - "protein\n", - "targeting\n", - "to\n", - "membrane\n", - "system\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'cotranslational<br/>protein<br/>targeting<br/>to<br/>membrane<br/>system')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'ribosomal<br/>complex<br/>5')\n", - "\n", - "ribosomal\n", - "complex\n", - "5\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'ribosomal<br/>complex<br/>5')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'ribosomal<br/>complex<br/>2')\n", - "\n", - "ribosomal\n", - "complex\n", - "2\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'ribosomal<br/>complex<br/>2')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'transcriptional<br/>regulation<br/>complex<br/>family', 'transcriptional<br/>regulation<br/>complexes')\n", - "\n", - "transcriptional\n", - "regulation\n", - "complexes\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'transcriptional<br/>regulation<br/>complex<br/>family')->('cell', 'cytoplasm', 'transcriptional<br/>regulation<br/>complex<br/>family', 'transcriptional<br/>regulation<br/>complexes')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'DNA<br/>metabolic<br/>assembly')\n", - "\n", - "DNA\n", - "metabolic\n", - "assembly\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus')->('cell', 'nucleus', 'DNA<br/>metabolic<br/>assembly')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nuclear<br/>lumen')\n", - "\n", - "nuclear\n", - "lumen\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus')->('cell', 'nucleus', 'nuclear<br/>lumen')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nuclear<br/>body')\n", - "\n", - "nuclear\n", - "body\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus')->('cell', 'nucleus', 'nuclear<br/>body')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nucleo-plasm<br/>1')\n", - "\n", - "nucleo-plasm\n", - "1\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus')->('cell', 'nucleus', 'nucleo-plasm<br/>1')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nucleo-plasm<br/>2')\n", - "\n", - "nucleo-plasm\n", - "2\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus')->('cell', 'nucleus', 'nucleo-plasm<br/>2')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nuclear<br/>transcriptional<br/>speckle')\n", - "\n", - "nuclear\n", - "transcriptional\n", - "speckle\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus')->('cell', 'nucleus', 'nuclear<br/>transcriptional<br/>speckle')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus')\n", - "\n", - "nucleolus\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nuclear<br/>lumen')->('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nuclear<br/>lumen', 'nuclear<br/>splicing<br/>speckle')\n", - "\n", - "nuclear\n", - "splicing\n", - "speckle\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nuclear<br/>lumen')->('cell', 'nucleus', 'nuclear<br/>lumen', 'nuclear<br/>splicing<br/>speckle')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'ribonucleprotein<br/>complex<br/>family')\n", - "\n", - "ribonucleprotein\n", - "complex\n", - "family\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus')->('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'ribonucleprotein<br/>complex<br/>family')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'RNA<br/>processing<br/>complex<br/>family')\n", - "\n", - "RNA\n", - "processing\n", - "complex\n", - "family\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus')->('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'RNA<br/>processing<br/>complex<br/>family')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'splicosomal<br/>complex<br/>family')\n", - "\n", - "splicosomal\n", - "complex\n", - "family\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus')->('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'splicosomal<br/>complex<br/>family')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'RNA<br/>processing<br/>complex<br/>family', 'RNA<br/>processing<br/>complex<br/>1')\n", - "\n", - "RNA\n", - "processing\n", - "complex\n", - "1\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'RNA<br/>processing<br/>complex<br/>family')->('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'RNA<br/>processing<br/>complex<br/>family', 'RNA<br/>processing<br/>complex<br/>1')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'RNA<br/>processing<br/>complex<br/>family', 'RNA<br/>splicing<br/>complex<br/>family')\n", - "\n", - "RNA\n", - "splicing\n", - "complex\n", - "family\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'RNA<br/>processing<br/>complex<br/>family')->('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'RNA<br/>processing<br/>complex<br/>family', 'RNA<br/>splicing<br/>complex<br/>family')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family')\n", - "\n", - "chromosome\n", - "organization\n", - "complex\n", - "family\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nucleo-plasm<br/>1')->('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family', 'chromatin<br/>organization<br/>complex<br/>family')\n", - "\n", - "chromatin\n", - "organization\n", - "complex\n", - "family\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family')->('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family', 'chromatin<br/>organization<br/>complex<br/>family')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family', 'chromatin<br/>organization<br/>complex<br/>family', 'HAT<br/>complex<br/>family')\n", - "\n", - "HAT\n", - "complex\n", - "family\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family', 'chromatin<br/>organization<br/>complex<br/>family')->('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family', 'chromatin<br/>organization<br/>complex<br/>family', 'HAT<br/>complex<br/>family')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family', 'chromatin<br/>organization<br/>complex<br/>family', 'HAT<br/>complex<br/>family', 'NuA4<br/>HAT<br/>complex')\n", - "\n", - "NuA4\n", - "HAT\n", - "complex\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family', 'chromatin<br/>organization<br/>complex<br/>family', 'HAT<br/>complex<br/>family')->('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family', 'chromatin<br/>organization<br/>complex<br/>family', 'HAT<br/>complex<br/>family', 'NuA4<br/>HAT<br/>complex')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nucleo-plasm<br/>2', 'chromatin<br/>regulation<br/>complex')\n", - "\n", - "chromatin\n", - "regulation\n", - "complex\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nucleo-plasm<br/>2')->('cell', 'nucleus', 'nucleo-plasm<br/>2', 'chromatin<br/>regulation<br/>complex')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nuclear<br/>transcriptional<br/>speckle', 'negative<br/>regulation<br/>of<br/>RNA<br/>biosynthesis<br/>process')\n", - "\n", - "negative\n", - "regulation\n", - "of\n", - "RNA\n", - "biosynthesis\n", - "process\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nuclear<br/>transcriptional<br/>speckle')->('cell', 'nucleus', 'nuclear<br/>transcriptional<br/>speckle', 'negative<br/>regulation<br/>of<br/>RNA<br/>biosynthesis<br/>process')\n", - "\n", - "\n", - "\n", - "\n" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 15, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "music_map = {\n", - " 'cell': {\n", - " 'cytoplasm': {\n", - " 'secretory organelles': {\n", - " 'transmembrane transport systems': {\n", - " 'ion transmembrane transport systems': {}}},\n", - " 'cytoplasmic organelles': {\n", - " 'subgroup of cytoplasmic organelles': {\n", - " 'metabolic organelles': {\n", - " 'subgroup of metabolic organelles': {},\n", - " 'mitochondrion': {}},\n", - " 'ribonucleoprotein complex family': {\n", - " 'RNA processing complex 1': {'RNA splicing complex 1': {}},\n", - " 'ribosome biogenesis community': {\n", - " 'ribosome': {\n", - " 'ribosomal subunit': {\n", - " 'mitochondirial large ribosomal subunit': {\n", - " # 'large ribosomal subunit subcomplex 1': {}\n", - " },\n", - " 'mito-cyto ribosomal cluster': {},\n", - " 'cotranslational protein targeting to membrane system': {},\n", - " 'ribosomal complex 5': {},\n", - " 'ribosomal complex 2': {}}},\n", - " 'nucleic acid binding complex': {}}}}},\n", - " 'transcriptional regulation complex family': {\n", - " 'transcriptional regulation complexes': {}}},\n", - " 'nucleus': {\n", - " 'DNA metabolic assembly': {},\n", - " 'nuclear lumen': {\n", - " 'nucleolus': {\n", - " 'ribonucleprotein complex family': {},\n", - " 'RNA processing complex family': {\n", - " 'RNA processing complex 1': {},\n", - " 'RNA splicing complex family': {}},\n", - " 'splicosomal complex family': {}},\n", - " 'nuclear splicing speckle': {}},\n", - " 'nuclear body': {},\n", - " 'nucleo-plasm 1': {\n", - " 'chromosome organization complex family': {\n", - " 'chromatin organization complex family': {\n", - " 'HAT complex family': {\n", - " 'NuA4 HAT complex': {}}}}},\n", - " 'nucleo-plasm 2': {\n", - " 'chromatin regulation complex': {}},\n", - " 'nuclear transcriptional speckle': {\n", - " 'negative regulation of RNA biosynthesis process': {}}}}}\n", - "music_map1 = replace_regex_recursive(music_map)\n", - "plot_bigraph(music_map1, **plot_settings, filename='cell_hierarchy')" - ] - }, - { - "cell_type": "code", - "execution_count": 16, - "id": "ab431982-d156-4b7a-9918-384a5ea5132a", - "metadata": { - "tags": [] - }, - "outputs": [ - { - "data": { - "text/plain": [ - "{'cell': {'cytoplasm': {'secretory organelles': {'transmembrane transport systems': {'ion transmembrane transport systems': {}}},\n", - " 'cytoplasmic organelles': {'subgroup of cytoplasmic organelles': {'metabolic organelles': {'subgroup of metabolic organelles': {},\n", - " 'mitochondrion': {}},\n", - " 'ribonucleoprotein complex family': {'RNA processing complex 1': {'RNA splicing complex 1': {}},\n", - " 'ribosome biogenesis community': {'ribosome': {'ribosomal subunit': {'mitochondirial large ribosomal subunit': {},\n", - " 'mito-cyto ribosomal cluster': {},\n", - " 'cotranslational protein targeting to membrane system': {},\n", - " 'ribosomal complex 5': {},\n", - " 'ribosomal complex 2': {}}},\n", - " 'nucleic acid binding complex': {}}}}},\n", - " 'transcriptional regulation complex family': {'transcriptional regulation complexes': {}}},\n", - " 'nucleus': {'DNA metabolic assembly': {},\n", - " 'nuclear lumen': {'nucleolus': {'ribonucleprotein complex family': {},\n", - " 'RNA processing complex family': {'RNA processing complex 1': {},\n", - " 'RNA splicing complex family': {}},\n", - " 'splicosomal complex family': {}},\n", - " 'nuclear splicing speckle': {}},\n", - " 'nuclear body': {},\n", - " 'nucleo-plasm 1': {'chromosome organization complex family': {'chromatin organization complex family': {'HAT complex family': {'NuA4 HAT complex': {}}}}},\n", - " 'nucleo-plasm 2': {'chromatin regulation complex': {}},\n", - " 'nuclear transcriptional speckle': {'negative regulation of RNA biosynthesis process': {}}}}}" - ] - }, - "execution_count": 16, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "music_map" - ] - }, - { - "cell_type": "code", - "execution_count": 17, - "id": "5a76608a-fff0-4005-9f32-c02afef39d9e", - "metadata": { - "tags": [] - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Writing out/cell_hierarchy_functions\n" - ] - }, - { - "data": { - "image/svg+xml": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "bigraph\n", - "\n", - "\n", - "\n", - "('cell',)\n", - "\n", - "cell\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm')\n", - "\n", - "cytoplasm\n", - "\n", - "\n", - "\n", - "('cell',)->('cell', 'cytoplasm')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus')\n", - "\n", - "nucleus\n", - "\n", - "\n", - "\n", - "('cell',)->('cell', 'nucleus')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'transcription')\n", - "\n", - "transcription\n", - "\n", - "\n", - "\n", - "('cell',)->('cell', 'transcription')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'translation')\n", - "\n", - "translation\n", - "\n", - "\n", - "\n", - "('cell',)->('cell', 'translation')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'metabolism')\n", - "\n", - "metabolism\n", - "\n", - "\n", - "\n", - "('cell',)->('cell', 'metabolism')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cell<br/>cycle')\n", - "\n", - "cell\n", - "cycle\n", - "\n", - "\n", - "\n", - "('cell',)->('cell', 'cell<br/>cycle')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'signalling')\n", - "\n", - "signalling\n", - "\n", - "\n", - "\n", - "('cell',)->('cell', 'signalling')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'protein<br/>transport')\n", - "\n", - "protein\n", - "transport\n", - "\n", - "\n", - "\n", - "('cell',)->('cell', 'protein<br/>transport')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'RNA<br/>processing')\n", - "\n", - "RNA\n", - "processing\n", - "\n", - "\n", - "\n", - "('cell',)->('cell', 'RNA<br/>processing')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'secretory<br/>organelles')\n", - "\n", - "secretory\n", - "organelles\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm')->('cell', 'cytoplasm', 'secretory<br/>organelles')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles')\n", - "\n", - "cytoplasmic\n", - "organelles\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'transcriptional<br/>regulation<br/>complex<br/>family')\n", - "\n", - "transcriptional\n", - "regulation\n", - "complex\n", - "family\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm')->('cell', 'cytoplasm', 'transcriptional<br/>regulation<br/>complex<br/>family')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'secretory<br/>organelles', 'transmembrane<br/>transport<br/>systems')\n", - "\n", - "transmembrane\n", - "transport\n", - "systems\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'secretory<br/>organelles')->('cell', 'cytoplasm', 'secretory<br/>organelles', 'transmembrane<br/>transport<br/>systems')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'secretory<br/>organelles', 'transmembrane<br/>transport<br/>systems', 'ion<br/>transmembrane<br/>transport<br/>systems')\n", - "\n", - "ion\n", - "transmembrane\n", - "transport\n", - "systems\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'secretory<br/>organelles', 'transmembrane<br/>transport<br/>systems')->('cell', 'cytoplasm', 'secretory<br/>organelles', 'transmembrane<br/>transport<br/>systems', 'ion<br/>transmembrane<br/>transport<br/>systems')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles')\n", - "\n", - "subgroup\n", - "of\n", - "cytoplasmic\n", - "organelles\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'metabolic<br/>organelles')\n", - "\n", - "metabolic\n", - "organelles\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'metabolic<br/>organelles')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family')\n", - "\n", - "ribonucleoprotein\n", - "complex\n", - "family\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'metabolic<br/>organelles', 'subgroup<br/>of<br/>metabolic<br/>organelles')\n", - "\n", - "subgroup\n", - "of\n", - "metabolic\n", - "organelles\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'metabolic<br/>organelles')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'metabolic<br/>organelles', 'subgroup<br/>of<br/>metabolic<br/>organelles')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'metabolic<br/>organelles', 'mitochondrion')\n", - "\n", - "mitochondrion\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'metabolic<br/>organelles')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'metabolic<br/>organelles', 'mitochondrion')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'RNA<br/>processing<br/>complex<br/>1')\n", - "\n", - "RNA\n", - "processing\n", - "complex\n", - "1\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'RNA<br/>processing<br/>complex<br/>1')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community')\n", - "\n", - "ribosome\n", - "biogenesis\n", - "community\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'RNA<br/>processing<br/>complex<br/>1', 'RNA<br/>splicing<br/>complex<br/>1')\n", - "\n", - "RNA\n", - "splicing\n", - "complex\n", - "1\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'RNA<br/>processing<br/>complex<br/>1')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'RNA<br/>processing<br/>complex<br/>1', 'RNA<br/>splicing<br/>complex<br/>1')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome')\n", - "\n", - "ribosome\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'nucleic<br/>acid<br/>binding<br/>complex')\n", - "\n", - "nucleic\n", - "acid\n", - "binding\n", - "complex\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'nucleic<br/>acid<br/>binding<br/>complex')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit')\n", - "\n", - "ribosomal\n", - "subunit\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'mitochondirial<br/>large<br/>ribosomal<br/>subunit')\n", - "\n", - "mitochondirial\n", - "large\n", - "ribosomal\n", - "subunit\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'mitochondirial<br/>large<br/>ribosomal<br/>subunit')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'mito-cyto<br/>ribosomal<br/>cluster')\n", - "\n", - "mito-cyto\n", - "ribosomal\n", - "cluster\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'mito-cyto<br/>ribosomal<br/>cluster')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'cotranslational<br/>protein<br/>targeting<br/>to<br/>membrane<br/>system')\n", - "\n", - "cotranslational\n", - "protein\n", - "targeting\n", - "to\n", - "membrane\n", - "system\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'cotranslational<br/>protein<br/>targeting<br/>to<br/>membrane<br/>system')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'ribosomal<br/>complex<br/>5')\n", - "\n", - "ribosomal\n", - "complex\n", - "5\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'ribosomal<br/>complex<br/>5')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'ribosomal<br/>complex<br/>2')\n", - "\n", - "ribosomal\n", - "complex\n", - "2\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit')->('cell', 'cytoplasm', 'cytoplasmic<br/>organelles', 'subgroup<br/>of<br/>cytoplasmic<br/>organelles', 'ribonucleoprotein<br/>complex<br/>family', 'ribosome<br/>biogenesis<br/>community', 'ribosome', 'ribosomal<br/>subunit', 'ribosomal<br/>complex<br/>2')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'transcriptional<br/>regulation<br/>complex<br/>family', 'transcriptional<br/>regulation<br/>complexes')\n", - "\n", - "transcriptional\n", - "regulation\n", - "complexes\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'transcriptional<br/>regulation<br/>complex<br/>family')->('cell', 'cytoplasm', 'transcriptional<br/>regulation<br/>complex<br/>family', 'transcriptional<br/>regulation<br/>complexes')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'DNA<br/>metabolic<br/>assembly')\n", - "\n", - "DNA\n", - "metabolic\n", - "assembly\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus')->('cell', 'nucleus', 'DNA<br/>metabolic<br/>assembly')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nuclear<br/>lumen')\n", - "\n", - "nuclear\n", - "lumen\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus')->('cell', 'nucleus', 'nuclear<br/>lumen')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nuclear<br/>body')\n", - "\n", - "nuclear\n", - "body\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus')->('cell', 'nucleus', 'nuclear<br/>body')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nucleo-plasm<br/>1')\n", - "\n", - "nucleo-plasm\n", - "1\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus')->('cell', 'nucleus', 'nucleo-plasm<br/>1')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nucleo-plasm<br/>2')\n", - "\n", - "nucleo-plasm\n", - "2\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus')->('cell', 'nucleus', 'nucleo-plasm<br/>2')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nuclear<br/>transcriptional<br/>speckle')\n", - "\n", - "nuclear\n", - "transcriptional\n", - "speckle\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus')->('cell', 'nucleus', 'nuclear<br/>transcriptional<br/>speckle')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus')\n", - "\n", - "nucleolus\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nuclear<br/>lumen')->('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nuclear<br/>lumen', 'nuclear<br/>splicing<br/>speckle')\n", - "\n", - "nuclear\n", - "splicing\n", - "speckle\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nuclear<br/>lumen')->('cell', 'nucleus', 'nuclear<br/>lumen', 'nuclear<br/>splicing<br/>speckle')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'ribonucleprotein<br/>complex<br/>family')\n", - "\n", - "ribonucleprotein\n", - "complex\n", - "family\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus')->('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'ribonucleprotein<br/>complex<br/>family')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'RNA<br/>processing<br/>complex<br/>family')\n", - "\n", - "RNA\n", - "processing\n", - "complex\n", - "family\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus')->('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'RNA<br/>processing<br/>complex<br/>family')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'splicosomal<br/>complex<br/>family')\n", - "\n", - "splicosomal\n", - "complex\n", - "family\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus')->('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'splicosomal<br/>complex<br/>family')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'RNA<br/>processing<br/>complex<br/>family', 'RNA<br/>processing<br/>complex<br/>1')\n", - "\n", - "RNA\n", - "processing\n", - "complex\n", - "1\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'RNA<br/>processing<br/>complex<br/>family')->('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'RNA<br/>processing<br/>complex<br/>family', 'RNA<br/>processing<br/>complex<br/>1')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'RNA<br/>processing<br/>complex<br/>family', 'RNA<br/>splicing<br/>complex<br/>family')\n", - "\n", - "RNA\n", - "splicing\n", - "complex\n", - "family\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'RNA<br/>processing<br/>complex<br/>family')->('cell', 'nucleus', 'nuclear<br/>lumen', 'nucleolus', 'RNA<br/>processing<br/>complex<br/>family', 'RNA<br/>splicing<br/>complex<br/>family')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family')\n", - "\n", - "chromosome\n", - "organization\n", - "complex\n", - "family\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nucleo-plasm<br/>1')->('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family', 'chromatin<br/>organization<br/>complex<br/>family')\n", - "\n", - "chromatin\n", - "organization\n", - "complex\n", - "family\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family')->('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family', 'chromatin<br/>organization<br/>complex<br/>family')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family', 'chromatin<br/>organization<br/>complex<br/>family', 'HAT<br/>complex<br/>family')\n", - "\n", - "HAT\n", - "complex\n", - "family\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family', 'chromatin<br/>organization<br/>complex<br/>family')->('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family', 'chromatin<br/>organization<br/>complex<br/>family', 'HAT<br/>complex<br/>family')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family', 'chromatin<br/>organization<br/>complex<br/>family', 'HAT<br/>complex<br/>family', 'NuA4<br/>HAT<br/>complex')\n", - "\n", - "NuA4\n", - "HAT\n", - "complex\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family', 'chromatin<br/>organization<br/>complex<br/>family', 'HAT<br/>complex<br/>family')->('cell', 'nucleus', 'nucleo-plasm<br/>1', 'chromosome<br/>organization<br/>complex<br/>family', 'chromatin<br/>organization<br/>complex<br/>family', 'HAT<br/>complex<br/>family', 'NuA4<br/>HAT<br/>complex')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nucleo-plasm<br/>2', 'chromatin<br/>regulation<br/>complex')\n", - "\n", - "chromatin\n", - "regulation\n", - "complex\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nucleo-plasm<br/>2')->('cell', 'nucleus', 'nucleo-plasm<br/>2', 'chromatin<br/>regulation<br/>complex')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nuclear<br/>transcriptional<br/>speckle', 'negative<br/>regulation<br/>of<br/>RNA<br/>biosynthesis<br/>process')\n", - "\n", - "negative\n", - "regulation\n", - "of\n", - "RNA\n", - "biosynthesis\n", - "process\n", - "\n", - "\n", - "\n", - "('cell', 'nucleus', 'nuclear<br/>transcriptional<br/>speckle')->('cell', 'nucleus', 'nuclear<br/>transcriptional<br/>speckle', 'negative<br/>regulation<br/>of<br/>RNA<br/>biosynthesis<br/>process')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'transcription', 'wires')\n", - "\n", - "wires\n", - "\n", - "\n", - "\n", - "('cell', 'transcription')->('cell', 'transcription', 'wires')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'transcription', 'wires', 'RNA<br/>processing')\n", - "\n", - "RNA\n", - "processing\n", - "\n", - "\n", - "\n", - "('cell', 'transcription', 'wires')->('cell', 'transcription', 'wires', 'RNA<br/>processing')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'transcription', 'wires', 'regulation')\n", - "\n", - "regulation\n", - "\n", - "\n", - "\n", - "('cell', 'transcription', 'wires')->('cell', 'transcription', 'wires', 'regulation')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'transcription', 'wires', 'nucleic<br/>acids')\n", - "\n", - "nucleic\n", - "acids\n", - "\n", - "\n", - "\n", - "('cell', 'transcription', 'wires')->('cell', 'transcription', 'wires', 'nucleic<br/>acids')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'transcription', 'wires', 'negative<br/>regulation')\n", - "\n", - "negative\n", - "regulation\n", - "\n", - "\n", - "\n", - "('cell', 'transcription', 'wires')->('cell', 'transcription', 'wires', 'negative<br/>regulation')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'translation', 'wires')\n", - "\n", - "wires\n", - "\n", - "\n", - "\n", - "('cell', 'translation')->('cell', 'translation', 'wires')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'translation', 'wires', 'ribosomes')\n", - "\n", - "ribosomes\n", - "\n", - "\n", - "\n", - "('cell', 'translation', 'wires')->('cell', 'translation', 'wires', 'ribosomes')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'metabolism', 'wires')\n", - "\n", - "wires\n", - "\n", - "\n", - "\n", - "('cell', 'metabolism')->('cell', 'metabolism', 'wires')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'metabolism', 'wires', 'organelles')\n", - "\n", - "organelles\n", - "\n", - "\n", - "\n", - "('cell', 'metabolism', 'wires')->('cell', 'metabolism', 'wires', 'organelles')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'metabolism', 'wires', 'mitochondrion')\n", - "\n", - "mitochondrion\n", - "\n", - "\n", - "\n", - "('cell', 'metabolism', 'wires')->('cell', 'metabolism', 'wires', 'mitochondrion')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'metabolism', 'wires', 'ion<br/>transport')\n", - "\n", - "ion\n", - "transport\n", - "\n", - "\n", - "\n", - "('cell', 'metabolism', 'wires')->('cell', 'metabolism', 'wires', 'ion<br/>transport')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cell<br/>cycle', 'wires')\n", - "\n", - "wires\n", - "\n", - "\n", - "\n", - "('cell', 'cell<br/>cycle')->('cell', 'cell<br/>cycle', 'wires')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cell<br/>cycle', 'wires', 'DNA')\n", - "\n", - "DNA\n", - "\n", - "\n", - "\n", - "('cell', 'cell<br/>cycle', 'wires')->('cell', 'cell<br/>cycle', 'wires', 'DNA')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cell<br/>cycle', 'wires', 'chromosome')\n", - "\n", - "chromosome\n", - "\n", - "\n", - "\n", - "('cell', 'cell<br/>cycle', 'wires')->('cell', 'cell<br/>cycle', 'wires', 'chromosome')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cell<br/>cycle', 'wires', 'chromatin')\n", - "\n", - "chromatin\n", - "\n", - "\n", - "\n", - "('cell', 'cell<br/>cycle', 'wires')->('cell', 'cell<br/>cycle', 'wires', 'chromatin')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'signalling', 'wires')\n", - "\n", - "wires\n", - "\n", - "\n", - "\n", - "('cell', 'signalling')->('cell', 'signalling', 'wires')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'signalling', 'wires', 'transport')\n", - "\n", - "transport\n", - "\n", - "\n", - "\n", - "('cell', 'signalling', 'wires')->('cell', 'signalling', 'wires', 'transport')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'signalling', 'wires', 'trancript<br/>regulation')\n", - "\n", - "trancript\n", - "regulation\n", - "\n", - "\n", - "\n", - "('cell', 'signalling', 'wires')->('cell', 'signalling', 'wires', 'trancript<br/>regulation')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'protein<br/>transport', 'wires')\n", - "\n", - "wires\n", - "\n", - "\n", - "\n", - "('cell', 'protein<br/>transport')->('cell', 'protein<br/>transport', 'wires')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'protein<br/>transport', 'wires', 'transmembrane<br/>transport')\n", - "\n", - "transmembrane\n", - "transport\n", - "\n", - "\n", - "\n", - "('cell', 'protein<br/>transport', 'wires')->('cell', 'protein<br/>transport', 'wires', 'transmembrane<br/>transport')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'protein<br/>transport', 'wires', 'secretory')\n", - "\n", - "secretory\n", - "\n", - "\n", - "\n", - "('cell', 'protein<br/>transport', 'wires')->('cell', 'protein<br/>transport', 'wires', 'secretory')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'protein<br/>transport', 'wires', 'cotranslation')\n", - "\n", - "cotranslation\n", - "\n", - "\n", - "\n", - "('cell', 'protein<br/>transport', 'wires')->('cell', 'protein<br/>transport', 'wires', 'cotranslation')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'RNA<br/>processing', 'wires')\n", - "\n", - "wires\n", - "\n", - "\n", - "\n", - "('cell', 'RNA<br/>processing')->('cell', 'RNA<br/>processing', 'wires')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'RNA<br/>processing', 'wires', 'processing<br/>complex')\n", - "\n", - "processing\n", - "complex\n", - "\n", - "\n", - "\n", - "('cell', 'RNA<br/>processing', 'wires')->('cell', 'RNA<br/>processing', 'wires', 'processing<br/>complex')\n", - "\n", - "\n", - "\n", - "\n" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 17, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "import copy\n", - "\n", - "transcription_process = {\n", - " '_ports': {\n", - " 'RNA processing': 'Any',\n", - " 'regulation': 'Any',\n", - " 'nucleic acids': 'Any',\n", - " 'negative regulation': 'Any'\n", - " },\n", - " 'wires': {\n", - " 'RNA processing': [\n", - " 'nucleus', 'nuclear lumen', 'nucleolus', 'RNA processing complex family'],\n", - " 'regulation': [\n", - " 'cytoplasm', 'transcriptional regulation complex family', 'transcriptional regulation complexes'],\n", - " 'nucleic acids': [\n", - " 'cytoplasm', 'cytoplasmic organelles', 'subgroup of cytoplasmic organelles', \n", - " 'ribonucleoprotein complex family', 'ribosome biogenesis community', 'nucleic acid binding complex'],\n", - " 'negative regulation': [\n", - " 'nucleus', 'nuclear transcriptional speckle', 'negative regulation of RNA biosynthesis process'],\n", - " }\n", - "}\n", - "\n", - "translation_process = {\n", - " '_ports': {\n", - " 'ribosomes': 'Any',\n", - " 'membrane': 'Any'\n", - " },\n", - " 'wires': {\n", - " 'ribosomes': [\n", - " 'cytoplasm', 'cytoplasmic organelles', 'subgroup of cytoplasmic organelles', 'ribonucleoprotein complex family', 'ribosome biogenesis community', 'ribosome'],\n", - " # 'membrane': ['],\n", - " }\n", - "}\n", - "\n", - "metabolism_process = {\n", - " '_ports': {\n", - " 'organelles': 'Any',\n", - " 'mitochondrion': 'Any',\n", - " 'ion transport': 'Any',\n", - " },\n", - " 'wires': {\n", - " 'organelles': [\n", - " 'cytoplasm', 'cytoplasmic organelles', 'subgroup of cytoplasmic organelles', 'metabolic organelles', ],\n", - " 'mitochondrion': [\n", - " 'cytoplasm', 'cytoplasmic organelles', 'subgroup of cytoplasmic organelles', 'metabolic organelles', 'mitochondrion'],\n", - " 'ion transport': [\n", - " 'cytoplasm', 'secretory organelles', 'transmembrane transport systems', 'ion transmembrane transport systems'],\n", - " }\n", - "}\n", - "\n", - "cell_cycle_process = {\n", - " '_ports': {\n", - " 'DNA': 'Any',\n", - " 'chromosome': 'Any',\n", - " 'chromatin': 'Any',\n", - " },\n", - " 'wires': { \n", - " 'DNA': ['nucleus', 'DNA metabolic assembly'],\n", - " 'chromosome': ['nucleus', 'nucleo-plasm 1', 'chromosome organization complex family',],\n", - " 'chromatin': ['nucleus', 'nucleo-plasm 1', 'chromosome organization complex family', 'chromatin organization complex family'],\n", - " }\n", - "}\n", - "\n", - "signalling_process = {\n", - " '_ports': {\n", - " 'transport': 'Any',\n", - " 'trancript regulation': 'Any',\n", - " },\n", - " 'wires': { \n", - " 'transport': [\n", - " 'cytoplasm', 'secretory organelles', 'transmembrane transport systems'],\n", - " 'trancript regulation': [\n", - " 'cytoplasm', 'transcriptional regulation complex family', 'transcriptional regulation complexes'],\n", - " }\n", - "}\n", - "\n", - "protein_transport_process = {\n", - " '_ports': {\n", - " 'transmembrane transport': 'Any',\n", - " 'secretory': 'Any',\n", - " 'cotranslation': 'Any',\n", - " },\n", - " 'wires': { \n", - " 'transmembrane transport': [\n", - " 'cytoplasm', 'secretory organelles', 'transmembrane transport systems'],\n", - " 'secretory': [\n", - " 'cytoplasm', 'secretory organelles'],\n", - " 'cotranslation': [\n", - " 'cytoplasm', 'cytoplasmic organelles', 'subgroup of cytoplasmic organelles', 'ribonucleoprotein complex family', \n", - " 'ribosome biogenesis community', 'ribosome', 'ribosomal subunit', 'cotranslational protein targeting to membrane system']\n", - " }\n", - "}\n", - "\n", - "rna_processing_process = {\n", - " '_ports': {\n", - " 'processing complex': 'Any',\n", - " },\n", - " 'wires': { \n", - " 'processing complex': [\n", - " 'nucleus', 'nuclear lumen', 'nucleolus', 'RNA processing complex family'],\n", - " }\n", - "}\n", - "\n", - "# compose schema\n", - "music_map['cell']['transcription'] = transcription_process\n", - "music_map['cell']['translation'] = translation_process\n", - "music_map['cell']['metabolism'] = metabolism_process\n", - "music_map['cell']['cell cycle'] = cell_cycle_process\n", - "music_map['cell']['signalling'] = signalling_process\n", - "music_map['cell']['protein transport'] = protein_transport_process\n", - "music_map['cell']['RNA processing'] = rna_processing_process\n", - "\n", - "music_map2 = replace_regex_recursive(music_map)\n", - "\n", - "# plot\n", - "plot_settingsx = copy.deepcopy(plot_settings)\n", - "plot_settingsx['label_margin'] = '0.02'\n", - "plot_settingsx['node_border_colors'] = {\n", - " ('cell', 'translation'): 'blue',\n", - " ('cell', 'transcription'): 'blue',\n", - " ('cell', 'metabolism'): 'blue',\n", - " ('cell', 'cell
cycle'): 'blue',\n", - " ('cell', 'signalling'): 'blue',\n", - " ('cell', 'protein
transport'): 'blue',\n", - " ('cell', 'RNA
processing'): 'blue',\n", - "}\n", - "# plot_settingsx.update({'out_dir': 'out','dpi': '250'})\n", - "plot_bigraph(music_map2, **plot_settingsx, filename='cell_hierarchy_functions')" - ] - }, - { - "cell_type": "code", - "execution_count": 18, - "id": "fe3008ad-498e-449f-8521-6ea29fd903f1", - "metadata": { - "tags": [] - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Writing out/hypothesized_mechanism\n" - ] - }, - { - "data": { - "image/svg+xml": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "bigraph\n", - "\n", - "\n", - "\n", - "('hypothesized<br/>mechanism',)\n", - "\n", - "hypothesized\n", - "mechanism\n", - "\n", - "\n", - "\n" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 18, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "new_process = {\n", - " 'hypothesized mechanism': {\n", - " '_ports': {\n", - " '1': 'Any',\n", - " '2': 'Any',\n", - " }\n", - " }\n", - "}\n", - "\n", - "new_process = replace_regex_recursive(new_process)\n", - "\n", - "# plot\n", - "plot_settingsx = copy.deepcopy(plot_settings)\n", - "plot_settingsx['label_margin'] = '0.03'\n", - "plot_settingsx['node_border_colors'] = {\n", - " ('hypothesized
mechanism',): 'blue',\n", - "}\n", - "plot_settingsx['port_labels'] = False\n", - "plot_bigraph(new_process, **plot_settingsx, filename='hypothesized_mechanism')" - ] - }, - { - "cell_type": "markdown", - "id": "ae52f73c-e384-4880-b18f-47b4c25ce203", - "metadata": {}, - "source": [ - "### Cell structure and function\n", - "Processes represent their functions, we show a more minimal cell structure with added processes." - ] - }, - { - "cell_type": "code", - "execution_count": 24, - "id": "b39417ce-d9a1-4985-abce-ce22df816897", - "metadata": { - "tags": [] - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Writing out/cell\n" - ] - }, - { - "data": { - "image/svg+xml": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "bigraph\n", - "\n", - "\n", - "\n", - "('outputs',)\n", - "\n", - "outputs\n", - "\n", - "\n", - "\n", - "('outputs', 'p1')\n", - "\n", - "p1\n", - "\n", - "\n", - "\n", - "('outputs',)->('outputs', 'p1')\n", - "\n", - "\n", - "\n", - "\n", - "('outputs', 'p2')\n", - "\n", - "p2\n", - "\n", - "\n", - "\n", - "('outputs',)->('outputs', 'p2')\n", - "\n", - "\n", - "\n", - "\n", - "('cell',)\n", - "\n", - "cell\n", - "\n", - "\n", - "\n", - "('cell', 'membrane')\n", - "\n", - "membrane\n", - "\n", - "\n", - "\n", - "('cell',)->('cell', 'membrane')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm')\n", - "\n", - "cytoplasm\n", - "\n", - "\n", - "\n", - "('cell',)->('cell', 'cytoplasm')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleoid')\n", - "\n", - "nucleoid\n", - "\n", - "\n", - "\n", - "('cell',)->('cell', 'nucleoid')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'membrane', 'transmembrane<br/>transport')\n", - "\n", - "transmembrane\n", - "transport\n", - "\n", - "\n", - "\n", - "('cell', 'membrane')->('cell', 'membrane', 'transmembrane<br/>transport')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'membrane', 'transmembrane<br/>transport', 'wires')\n", - "\n", - "wires\n", - "\n", - "\n", - "\n", - "('cell', 'membrane', 'transmembrane<br/>transport')->('cell', 'membrane', 'transmembrane<br/>transport', 'wires')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'metabolites')\n", - "\n", - "metabolites\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm')->('cell', 'cytoplasm', 'metabolites')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'ribosomal<br/>complexes')\n", - "\n", - "ribosomal\n", - "complexes\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm')->('cell', 'cytoplasm', 'ribosomal<br/>complexes')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'transcript<br/>regulation<br/>complex')\n", - "\n", - "transcript\n", - "regulation\n", - "complex\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm')->('cell', 'cytoplasm', 'transcript<br/>regulation<br/>complex')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'translation')\n", - "\n", - "translation\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm')->('cell', 'cytoplasm', 'translation')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'transcript<br/>regulation<br/>complex', 'transcripts')\n", - "\n", - "transcripts\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'transcript<br/>regulation<br/>complex')->('cell', 'cytoplasm', 'transcript<br/>regulation<br/>complex', 'transcripts')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'translation', 'outputs')\n", - "\n", - "outputs\n", - "\n", - "\n", - "\n", - "('cell', 'cytoplasm', 'translation')->('cell', 'cytoplasm', 'translation', 'outputs')\n", - "\n", - "\n", - "\n", - "\n", - "('cell', 'nucleoid', 'chromosome')\n", - "\n", - "chromosome\n", - "\n", - "\n", - "\n", - "('cell', 'nucleoid')->('cell', 'nucleoid', 'chromosome')\n", - "\n", - "\n", - "\n", - "\n" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 24, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "cell_struct_func = {\n", - " 'cell': {\n", - " 'membrane': {\n", - " 'transporters': 'concentrations',\n", - " 'lipids': 'concentrations',\n", - " 'transmembrane transport': {\n", - " '_value': {\n", - " '_process': 'transport URI',\n", - " '_config': {'parameter': 1}\n", - " },\n", - " 'outputs': {\n", - " 'transporters': 'transporters',\n", - " 'internal': ['..', 'cytoplasm', 'metabolites']},\n", - " '_outputs': {\n", - " 'transporters': 'concentrations',\n", - " 'internal': 'concentrations',\n", - " 'external': 'concentrations'\n", - " }\n", - " }\n", - " },\n", - " 'cytoplasm': {\n", - " 'metabolites': {\n", - " '_value': 1.1,\n", - " '_type': 'concentrations'\n", - " },\n", - " 'ribosomal complexes': {\n", - " '_value': 2.2,\n", - " '_type': 'concentrations'\n", - " },\n", - " 'transcript regulation complex': {\n", - " '_value': 0.01,\n", - " 'transcripts': {\n", - " '_value': 0.1,\n", - " '_type': 'concentrations'\n", - " }\n", - " },\n", - " 'translation': {\n", - " '_type': 'process',\n", - " 'outputs': {\n", - " 'p1': ['ribosomal complexes'],\n", - " 'p2': ['transcript regulation complex', 'transcripts']}}},\n", - " 'nucleoid': {\n", - " 'chromosome': {\n", - " 'genes': 'sequences'\n", - " }\n", - " }\n", - " }\n", - "}\n", - "core = TypeSystem()\n", - "core.register('concentrations', 'float')\n", - "cell_struct_func2 = replace_regex_recursive(cell_struct_func)\n", - "plot_bigraph(cell_struct_func2, core=core, remove_process_place_edges=True, out_dir='out', filename='cell')" - ] - }, - { - "cell_type": "markdown", - "id": "188eb4a6-c526-4b38-a22d-97f7fb8b7244", - "metadata": {}, - "source": [ - "### Whole-cell *E. coli* model\n", - "\n", - "We here plot the processes and wiring of a whole-cell model of *E. coli* from [Macklin et al. Simultaneous cross-evaluation of heterogeneous E. coli datasets via mechanistic simulation. Science. 2020.](https://pubmed.ncbi.nlm.nih.gov/32703847/)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "16960d1b-6e35-421e-bb7d-3efe5052e4fc", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "ecoli = { \n", - " 'chromosome-structure': { \n", - " 'wires': {\n", - " 'fragmentBases': ('bulk',),\n", - " 'molecules': ('bulk',),\n", - " 'active_tfs': ('bulk',),\n", - " 'subunits': ('bulk',),\n", - " 'amino_acids': ('bulk',),\n", - " 'active_replisomes': ('unique', 'active_replisome'),\n", - " 'oriCs': ('unique', 'oriC'),\n", - " 'chromosome_domains': ('unique', 'chromosome_domain'),\n", - " 'active_RNAPs': ('unique', 'active_RNAP'),\n", - " 'RNAs': ('unique', 'RNA'),\n", - " 'active_ribosome': ('unique', 'active_ribosome'),\n", - " 'full_chromosomes': ('unique', 'full_chromosome'),\n", - " 'promoters': ('unique', 'promoter'),\n", - " 'DnaA_boxes': ('unique', 'DnaA_box')\n", - " }\n", - " },\n", - " 'metabolism': { \n", - " 'wires': {\n", - " 'metabolites': ('bulk',),\n", - " 'catalysts': ('bulk',),\n", - " 'kinetics_enzymes': ('bulk',),\n", - " 'kinetics_substrates': ('bulk',),\n", - " 'amino_acids': ('bulk',),\n", - " 'environment': ('environment',),\n", - " 'amino_acids_total': ('bulk',)\n", - " }\n", - " },\n", - " 'tf-binding': { \n", - " 'wires': {\n", - " 'promoters': ('unique', 'promoter'),\n", - " 'active_tfs': ('bulk',),\n", - " 'active_tfs_total': ('bulk',),\n", - " 'inactive_tfs_total': ('bulk',),\n", - " }\n", - " },\n", - " 'transcript-initiation': { \n", - " 'wires': {\n", - " 'environment': ('environment',),\n", - " 'full_chromosomes': ('unique', 'full_chromosome'),\n", - " 'RNAs': ('unique', 'RNA'),\n", - " 'active_RNAPs': ('unique', 'active_RNAP'),\n", - " 'promoters': ('unique', 'promoter'),\n", - " 'molecules': ('bulk',),\n", - " }\n", - " },\n", - " 'transcript-elongation': { \n", - " 'wires': {\n", - " 'environment': ('environment',),\n", - " 'RNAs': ('unique', 'RNA'),\n", - " 'active_RNAPs': ('unique', 'active_RNAP'),\n", - " 'molecules': ('bulk',),\n", - " 'bulk_RNAs': ('bulk',),\n", - " 'ntps': ('bulk',),\n", - " }\n", - " },\n", - " 'rna-degradation': { \n", - " 'wires': {\n", - " 'charged_trna': ('bulk',),\n", - " 'bulk_RNAs': ('bulk',),\n", - " 'nmps': ('bulk',),\n", - " 'fragmentMetabolites': ('bulk',),\n", - " 'fragmentBases': ('bulk',),\n", - " 'endoRnases': ('bulk',),\n", - " 'exoRnases': ('bulk',),\n", - " 'subunits': ('bulk',),\n", - " 'molecules': ('bulk',),\n", - " 'RNAs': ('unique', 'RNA'),\n", - " 'active_ribosome': ('unique', 'active_ribosome'),\n", - " }\n", - " },\n", - " 'polypeptide-initiation': { \n", - " 'wires': {\n", - " 'environment': ('environment',),\n", - " 'active_ribosome': ('unique', 'active_ribosome'),\n", - " 'RNA': ('unique', 'RNA'),\n", - " 'subunits': ('bulk',)\n", - " }\n", - " },\n", - " 'polypeptide-elongation': { \n", - " 'wires': {\n", - " 'environment': ('environment',),\n", - " 'active_ribosome': ('unique', 'active_ribosome'),\n", - " 'molecules': ('bulk',),\n", - " 'monomers': ('bulk',),\n", - " 'amino_acids': ('bulk',),\n", - " 'ppgpp_reaction_metabolites': ('bulk',),\n", - " 'uncharged_trna': ('bulk',),\n", - " 'charged_trna': ('bulk',),\n", - " 'charging_molecules': ('bulk',),\n", - " 'synthetases': ('bulk',),\n", - " 'subunits': ('bulk',),\n", - " 'molecules_total': ('bulk',),\n", - " 'amino_acids_total': ('bulk',),\n", - " 'charged_trna_total': ('bulk',),\n", - " 'uncharged_trna_total': ('bulk',)\n", - " }\n", - " },\n", - " 'complexation': {\n", - " 'wires': {\n", - " 'molecules': ('bulk',), \n", - " }\n", - " },\n", - " 'two-component-system': { \n", - " 'wires': {\n", - " 'molecules': ('bulk',)\n", - " }\n", - " },\n", - " 'equilibrium': {\n", - " 'wires': {\n", - " 'molecules': ('bulk',)\n", - " }\n", - " },\n", - " 'protein-degradation': { \n", - " 'wires': {\n", - " 'metabolites': ('bulk',),\n", - " 'proteins': ('bulk',)\n", - " }\n", - " },\n", - " 'chromosome-replication': { \n", - " 'wires': {\n", - " 'replisome_trimers': ('bulk',),\n", - " 'replisome_monomers': ('bulk',),\n", - " 'dntps': ('bulk',),\n", - " 'ppi': ('bulk',),\n", - " 'active_replisomes': ('unique', 'active_replisome'),\n", - " 'oriCs': ('unique', 'oriC'),\n", - " 'chromosome_domains': ('unique', 'chromosome_domain'),\n", - " 'full_chromosomes': ('unique', 'full_chromosome'),\n", - " 'environment': ('environment',)\n", - " }\n", - " },\n", - " 'unique': {\n", - " 'chromosome_domain': {},\n", - " 'full_chromosome': {},\n", - " 'oriC': {},\n", - " 'active_replisome': {},\n", - " 'RNA': {},\n", - " 'active_ribosome': {},\n", - " 'DnaA_box': {},\n", - " 'promoter': {},\n", - " },\n", - " 'bulk': {},\n", - " 'environment': {},\n", - "}\n", - "node_groups = [[ #line up the top nodes for visual effect\n", - " ('unique',), ('bulk',), ('environment',), \n", - " ],\n", - "]\n", - "# plot settings\n", - "plot_settings_ecoli = {\n", - " 'remove_process_place_edges': True,\n", - " 'rankdir': 'RL',\n", - " 'dpi': '100',\n", - " 'out_dir': 'out',\n", - "}\n", - "fig = plot_bigraph(ecoli, **plot_settings_ecoli, node_groups=node_groups, filename='ecoli')" - ] - }, - { - "cell_type": "markdown", - "id": "54e1102d-521c-49cc-8ed2-be26c2b84c3d", - "metadata": { - "tags": [] - }, - "source": [ - "[See E. coli wiring diagram](https://github.com/vivarium-collective/bigraph-viz/blob/main/doc/_static/ecoli.png?raw=true)" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3 (ipykernel)", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.9.6" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -} From 21581b1fa079a02b47ac81eedb6ee324140fb719 Mon Sep 17 00:00:00 2001 From: Eran Date: Mon, 26 Feb 2024 09:07:02 -0500 Subject: [PATCH 08/11] fix tests --- bigraph_viz/__init__.py | 8 ++++++++ bigraph_viz/convert.py | 2 +- bigraph_viz/test.py | 4 ++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/bigraph_viz/__init__.py b/bigraph_viz/__init__.py index 1d78ba1..eff5ac6 100644 --- a/bigraph_viz/__init__.py +++ b/bigraph_viz/__init__.py @@ -1,2 +1,10 @@ +import pprint from bigraph_viz.diagram import plot_bigraph from bigraph_schema import TypeSystem + + +pretty = pprint.PrettyPrinter(indent=2) + + +def pf(x): + return pretty.pformat(x) diff --git a/bigraph_viz/convert.py b/bigraph_viz/convert.py index f60c411..3c705f1 100644 --- a/bigraph_viz/convert.py +++ b/bigraph_viz/convert.py @@ -6,7 +6,7 @@ import copy -from bigraph_viz import plot_bigraph, pp +from bigraph_viz import plot_bigraph from bigraph_viz.dict_utils import deep_merge, absolute_path, nest_path diff --git a/bigraph_viz/test.py b/bigraph_viz/test.py index 088bf99..2294917 100644 --- a/bigraph_viz/test.py +++ b/bigraph_viz/test.py @@ -4,7 +4,7 @@ ===================== """ -from bigraph_viz import plot_bigraph, plot_flow, plot_multitimestep, pp +from bigraph_viz import plot_bigraph #, plot_flow, plot_multitimestep from bigraph_viz.dict_utils import schema_state_to_dict, compose, pf @@ -310,7 +310,7 @@ def test_schema_value_to_dict(): } } schema_state_dict = schema_state_to_dict(schema, state) - pp(schema_state_dict) + print(schema_state_dict) def test_flow(): From e1da847318f4d7e602082fc01c4ee80e8a47d92a Mon Sep 17 00:00:00 2001 From: Eran Date: Tue, 27 Feb 2024 18:43:42 -0500 Subject: [PATCH 09/11] show interval process substore --- bigraph_viz/diagram.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bigraph_viz/diagram.py b/bigraph_viz/diagram.py index 556f8a3..cb8b8e2 100644 --- a/bigraph_viz/diagram.py +++ b/bigraph_viz/diagram.py @@ -7,7 +7,14 @@ import graphviz -PROCESS_SCHEMA_KEYS = ['config', 'address', 'interval', 'inputs', 'outputs', 'instance'] +PROCESS_SCHEMA_KEYS = [ + 'config', + 'address', + # 'interval', + 'inputs', + 'outputs', + 'instance', +] REMOVE_KEYS = ['global_time'] From 846f9a2bfd4f601146f9143a7f5bf2c80e559393 Mon Sep 17 00:00:00 2001 From: Eran Date: Wed, 28 Feb 2024 11:25:14 -0500 Subject: [PATCH 10/11] arg to bring process schema keys back in --- bigraph_viz/__init__.py | 1 + bigraph_viz/diagram.py | 25 +++++++++++++++---------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/bigraph_viz/__init__.py b/bigraph_viz/__init__.py index eff5ac6..6acf92f 100644 --- a/bigraph_viz/__init__.py +++ b/bigraph_viz/__init__.py @@ -1,5 +1,6 @@ import pprint from bigraph_viz.diagram import plot_bigraph +from bigraph_viz.dict_utils import replace_regex_recursive from bigraph_schema import TypeSystem diff --git a/bigraph_viz/diagram.py b/bigraph_viz/diagram.py index cb8b8e2..a74c74d 100644 --- a/bigraph_viz/diagram.py +++ b/bigraph_viz/diagram.py @@ -10,7 +10,7 @@ PROCESS_SCHEMA_KEYS = [ 'config', 'address', - # 'interval', + 'interval', 'inputs', 'outputs', 'instance', @@ -123,10 +123,13 @@ def get_graph_dict( retain_type_keys=False, retain_process_keys=False, remove_nodes=None, + show_process_schema_keys=None, ): path = path or () top_state = top_state or state remove_nodes = remove_nodes or [] + show_process_schema_keys = show_process_schema_keys or [] + removed_process_keys = list(set(PROCESS_SCHEMA_KEYS) - set(show_process_schema_keys)) # initialize bigraph graph_dict = graph_dict or { @@ -158,7 +161,7 @@ def get_graph_dict( is_edge = core.check('edge', value) if is_edge: # this is a process/edge node - if key in PROCESS_SCHEMA_KEYS and not retain_process_keys: + if key in removed_process_keys and not retain_process_keys: continue graph_dict['process_nodes'].append(node_spec) @@ -188,7 +191,7 @@ def get_graph_dict( if isinstance(value, dict): # get subgraph if is_edge: - removed_process_schema_keys = [subpath + (schema_key,) for schema_key in PROCESS_SCHEMA_KEYS] + removed_process_schema_keys = [subpath + (schema_key,) for schema_key in removed_process_keys] remove_nodes.extend(removed_process_schema_keys) graph_dict = get_graph_dict( @@ -400,6 +403,7 @@ def plot_bigraph( invisible_edges=False, # mark_top=False, remove_process_place_edges=False, + show_process_schema_keys=['interval'], ): # get kwargs dict and remove plotting-specific kwargs kwargs = locals() @@ -411,13 +415,13 @@ def plot_bigraph( filename = kwargs.pop('filename') print_source = kwargs.pop('print_source') remove_nodes = kwargs.pop('remove_nodes') - # show_process_schema = kwargs.pop('show_process_schema') + show_process_schema_keys = kwargs.pop('show_process_schema_keys') # set defaults if none provided core = core or TypeSystem() schema = schema or {} - core.register('path', updated_path_type, force=True) + core.register('path', updated_path_type) if not core.exists('step'): core.register('step', step_type) if not core.exists('process'): @@ -431,6 +435,7 @@ def plot_bigraph( state=state, core=core, remove_nodes=remove_nodes, + show_process_schema_keys=show_process_schema_keys, ) # make a figure @@ -522,7 +527,7 @@ def test_bio_schema(): } }} - plot_bigraph(b, filename='bioschema') + plot_bigraph(b, filename='bioschema', show_process_schema_keys=[]) def test_input_output(): flat_composite_spec = { @@ -599,8 +604,8 @@ def test_nested_processes(): filename='nested_composite') if __name__ == '__main__': - # test_diagram_plot() - # test_bio_schema() - # test_input_output() - # test_multi_processes() + test_diagram_plot() + test_bio_schema() + test_input_output() + test_multi_processes() test_nested_processes() \ No newline at end of file From d53ec8956f3fd9943703926cd388e44ff545877c Mon Sep 17 00:00:00 2001 From: Eran Date: Wed, 28 Feb 2024 11:42:16 -0500 Subject: [PATCH 11/11] remove test file --- bigraph_viz/test.py | 480 ---------------------- notebooks/basics.ipynb | 638 +++++++++++++++++++++-------- notebooks/format.ipynb | 883 +++-------------------------------------- 3 files changed, 524 insertions(+), 1477 deletions(-) delete mode 100644 bigraph_viz/test.py diff --git a/bigraph_viz/test.py b/bigraph_viz/test.py deleted file mode 100644 index 2294917..0000000 --- a/bigraph_viz/test.py +++ /dev/null @@ -1,480 +0,0 @@ -""" -===================== -Tests for bigraph-viz -===================== -""" - -from bigraph_viz import plot_bigraph #, plot_flow, plot_multitimestep -from bigraph_viz.dict_utils import schema_state_to_dict, compose, pf - - -# testing functions -plot_settings_test = { - 'remove_process_place_edges': True, - 'show_values': True, - 'show_types': True, - 'dpi': '250', - 'out_dir': 'out' -} - - -def test_noschemakeys(): - simple_store_spec = { - 'store1': 1.0, - } - plot_bigraph(simple_store_spec, **plot_settings_test, filename='store_nokeys') - - -def test_simple_spec(): - simple_store_spec = { - 'store1': { - '_value': 1.0, - '_type': 'float', - }, - } - plot_bigraph(simple_store_spec, **plot_settings_test, filename='simple_store') - - -def test_composite_spec(): - composite_spec = { - 'store1': { - 'store1.1': { - '_value': 1.1, - '_type': 'float' - }, - 'store1.2': { - '_value': 2, - '_type': 'int' - }, - 'process1': { - '_inputs': { - 'port1': {'_type': 'type'}, - 'port2': {'_type': 'type'}, - }, - '_wires': { - 'port1': 'store1.1', - 'port2': 'store1.2', - } - }, - }, - 'process3': { - '_wires': { - 'port1': 'store1' - } - } # TODO -- wires without ports should not work. - } - plot_bigraph(composite_spec, **plot_settings_test, filename='nested_composite') - - -def test_disconnected_process_spec(): - # disconnected processes - process_schema = { - '_ports': { - 'port1': {'_type': 'type'}, - 'port2': {'_type': 'type'} - } - } - process_spec = { - 'process1': process_schema, - 'process2': process_schema, - 'process3': process_schema, - } - plot_bigraph(process_spec, **plot_settings_test, rankdir='BT', filename='disconnected_processes') - - -nested_processes = { - 'cell': { - 'membrane': { - 'transporters': {'_type': 'concentrations'}, - 'lipids': {'_type': 'concentrations'}, - 'transmembrane transport': { - '_value': { - '_process': 'transport URI', - '_config': {'parameter': 1} - }, - '_wires': { - 'transporters': 'transporters', - 'internal': ['..', 'cytoplasm', 'metabolites']}, - '_ports': { - 'transporters': {'_type': 'concentrations'}, - 'internal': {'_type': 'concentrations'}, - 'external': {'_type': 'concentrations'} - } - } - }, - 'cytoplasm': { - 'metabolites': { - '_value': 1.1, - '_type': 'concentrations' - }, - 'ribosomal complexes': { - '_value': 2.2, - '_type': 'concentrations' - }, - 'transcript regulation complex': { - '_value': 0.01, - '_type': 'concentrations', - 'transcripts': { - '_value': 0.1, - '_type': 'concentrations' - } - }, - 'translation': { - '_wires': { - 'p1': 'ribosomal complexes', - 'p2': ['transcript regulation complex', 'transcripts']}}}, - 'nucleoid': { - 'chromosome': { - 'genes': 'sequences' - } - } - } -} - - -def test_nested_spec(): - plot_bigraph(nested_processes, **plot_settings_test, filename='nested_processes') - - -def test_composite_process_spec(): - composite_process_spec = { - 'composite_process': { - 'store1.1': { - '_value': 1.1, '_type': 'float' - }, - 'store1.2': { - '_value': 2, '_type': 'int' - }, - 'process1': { - '_ports': { - 'port1': 'type', - 'port2': 'type', - }, - '_wires': { - 'port1': 'store1.1', - 'port2': 'store1.2', - } - }, - 'process2': { - '_ports': { - 'port1': {'_type': 'type'}, - 'port2': {'_type': 'type'}, - }, - '_wires': { - 'port1': 'store1.1', - 'port2': 'store1.2', - } - }, - '_ports': { - 'port1': {'_type': 'type'}, - 'port2': {'_type': 'type'}, - }, - '_tunnels': { - 'port1': 'store1.1', - 'port2': 'store1.2', - } - } - } - plot_bigraph(composite_process_spec, - **plot_settings_test, - filename='composite_process' - ) - - -def test_merging(): - - cell_structure1 = { - 'cell': { - 'membrane': { - 'transporters': {'_type': 'concentrations'}, - 'lipids': {'_type': 'concentrations'}, - }, - 'cytoplasm': { - 'metabolites': { - '_value': 1.1, '_type': 'concentrations' - }, - 'ribosomal complexes': { - '_value': 2.2, '_type': 'concentrations' - }, - 'transcript regulation complex': { - '_value': 0.01, '_type': 'concentrations', - 'transcripts': { - '_value': 0.1, '_type': 'concentrations' - }, - }, - }, - 'nucleoid': { - 'chromosome': { - 'genes': 'sequences' - } - } - } - } - - # add processes - transport_process = { - 'transmembrane transport': { - '_wires': { - 'transporters': 'transporters', - 'internal': ['..', 'cytoplasm', 'metabolites'], - } - } - } - translation_process = { - 'translation': { - '_wires': { - 'p1': 'ribosomal complexes', - 'p2': ['transcript regulation complex', 'transcripts'], - } - } - } - cell_with_transport1 = compose(cell_structure1, node=transport_process, path=('cell', 'membrane')) - cell_with_transport2 = compose(cell_with_transport1, node=translation_process, path=('cell', 'cytoplasm')) - - print('BEFORE') - print(pf(cell_with_transport2['cell']['membrane']['transmembrane transport']['_wires'])) - plot_bigraph(cell_with_transport2) - print('AFTER') - print(pf(cell_with_transport2['cell']['membrane']['transmembrane transport']['_wires'])) - - -def test_schema_value_to_dict(): - schema = { - 'store1': { - 'store1.1': 'float', - 'store1.2': 'int' - } - } - value = { - 'store1': { - 'store1.1': 1.1, - 'store1.2': 2 - } - } - expected = { - 'store1': { - 'store1.1': { - '_value': 1.1, - '_type': 'float' - }, - 'store1.2': { - '_value': 2, - '_type': 'int' - } - } - } - - schema_state_dict = schema_state_to_dict(schema, value) - assert schema_state_dict == expected - - schema = { - 'store1': { - 'store1.1': 'float', - 'store1.2': 'int', - 'process1': { - '_ports': { - 'port1': 'type', - 'port2': 'type', - }, - }, - 'process2': { - '_ports': { - 'port1': 'type', - 'port2': 'type', - }, - }, - }, - 'process3': {} - } - state = { - 'store1': { - 'store1.1': 1.1, - 'store1.2': 2, - 'process1': { - '_wires': { - 'port1': 'store1.1', - 'port2': 'store1.2', - } - }, - 'process2': { - '_wires': { - 'port1': 'store1.1', - 'port2': 'store1.2', - } - }, - }, - 'process3': { - '_wires': { - 'port1': 'store1', - } - } - } - schema_state_dict = schema_state_to_dict(schema, state) - print(schema_state_dict) - - -def test_flow(): - process_schema = { - '_type': 'step_process', - '_ports': { - 'port1': {'_type': 'type'}, - 'port2': {'_type': 'type'}}} - - flow_spec = { - 'step1': { - '_depends_on': [], - **process_schema}, - 'step2': { - '_depends_on': 'step1', - **process_schema}, - 'step3': { - '_depends_on': [], - **process_schema}, - 'step4': { - '_depends_on': ['step2', 'step3'], - **process_schema}} - plot_flow(flow_spec, out_dir='out', filename='flow') - - -def test_multitimestep(): - process_spec = { - 'process1': { - '_ports': {'port1': {'_type': 'type'}}, - '_wires': {'port1': 'state1'}, - '_sync_step': 1.0, - }, - 'process2': { - '_ports': {'port1': {'_type': 'type'}}, - '_wires': {'port1': 'state1'}, - '_sync_step': 0.5, - }, - # 'process3': { - # '_ports': {'port1': {'_type': 'type'}}, - # '_wires': {'port1': 'state1'}, - # '_sync_step': 0.4, - # }, - } - plot_multitimestep(process_spec, total_time=3, out_dir='out', filename='multitimestep') - - -def test_multitimestep2(): - process_spec2 = { - 'A': { - 'process1': { - '_ports': {'port1': {'_type': 'type'}}, - '_wires': {'port1': 'B'}, - '_sync_step': 1.0, - }, - }, - 'process2': { - '_ports': { - 'port1': {'_type': 'type'}, - 'port2': {'_type': 'type'}}, - '_wires': { - 'port1': ['A', 'B'], - 'port2': 'C', - }, - '_sync_step': 0.5, - }, - 'process3': { - '_ports': {'port1': {'_type': 'type'}}, - '_wires': {'port1': 'C'}, - '_sync_step': 0.6, - }, - 'D': { - 'process4': { - '_ports': {'port1': {'_type': 'type'}}, - '_wires': {'port1': ['..', 'A', 'B']}, - '_sync_step': 0.8, - }, - } - } - plot_multitimestep(process_spec2, total_time=4, out_dir='out', filename='multitimestep_2') - - -def test_color_format(): - nested_composite_spec = { - 'store1': { - 'store1.1': { - '_value': 1.1, - '_type': 'float', - }, - 'store1.2': { - '_value': 2, - '_type': 'int', - }, - 'process1': { - '_ports': { - 'port1': {'_type': 'type'}, - 'port2': {'_type': 'type'}, - }, - '_wires': { - 'port1': 'store1.1', - 'port2': 'store1.2', - } - }, - 'process2': { - '_ports': { - 'port1': {'_type': 'type'}, - 'port2': {'_type': 'type'}, - }, - '_wires': { - 'port1': 'store1.1', - 'port2': 'store1.2', - } - }, - }, - 'process3': { - '_wires': { - 'port1': 'store1', - } - } - } - plot_settings = {'out_dir': 'out'} - plot_settings['node_border_colors'] = { - ('store1', 'store1.1'): 'blue' - } - plot_settings['node_fill_colors'] = { - ('store1', 'store1.2'): 'red' - } - plot_bigraph(nested_composite_spec, **plot_settings, filename='node_colors') - - -def test_undeclared_nodes(): - instance = { - 'process1': { - 'process_location': '0-000-00000-0', - 'update_method': 'KiSAO id', - '_wires': { - 'port A': 'a', - } - } - } - plot_bigraph( - instance, dpi='250', out_dir='out', filename='undeclared_nodes') - plot_bigraph( - instance, show_values=True, show_types=True, dpi='250', out_dir='out', filename='undeclared_nodes_types') - - -def test_collapse_nodes(): - plot_bigraph(nested_processes, - **plot_settings_test, - collapse_processes=True, - filename='nested_processes_collapsed') - - -if __name__ == '__main__': - # test_noschemakeys() - # test_simple_spec() - # test_composite_spec() - # test_disconnected_process_spec() - # test_nested_spec() - # test_composite_process_spec() - # test_merging() - # # test_schema_value_to_dict() - # test_flow() - # test_multitimestep() - # test_multitimestep2() - # test_color_format() - # test_undeclared_nodes() - test_collapse_nodes() diff --git a/notebooks/basics.ipynb b/notebooks/basics.ipynb index d485be6..9d4033b 100644 --- a/notebooks/basics.ipynb +++ b/notebooks/basics.ipynb @@ -35,9 +35,9 @@ "name": "stdout", "output_type": "stream", "text": [ - "-e git+https://github.com/vivarium-collective/bigraph-schema.git@01a8525182a2de039a16223f086852ee602ac3a3#egg=bigraph_schema\n", - "-e git+https://github.com/vivarium-collective/bigraph-viz.git@84569678815db0194e2ce453dcd6443c798266ea#egg=bigraph_viz\n", - "-e git+https://github.com/vivarium-collective/process-bigraph.git@830e3ae01fe4e9c6d81ce9c29c47868b2c74a1d1#egg=process_bigraph\n" + "-e git+https://github.com/vivarium-collective/bigraph-schema.git@179fd0debf76555d4126c77da30a649fb4f19d1b#egg=bigraph_schema\n", + "-e git+https://github.com/vivarium-collective/bigraph-viz.git@846f9a2bfd4f601146f9143a7f5bf2c80e559393#egg=bigraph_viz\n", + "-e git+https://github.com/vivarium-collective/process-bigraph.git@06705156de3ad9a0f50da9025103d4a4c3710223#egg=process_bigraph\n" ] } ], @@ -65,8 +65,7 @@ "outputs": [], "source": [ "# from bigraph_viz import plot_bigraph, plot_flow, plot_multitimestep, pf\n", - "from bigraph_viz.dict_utils import replace_regex_recursive\n", - "from bigraph_viz import plot_bigraph, TypeSystem\n", + "from bigraph_viz import plot_bigraph, replace_regex_recursive, TypeSystem\n", "\n", "plot_settings = {\n", " 'remove_process_place_edges': True\n", @@ -134,7 +133,7 @@ "\n" ], "text/plain": [ - "" + "" ] }, "execution_count": 3, @@ -195,7 +194,7 @@ "\n" ], "text/plain": [ - "" + "" ] }, "execution_count": 4, @@ -325,7 +324,7 @@ "\n" ], "text/plain": [ - "" + "" ] }, "execution_count": 5, @@ -419,7 +418,7 @@ "\n" ], "text/plain": [ - "" + "" ] }, "execution_count": 6, @@ -470,82 +469,115 @@ "\n", "\n", - "\n", - "\n", + "\n", + "\n", "bigraph\n", - "\n", - "\n", + "\n", + "\n", "\n", + "('process1', 'interval')\n", + "\n", + "interval\n", + "\n", + "\n", + "\n", + "('process2', 'interval')\n", + "\n", + "interval\n", + "\n", + "\n", + "\n", + "('process3', 'interval')\n", + "\n", + "interval\n", + "\n", + "\n", + "\n", "('process1',)\n", - "\n", - "process1\n", + "\n", + "process1\n", + "\n", + "\n", + "\n", + "('process1',)->('process1', 'interval')\n", + "\n", "\n", "\n", - "\n", + "\n", "('process2',)\n", - "\n", - "process2\n", + "\n", + "process2\n", + "\n", + "\n", + "\n", + "('process2',)->('process2', 'interval')\n", + "\n", "\n", "\n", - "\n", + "\n", "('process3',)\n", - "\n", - "process3\n", + "\n", + "process3\n", + "\n", + "\n", + "\n", + "('process3',)->('process3', 'interval')\n", + "\n", "\n", "\n", "\n", - "\n", + "\n", "('process1', 'p', 'o', 'r', 't', '1')->('process1',)\n", - "\n", - "\n", - "port1\n", + "\n", + "\n", + "port1\n", "\n", "\n", "\n", - "\n", + "\n", "('process2', 'p', 'o', 'r', 't', '1')->('process2',)\n", - "\n", - "\n", - "port1\n", + "\n", + "\n", + "port1\n", "\n", "\n", "\n", - "\n", + "\n", "('process3', 'p', 'o', 'r', 't', '1')->('process3',)\n", - "\n", - "\n", - "port1\n", + "\n", + "\n", + "port1\n", "\n", "\n", "\n", - "\n", + "\n", "('process1', 'p', 'o', 'r', 't', '2')->('process1',)\n", - "\n", - "\n", - "port2\n", + "\n", + "\n", + "port2\n", "\n", "\n", "\n", - "\n", + "\n", "('process2', 'p', 'o', 'r', 't', '2')->('process2',)\n", - "\n", - "\n", - "port2\n", + "\n", + "\n", + "port2\n", "\n", "\n", "\n", - "\n", + "\n", "('process3', 'p', 'o', 'r', 't', '2')->('process3',)\n", - "\n", - "\n", - "port2\n", + "\n", + "\n", + "port2\n", "\n", "\n", "\n" ], "text/plain": [ - "" + "" ] }, "execution_count": 7, @@ -657,7 +689,7 @@ "\n" ], "text/plain": [ - "" + "" ] }, "execution_count": 8, @@ -735,68 +767,90 @@ "\n", "\n", - "\n", + "\n", "\n", "bigraph\n", - "\n", + "\n", "\n", "\n", "('store1.1',)\n", - "\n", - "store1.1\n", + "\n", + "store1.1\n", "\n", "\n", - "\n", + "\n", "('process1',)\n", - "\n", - "process1\n", + "\n", + "process1\n", "\n", "\n", - "\n", + "\n", "('store1.1',)->('process1',)\n", - "\n", - "\n", - "port1\n", + "\n", + "\n", + "port1\n", "\n", "\n", - "\n", + "\n", "('process2',)\n", - "\n", - "process2\n", + "\n", + "process2\n", "\n", "\n", - "\n", + "\n", "('store1.1',)->('process2',)\n", - "\n", - "\n", - "port1\n", + "\n", + "\n", + "port1\n", "\n", "\n", "\n", "('store1.2',)\n", - "\n", - "store1.2\n", + "\n", + "store1.2\n", "\n", "\n", - "\n", + "\n", "('store1.2',)->('process1',)\n", - "\n", - "\n", - "port2\n", + "\n", + "\n", + "port2\n", "\n", "\n", - "\n", + "\n", "('store1.2',)->('process2',)\n", - "\n", - "\n", - "port2\n", + "\n", + "\n", + "port2\n", + "\n", + "\n", + "\n", + "('process1', 'interval')\n", + "\n", + "interval\n", + "\n", + "\n", + "\n", + "('process2', 'interval')\n", + "\n", + "interval\n", + "\n", + "\n", + "\n", + "('process1',)->('process1', 'interval')\n", + "\n", + "\n", + "\n", + "\n", + "('process2',)->('process2', 'interval')\n", + "\n", "\n", "\n", "\n" ], "text/plain": [ - "" + "" ] }, "execution_count": 9, @@ -857,107 +911,118 @@ "\n", "\n", - "\n", - "\n", + "\n", + "\n", "bigraph\n", - "\n", + "\n", "\n", "\n", "('store1',)\n", - "\n", - "store1\n", + "\n", + "store1\n", "\n", "\n", "\n", "('store1', 'store1.1')\n", - "\n", - "store1.1\n", + "\n", + "store1.1\n", "\n", "\n", "\n", "('store1',)->('store1', 'store1.1')\n", - "\n", + "\n", "\n", "\n", "\n", "('store1', 'store1.2')\n", - "\n", - "store1.2\n", + "\n", + "store1.2\n", "\n", "\n", "\n", "('store1',)->('store1', 'store1.2')\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "('store1', 'process1')\n", - "\n", - "process1\n", + "\n", + "process1\n", "\n", "\n", "\n", "('store1',)->('store1', 'process1')\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "('store1', 'process2')\n", - "\n", - "process2\n", + "\n", + "process2\n", "\n", "\n", "\n", "('store1',)->('store1', 'process2')\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "('process3',)\n", - "\n", - "process3\n", + "\n", + "process3\n", "\n", "\n", - "\n", + "\n", "('store1',)->('process3',)\n", - "\n", - "\n", - "port1\n", + "\n", + "\n", + "port1\n", "\n", "\n", - "\n", + "\n", "('store1', 'store1.1')->('store1', 'process1')\n", - "\n", - "\n", - "port1\n", + "\n", + "\n", + "port1\n", "\n", "\n", - "\n", + "\n", "('store1', 'store1.1')->('store1', 'process2')\n", - "\n", - "\n", - "port1\n", + "\n", + "\n", + "port1\n", "\n", "\n", - "\n", + "\n", "('store1', 'store1.2')->('store1', 'process1')\n", - "\n", - "\n", - "port2\n", + "\n", + "\n", + "port2\n", "\n", "\n", - "\n", + "\n", "('store1', 'store1.2')->('store1', 'process2')\n", - "\n", - "\n", - "port2\n", + "\n", + "\n", + "port2\n", + "\n", + "\n", + "\n", + "('process3', 'interval')\n", + "\n", + "interval\n", + "\n", + "\n", + "\n", + "('process3',)->('process3', 'interval')\n", + "\n", "\n", "\n", "\n" ], "text/plain": [ - "" + "" ] }, "execution_count": 10, @@ -1008,10 +1073,247 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 11, "id": "638c5dc7-4cfd-46e4-b66a-8c42ca98ff1d", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Writing out/composite_process\n" + ] + }, + { + "data": { + "image/svg+xml": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "bigraph\n", + "\n", + "\n", + "\n", + "('composite_process',)\n", + "\n", + "composite_process\n", + "\n", + "\n", + "\n", + "('composite_process', 'store1.1')\n", + "\n", + "store1.1\n", + "\n", + "\n", + "\n", + "('composite_process',)->('composite_process', 'store1.1')\n", + "\n", + "\n", + "\n", + "\n", + "('composite_process', 'store1.2')\n", + "\n", + "store1.2\n", + "\n", + "\n", + "\n", + "('composite_process',)->('composite_process', 'store1.2')\n", + "\n", + "\n", + "\n", + "\n", + "('composite_process', 'process1')\n", + "\n", + "process1\n", + "\n", + "\n", + "\n", + "('composite_process',)->('composite_process', 'process1')\n", + "\n", + "\n", + "\n", + "\n", + "('composite_process', 'process2')\n", + "\n", + "process2\n", + "\n", + "\n", + "\n", + "('composite_process',)->('composite_process', 'process2')\n", + "\n", + "\n", + "\n", + "\n", + "('composite_process', 'process1', 'outputs')\n", + "\n", + "outputs\n", + "\n", + "\n", + "\n", + "('composite_process', 'process1')->('composite_process', 'process1', 'outputs')\n", + "\n", + "\n", + "\n", + "\n", + "('composite_process', 'process1', 'inputs')\n", + "\n", + "inputs\n", + "\n", + "\n", + "\n", + "('composite_process', 'process1')->('composite_process', 'process1', 'inputs')\n", + "\n", + "\n", + "\n", + "\n", + "('composite_process', 'process1', 'address')\n", + "\n", + "address\n", + "\n", + "\n", + "\n", + "('composite_process', 'process1')->('composite_process', 'process1', 'address')\n", + "\n", + "\n", + "\n", + "\n", + "('composite_process', 'process1', 'config')\n", + "\n", + "config\n", + "\n", + "\n", + "\n", + "('composite_process', 'process1')->('composite_process', 'process1', 'config')\n", + "\n", + "\n", + "\n", + "\n", + "('composite_process', 'process1', 'interval')\n", + "\n", + "interval\n", + "\n", + "\n", + "\n", + "('composite_process', 'process1')->('composite_process', 'process1', 'interval')\n", + "\n", + "\n", + "\n", + "\n", + "('composite_process', 'process1', 'outputs', 'port1')\n", + "\n", + "port1\n", + "\n", + "\n", + "\n", + "('composite_process', 'process1', 'outputs')->('composite_process', 'process1', 'outputs', 'port1')\n", + "\n", + "\n", + "\n", + "\n", + "('composite_process', 'process1', 'outputs', 'port2')\n", + "\n", + "port2\n", + "\n", + "\n", + "\n", + "('composite_process', 'process1', 'outputs')->('composite_process', 'process1', 'outputs', 'port2')\n", + "\n", + "\n", + "\n", + "\n", + "('composite_process', 'process2', 'outputs')\n", + "\n", + "outputs\n", + "\n", + "\n", + "\n", + "('composite_process', 'process2')->('composite_process', 'process2', 'outputs')\n", + "\n", + "\n", + "\n", + "\n", + "('composite_process', 'process2', 'inputs')\n", + "\n", + "inputs\n", + "\n", + "\n", + "\n", + "('composite_process', 'process2')->('composite_process', 'process2', 'inputs')\n", + "\n", + "\n", + "\n", + "\n", + "('composite_process', 'process2', 'address')\n", + "\n", + "address\n", + "\n", + "\n", + "\n", + "('composite_process', 'process2')->('composite_process', 'process2', 'address')\n", + "\n", + "\n", + "\n", + "\n", + "('composite_process', 'process2', 'config')\n", + "\n", + "config\n", + "\n", + "\n", + "\n", + "('composite_process', 'process2')->('composite_process', 'process2', 'config')\n", + "\n", + "\n", + "\n", + "\n", + "('composite_process', 'process2', 'interval')\n", + "\n", + "interval\n", + "\n", + "\n", + "\n", + "('composite_process', 'process2')->('composite_process', 'process2', 'interval')\n", + "\n", + "\n", + "\n", + "\n", + "('composite_process', 'process2', 'outputs', 'port1')\n", + "\n", + "port1\n", + "\n", + "\n", + "\n", + "('composite_process', 'process2', 'outputs')->('composite_process', 'process2', 'outputs', 'port1')\n", + "\n", + "\n", + "\n", + "\n", + "('composite_process', 'process2', 'outputs', 'port2')\n", + "\n", + "port2\n", + "\n", + "\n", + "\n", + "('composite_process', 'process2', 'outputs')->('composite_process', 'process2', 'outputs', 'port2')\n", + "\n", + "\n", + "\n", + "\n" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "composite_process_spec = {\n", " 'composite_process': {\n", @@ -1765,7 +2067,7 @@ "\n" ], "text/plain": [ - "" + "" ] }, "execution_count": 15, @@ -2817,7 +3119,7 @@ "\n" ], "text/plain": [ - "" + "" ] }, "execution_count": 17, @@ -2958,7 +3260,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 23, "id": "fe3008ad-498e-449f-8521-6ea29fd903f1", "metadata": { "tags": [] @@ -2980,26 +3282,40 @@ "\n", "\n", - "\n", - "\n", + "\n", + "\n", "bigraph\n", - "\n", + "\n", "\n", "\n", "('hypothesized<br/>mechanism',)\n", - "\n", - "hypothesized\n", - "mechanism\n", + "\n", + "hypothesized\n", + "mechanism\n", + "\n", + "\n", + "\n", + "\n", + "('hypothesized<br/>mechanism', '1')->('hypothesized<br/>mechanism',)\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "('hypothesized<br/>mechanism', '2')->('hypothesized<br/>mechanism',)\n", + "\n", + "\n", "\n", "\n", "\n" ], "text/plain": [ - "" + "" ] }, - "execution_count": 18, + "execution_count": 23, "metadata": {}, "output_type": "execute_result" } @@ -3007,7 +3323,8 @@ "source": [ "new_process = {\n", " 'hypothesized mechanism': {\n", - " '_ports': {\n", + " '_type': 'step',\n", + " '_inputs': {\n", " '1': 'Any',\n", " '2': 'Any',\n", " }\n", @@ -3037,7 +3354,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 25, "id": "b39417ce-d9a1-4985-abce-ce22df816897", "metadata": { "tags": [] @@ -3050,27 +3367,30 @@ "traceback": [ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[0;31mRecursionError\u001b[0m Traceback (most recent call last)", - "Cell \u001b[0;32mIn[19], line 52\u001b[0m\n\u001b[1;32m 50\u001b[0m core\u001b[38;5;241m.\u001b[39mregister(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mconcentrations\u001b[39m\u001b[38;5;124m'\u001b[39m, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mfloat\u001b[39m\u001b[38;5;124m'\u001b[39m)\n\u001b[1;32m 51\u001b[0m cell_struct_func2 \u001b[38;5;241m=\u001b[39m replace_regex_recursive(cell_struct_func)\n\u001b[0;32m---> 52\u001b[0m \u001b[43mplot_bigraph\u001b[49m\u001b[43m(\u001b[49m\u001b[43mcell_struct_func2\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mcore\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mcore\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mremove_process_place_edges\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43;01mTrue\u001b[39;49;00m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mout_dir\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mout\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mfilename\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mcell\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m)\u001b[49m\n", - "File \u001b[0;32m~/code/bigraph-viz/bigraph_viz/diagram.py:410\u001b[0m, in \u001b[0;36mplot_bigraph\u001b[0;34m(state, schema, core, out_dir, filename, file_format, size, node_label_size, show_values, show_types, port_labels, port_label_size, rankdir, print_source, dpi, label_margin, node_border_colors, node_fill_colors, node_groups, remove_nodes, invisible_edges, remove_process_place_edges)\u001b[0m\n\u001b[1;32m 407\u001b[0m schema, state \u001b[38;5;241m=\u001b[39m core\u001b[38;5;241m.\u001b[39mcomplete(schema, state)\n\u001b[1;32m 409\u001b[0m \u001b[38;5;66;03m# parse out the network\u001b[39;00m\n\u001b[0;32m--> 410\u001b[0m graph_dict \u001b[38;5;241m=\u001b[39m \u001b[43mget_graph_dict\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 411\u001b[0m \u001b[43m \u001b[49m\u001b[43mschema\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mschema\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 412\u001b[0m \u001b[43m \u001b[49m\u001b[43mstate\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mstate\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 413\u001b[0m \u001b[43m \u001b[49m\u001b[43mcore\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mcore\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 414\u001b[0m \u001b[43m \u001b[49m\u001b[43mremove_nodes\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mremove_nodes\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 415\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 417\u001b[0m \u001b[38;5;66;03m# make a figure\u001b[39;00m\n\u001b[1;32m 418\u001b[0m graph \u001b[38;5;241m=\u001b[39m get_graphviz_fig(graph_dict, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n", - "File \u001b[0;32m~/code/bigraph-viz/bigraph_viz/diagram.py:176\u001b[0m, in \u001b[0;36mget_graph_dict\u001b[0;34m(schema, state, core, graph_dict, path, top_state, retain_type_keys, retain_process_keys, remove_nodes)\u001b[0m\n\u001b[1;32m 173\u001b[0m removed_process_schema_keys \u001b[38;5;241m=\u001b[39m [subpath \u001b[38;5;241m+\u001b[39m (schema_key,) \u001b[38;5;28;01mfor\u001b[39;00m schema_key \u001b[38;5;129;01min\u001b[39;00m PROCESS_SCHEMA_KEYS]\n\u001b[1;32m 174\u001b[0m remove_nodes\u001b[38;5;241m.\u001b[39mextend(removed_process_schema_keys)\n\u001b[0;32m--> 176\u001b[0m graph_dict \u001b[38;5;241m=\u001b[39m \u001b[43mget_graph_dict\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 177\u001b[0m \u001b[43m \u001b[49m\u001b[43mschema\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mschema\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget\u001b[49m\u001b[43m(\u001b[49m\u001b[43mkey\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mschema\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 178\u001b[0m \u001b[43m \u001b[49m\u001b[43mstate\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mvalue\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 179\u001b[0m \u001b[43m \u001b[49m\u001b[43mcore\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mcore\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 180\u001b[0m \u001b[43m \u001b[49m\u001b[43mgraph_dict\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mgraph_dict\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 181\u001b[0m \u001b[43m \u001b[49m\u001b[43mpath\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43msubpath\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 182\u001b[0m \u001b[43m \u001b[49m\u001b[43mtop_state\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mtop_state\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 183\u001b[0m \u001b[43m \u001b[49m\u001b[43mremove_nodes\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mremove_nodes\u001b[49m\n\u001b[1;32m 184\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 186\u001b[0m \u001b[38;5;66;03m# get the place edge\u001b[39;00m\n\u001b[1;32m 187\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m node \u001b[38;5;129;01min\u001b[39;00m value\u001b[38;5;241m.\u001b[39mkeys():\n", - "File \u001b[0;32m~/code/bigraph-viz/bigraph_viz/diagram.py:176\u001b[0m, in \u001b[0;36mget_graph_dict\u001b[0;34m(schema, state, core, graph_dict, path, top_state, retain_type_keys, retain_process_keys, remove_nodes)\u001b[0m\n\u001b[1;32m 173\u001b[0m removed_process_schema_keys \u001b[38;5;241m=\u001b[39m [subpath \u001b[38;5;241m+\u001b[39m (schema_key,) \u001b[38;5;28;01mfor\u001b[39;00m schema_key \u001b[38;5;129;01min\u001b[39;00m PROCESS_SCHEMA_KEYS]\n\u001b[1;32m 174\u001b[0m remove_nodes\u001b[38;5;241m.\u001b[39mextend(removed_process_schema_keys)\n\u001b[0;32m--> 176\u001b[0m graph_dict \u001b[38;5;241m=\u001b[39m \u001b[43mget_graph_dict\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 177\u001b[0m \u001b[43m \u001b[49m\u001b[43mschema\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mschema\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget\u001b[49m\u001b[43m(\u001b[49m\u001b[43mkey\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mschema\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 178\u001b[0m \u001b[43m \u001b[49m\u001b[43mstate\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mvalue\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 179\u001b[0m \u001b[43m \u001b[49m\u001b[43mcore\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mcore\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 180\u001b[0m \u001b[43m \u001b[49m\u001b[43mgraph_dict\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mgraph_dict\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 181\u001b[0m \u001b[43m \u001b[49m\u001b[43mpath\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43msubpath\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 182\u001b[0m \u001b[43m \u001b[49m\u001b[43mtop_state\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mtop_state\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 183\u001b[0m \u001b[43m \u001b[49m\u001b[43mremove_nodes\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mremove_nodes\u001b[49m\n\u001b[1;32m 184\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 186\u001b[0m \u001b[38;5;66;03m# get the place edge\u001b[39;00m\n\u001b[1;32m 187\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m node \u001b[38;5;129;01min\u001b[39;00m value\u001b[38;5;241m.\u001b[39mkeys():\n", - " \u001b[0;31m[... skipping similar frames: get_graph_dict at line 176 (2954 times)]\u001b[0m\n", - "File \u001b[0;32m~/code/bigraph-viz/bigraph_viz/diagram.py:176\u001b[0m, in \u001b[0;36mget_graph_dict\u001b[0;34m(schema, state, core, graph_dict, path, top_state, retain_type_keys, retain_process_keys, remove_nodes)\u001b[0m\n\u001b[1;32m 173\u001b[0m removed_process_schema_keys \u001b[38;5;241m=\u001b[39m [subpath \u001b[38;5;241m+\u001b[39m (schema_key,) \u001b[38;5;28;01mfor\u001b[39;00m schema_key \u001b[38;5;129;01min\u001b[39;00m PROCESS_SCHEMA_KEYS]\n\u001b[1;32m 174\u001b[0m remove_nodes\u001b[38;5;241m.\u001b[39mextend(removed_process_schema_keys)\n\u001b[0;32m--> 176\u001b[0m graph_dict \u001b[38;5;241m=\u001b[39m \u001b[43mget_graph_dict\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 177\u001b[0m \u001b[43m \u001b[49m\u001b[43mschema\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mschema\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget\u001b[49m\u001b[43m(\u001b[49m\u001b[43mkey\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mschema\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 178\u001b[0m \u001b[43m \u001b[49m\u001b[43mstate\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mvalue\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 179\u001b[0m \u001b[43m \u001b[49m\u001b[43mcore\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mcore\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 180\u001b[0m \u001b[43m \u001b[49m\u001b[43mgraph_dict\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mgraph_dict\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 181\u001b[0m \u001b[43m \u001b[49m\u001b[43mpath\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43msubpath\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 182\u001b[0m \u001b[43m \u001b[49m\u001b[43mtop_state\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mtop_state\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 183\u001b[0m \u001b[43m \u001b[49m\u001b[43mremove_nodes\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mremove_nodes\u001b[49m\n\u001b[1;32m 184\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 186\u001b[0m \u001b[38;5;66;03m# get the place edge\u001b[39;00m\n\u001b[1;32m 187\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m node \u001b[38;5;129;01min\u001b[39;00m value\u001b[38;5;241m.\u001b[39mkeys():\n", - "File \u001b[0;32m~/code/bigraph-viz/bigraph_viz/diagram.py:141\u001b[0m, in \u001b[0;36mget_graph_dict\u001b[0;34m(schema, state, core, graph_dict, path, top_state, retain_type_keys, retain_process_keys, remove_nodes)\u001b[0m\n\u001b[1;32m 132\u001b[0m \u001b[38;5;28;01mcontinue\u001b[39;00m\n\u001b[1;32m 134\u001b[0m node_spec \u001b[38;5;241m=\u001b[39m {\n\u001b[1;32m 135\u001b[0m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mname\u001b[39m\u001b[38;5;124m'\u001b[39m: key,\n\u001b[1;32m 136\u001b[0m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mpath\u001b[39m\u001b[38;5;124m'\u001b[39m: subpath,\n\u001b[1;32m 137\u001b[0m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mvalue\u001b[39m\u001b[38;5;124m'\u001b[39m: \u001b[38;5;28;01mNone\u001b[39;00m,\n\u001b[1;32m 138\u001b[0m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mtype\u001b[39m\u001b[38;5;124m'\u001b[39m: \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[1;32m 139\u001b[0m }\n\u001b[0;32m--> 141\u001b[0m is_edge \u001b[38;5;241m=\u001b[39m \u001b[43mcore\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcheck\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43medge\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mvalue\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 142\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m is_edge: \u001b[38;5;66;03m# this is a process/edge node\u001b[39;00m\n\u001b[1;32m 143\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m key \u001b[38;5;129;01min\u001b[39;00m PROCESS_SCHEMA_KEYS \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m retain_process_keys:\n", - "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:469\u001b[0m, in \u001b[0;36mTypeSystem.check\u001b[0;34m(self, initial_schema, state)\u001b[0m\n\u001b[1;32m 467\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m schema \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m 468\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mException\u001b[39;00m(\u001b[38;5;124mf\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mno type registered for the given schema: \u001b[39m\u001b[38;5;132;01m{\u001b[39;00minitial_schema\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m'\u001b[39m)\n\u001b[0;32m--> 469\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcheck_state\u001b[49m\u001b[43m(\u001b[49m\u001b[43mschema\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mstate\u001b[49m\u001b[43m)\u001b[49m\n", - "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:440\u001b[0m, in \u001b[0;36mTypeSystem.check_state\u001b[0;34m(self, schema, state)\u001b[0m\n\u001b[1;32m 436\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124m_check\u001b[39m\u001b[38;5;124m'\u001b[39m \u001b[38;5;129;01min\u001b[39;00m schema \u001b[38;5;129;01mand\u001b[39;00m schema[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m_check\u001b[39m\u001b[38;5;124m'\u001b[39m] \u001b[38;5;241m!=\u001b[39m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124many\u001b[39m\u001b[38;5;124m'\u001b[39m:\n\u001b[1;32m 437\u001b[0m check_function \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mtype_registry\u001b[38;5;241m.\u001b[39mcheck_registry\u001b[38;5;241m.\u001b[39maccess(\n\u001b[1;32m 438\u001b[0m schema[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m_check\u001b[39m\u001b[38;5;124m'\u001b[39m])\n\u001b[0;32m--> 440\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mcheck_function\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 441\u001b[0m \u001b[43m \u001b[49m\u001b[43mstate\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 442\u001b[0m \u001b[43m \u001b[49m\u001b[43mschema\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 443\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m)\u001b[49m\n\u001b[1;32m 445\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(state, \u001b[38;5;28mdict\u001b[39m):\n\u001b[1;32m 446\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m key, branch \u001b[38;5;129;01min\u001b[39;00m state\u001b[38;5;241m.\u001b[39mitems():\n", - "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:1791\u001b[0m, in \u001b[0;36mcheck_edge\u001b[0;34m(state, schema, core)\u001b[0m\n\u001b[1;32m 1790\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mcheck_edge\u001b[39m(state, schema, core):\n\u001b[0;32m-> 1791\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(state, \u001b[38;5;28mdict\u001b[39m) \u001b[38;5;129;01mand\u001b[39;00m check_ports(state, core, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124minputs\u001b[39m\u001b[38;5;124m'\u001b[39m) \u001b[38;5;129;01mand\u001b[39;00m \u001b[43mcheck_ports\u001b[49m\u001b[43m(\u001b[49m\u001b[43mstate\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mcore\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43moutputs\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m)\u001b[49m\n", - "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:1785\u001b[0m, in \u001b[0;36mcheck_ports\u001b[0;34m(state, core, key)\u001b[0m\n\u001b[1;32m 1784\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mcheck_ports\u001b[39m(state, core, key):\n\u001b[0;32m-> 1785\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m key \u001b[38;5;129;01min\u001b[39;00m state \u001b[38;5;129;01mand\u001b[39;00m \u001b[43mcore\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcheck\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 1786\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mwires\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1787\u001b[0m \u001b[43m \u001b[49m\u001b[43mstate\u001b[49m\u001b[43m[\u001b[49m\u001b[43mkey\u001b[49m\u001b[43m]\u001b[49m\u001b[43m)\u001b[49m\n", - "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:469\u001b[0m, in \u001b[0;36mTypeSystem.check\u001b[0;34m(self, initial_schema, state)\u001b[0m\n\u001b[1;32m 467\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m schema \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m 468\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mException\u001b[39;00m(\u001b[38;5;124mf\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mno type registered for the given schema: \u001b[39m\u001b[38;5;132;01m{\u001b[39;00minitial_schema\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m'\u001b[39m)\n\u001b[0;32m--> 469\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcheck_state\u001b[49m\u001b[43m(\u001b[49m\u001b[43mschema\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mstate\u001b[49m\u001b[43m)\u001b[49m\n", - "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:440\u001b[0m, in \u001b[0;36mTypeSystem.check_state\u001b[0;34m(self, schema, state)\u001b[0m\n\u001b[1;32m 436\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124m_check\u001b[39m\u001b[38;5;124m'\u001b[39m \u001b[38;5;129;01min\u001b[39;00m schema \u001b[38;5;129;01mand\u001b[39;00m schema[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m_check\u001b[39m\u001b[38;5;124m'\u001b[39m] \u001b[38;5;241m!=\u001b[39m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124many\u001b[39m\u001b[38;5;124m'\u001b[39m:\n\u001b[1;32m 437\u001b[0m check_function \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mtype_registry\u001b[38;5;241m.\u001b[39mcheck_registry\u001b[38;5;241m.\u001b[39maccess(\n\u001b[1;32m 438\u001b[0m schema[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m_check\u001b[39m\u001b[38;5;124m'\u001b[39m])\n\u001b[0;32m--> 440\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mcheck_function\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 441\u001b[0m \u001b[43m \u001b[49m\u001b[43mstate\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 442\u001b[0m \u001b[43m \u001b[49m\u001b[43mschema\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 443\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m)\u001b[49m\n\u001b[1;32m 445\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(state, \u001b[38;5;28mdict\u001b[39m):\n\u001b[1;32m 446\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m key, branch \u001b[38;5;129;01min\u001b[39;00m state\u001b[38;5;241m.\u001b[39mitems():\n", - "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:1541\u001b[0m, in \u001b[0;36mcheck_tree\u001b[0;34m(state, schema, core)\u001b[0m\n\u001b[1;32m 1539\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(state, \u001b[38;5;28mdict\u001b[39m):\n\u001b[1;32m 1540\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m key, value \u001b[38;5;129;01min\u001b[39;00m state\u001b[38;5;241m.\u001b[39mitems():\n\u001b[0;32m-> 1541\u001b[0m check \u001b[38;5;241m=\u001b[39m \u001b[43mcore\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcheck\u001b[49m\u001b[43m(\u001b[49m\u001b[43m{\u001b[49m\n\u001b[1;32m 1542\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43m_type\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mtree\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1543\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43m_leaf\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mleaf_type\u001b[49m\u001b[43m}\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1544\u001b[0m \u001b[43m \u001b[49m\u001b[43mvalue\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1546\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m check:\n\u001b[1;32m 1547\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m core\u001b[38;5;241m.\u001b[39mcheck(\n\u001b[1;32m 1548\u001b[0m leaf_type,\n\u001b[1;32m 1549\u001b[0m value)\n", - "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:466\u001b[0m, in \u001b[0;36mTypeSystem.check\u001b[0;34m(self, initial_schema, state)\u001b[0m\n\u001b[1;32m 465\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mcheck\u001b[39m(\u001b[38;5;28mself\u001b[39m, initial_schema, state):\n\u001b[0;32m--> 466\u001b[0m schema \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43maccess\u001b[49m\u001b[43m(\u001b[49m\u001b[43minitial_schema\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 467\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m schema \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m 468\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mException\u001b[39;00m(\u001b[38;5;124mf\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mno type registered for the given schema: \u001b[39m\u001b[38;5;132;01m{\u001b[39;00minitial_schema\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m'\u001b[39m)\n", - "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:109\u001b[0m, in \u001b[0;36mTypeSystem.access\u001b[0;34m(self, schema)\u001b[0m\n\u001b[1;32m 108\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21maccess\u001b[39m(\u001b[38;5;28mself\u001b[39m, schema):\n\u001b[0;32m--> 109\u001b[0m found \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mtype_registry\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43maccess\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 110\u001b[0m \u001b[43m \u001b[49m\u001b[43mschema\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 111\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m found\n", - "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/registry.py:776\u001b[0m, in \u001b[0;36mTypeRegistry.access\u001b[0;34m(self, schema)\u001b[0m\n\u001b[1;32m 772\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m bad_keys:\n\u001b[1;32m 773\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mException\u001b[39;00m(\n\u001b[1;32m 774\u001b[0m \u001b[38;5;124mf\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mtrying to override a non-overridable key: \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mbad_keys\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m'\u001b[39m)\n\u001b[0;32m--> 776\u001b[0m found \u001b[38;5;241m=\u001b[39m \u001b[43mcopy\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mdeepcopy\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfound\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 777\u001b[0m found \u001b[38;5;241m=\u001b[39m deep_merge(found, schema)\n\u001b[1;32m 779\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124m_type_parameters\u001b[39m\u001b[38;5;124m'\u001b[39m \u001b[38;5;129;01min\u001b[39;00m found:\n", - "File \u001b[0;32m/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/copy.py:146\u001b[0m, in \u001b[0;36mdeepcopy\u001b[0;34m(x, memo, _nil)\u001b[0m\n\u001b[1;32m 144\u001b[0m copier \u001b[38;5;241m=\u001b[39m _deepcopy_dispatch\u001b[38;5;241m.\u001b[39mget(\u001b[38;5;28mcls\u001b[39m)\n\u001b[1;32m 145\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m copier \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[0;32m--> 146\u001b[0m y \u001b[38;5;241m=\u001b[39m \u001b[43mcopier\u001b[49m\u001b[43m(\u001b[49m\u001b[43mx\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mmemo\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 147\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 148\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28missubclass\u001b[39m(\u001b[38;5;28mcls\u001b[39m, \u001b[38;5;28mtype\u001b[39m):\n", - "File \u001b[0;32m/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/copy.py:230\u001b[0m, in \u001b[0;36m_deepcopy_dict\u001b[0;34m(x, memo, deepcopy)\u001b[0m\n\u001b[1;32m 228\u001b[0m memo[\u001b[38;5;28mid\u001b[39m(x)] \u001b[38;5;241m=\u001b[39m y\n\u001b[1;32m 229\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m key, value \u001b[38;5;129;01min\u001b[39;00m x\u001b[38;5;241m.\u001b[39mitems():\n\u001b[0;32m--> 230\u001b[0m y[deepcopy(key, memo)] \u001b[38;5;241m=\u001b[39m \u001b[43mdeepcopy\u001b[49m\u001b[43m(\u001b[49m\u001b[43mvalue\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mmemo\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 231\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m y\n", - "File \u001b[0;32m/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/copy.py:146\u001b[0m, in \u001b[0;36mdeepcopy\u001b[0;34m(x, memo, _nil)\u001b[0m\n\u001b[1;32m 144\u001b[0m copier \u001b[38;5;241m=\u001b[39m _deepcopy_dispatch\u001b[38;5;241m.\u001b[39mget(\u001b[38;5;28mcls\u001b[39m)\n\u001b[1;32m 145\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m copier \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[0;32m--> 146\u001b[0m y \u001b[38;5;241m=\u001b[39m \u001b[43mcopier\u001b[49m\u001b[43m(\u001b[49m\u001b[43mx\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mmemo\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 147\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 148\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28missubclass\u001b[39m(\u001b[38;5;28mcls\u001b[39m, \u001b[38;5;28mtype\u001b[39m):\n", - "File \u001b[0;32m/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/copy.py:228\u001b[0m, in \u001b[0;36m_deepcopy_dict\u001b[0;34m(x, memo, deepcopy)\u001b[0m\n\u001b[1;32m 226\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m_deepcopy_dict\u001b[39m(x, memo, deepcopy\u001b[38;5;241m=\u001b[39mdeepcopy):\n\u001b[1;32m 227\u001b[0m y \u001b[38;5;241m=\u001b[39m {}\n\u001b[0;32m--> 228\u001b[0m memo[\u001b[38;5;28;43mid\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43mx\u001b[49m\u001b[43m)\u001b[49m] \u001b[38;5;241m=\u001b[39m y\n\u001b[1;32m 229\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m key, value \u001b[38;5;129;01min\u001b[39;00m x\u001b[38;5;241m.\u001b[39mitems():\n\u001b[1;32m 230\u001b[0m y[deepcopy(key, memo)] \u001b[38;5;241m=\u001b[39m deepcopy(value, memo)\n", + "Cell \u001b[0;32mIn[25], line 52\u001b[0m\n\u001b[1;32m 50\u001b[0m core\u001b[38;5;241m.\u001b[39mregister(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mconcentrations\u001b[39m\u001b[38;5;124m'\u001b[39m, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mfloat\u001b[39m\u001b[38;5;124m'\u001b[39m)\n\u001b[1;32m 51\u001b[0m cell_struct_func2 \u001b[38;5;241m=\u001b[39m replace_regex_recursive(cell_struct_func)\n\u001b[0;32m---> 52\u001b[0m \u001b[43mplot_bigraph\u001b[49m\u001b[43m(\u001b[49m\u001b[43mcell_struct_func2\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mcore\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mcore\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mremove_process_place_edges\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43;01mTrue\u001b[39;49;00m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mout_dir\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mout\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mfilename\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mcell\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m~/code/bigraph-viz/bigraph_viz/diagram.py:433\u001b[0m, in \u001b[0;36mplot_bigraph\u001b[0;34m(state, schema, core, out_dir, filename, file_format, size, node_label_size, show_values, show_types, port_labels, port_label_size, rankdir, print_source, dpi, label_margin, node_border_colors, node_fill_colors, node_groups, remove_nodes, invisible_edges, remove_process_place_edges, show_process_schema_keys)\u001b[0m\n\u001b[1;32m 430\u001b[0m schema, state \u001b[38;5;241m=\u001b[39m core\u001b[38;5;241m.\u001b[39mcomplete(schema, state)\n\u001b[1;32m 432\u001b[0m \u001b[38;5;66;03m# parse out the network\u001b[39;00m\n\u001b[0;32m--> 433\u001b[0m graph_dict \u001b[38;5;241m=\u001b[39m \u001b[43mget_graph_dict\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 434\u001b[0m \u001b[43m \u001b[49m\u001b[43mschema\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mschema\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 435\u001b[0m \u001b[43m \u001b[49m\u001b[43mstate\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mstate\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 436\u001b[0m \u001b[43m \u001b[49m\u001b[43mcore\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mcore\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 437\u001b[0m \u001b[43m \u001b[49m\u001b[43mremove_nodes\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mremove_nodes\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 438\u001b[0m \u001b[43m \u001b[49m\u001b[43mshow_process_schema_keys\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mshow_process_schema_keys\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 439\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 441\u001b[0m \u001b[38;5;66;03m# make a figure\u001b[39;00m\n\u001b[1;32m 442\u001b[0m graph \u001b[38;5;241m=\u001b[39m get_graphviz_fig(graph_dict, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n", + "File \u001b[0;32m~/code/bigraph-viz/bigraph_viz/diagram.py:197\u001b[0m, in \u001b[0;36mget_graph_dict\u001b[0;34m(schema, state, core, graph_dict, path, top_state, retain_type_keys, retain_process_keys, remove_nodes, show_process_schema_keys)\u001b[0m\n\u001b[1;32m 194\u001b[0m removed_process_schema_keys \u001b[38;5;241m=\u001b[39m [subpath \u001b[38;5;241m+\u001b[39m (schema_key,) \u001b[38;5;28;01mfor\u001b[39;00m schema_key \u001b[38;5;129;01min\u001b[39;00m removed_process_keys]\n\u001b[1;32m 195\u001b[0m remove_nodes\u001b[38;5;241m.\u001b[39mextend(removed_process_schema_keys)\n\u001b[0;32m--> 197\u001b[0m graph_dict \u001b[38;5;241m=\u001b[39m \u001b[43mget_graph_dict\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 198\u001b[0m \u001b[43m \u001b[49m\u001b[43mschema\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mschema\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget\u001b[49m\u001b[43m(\u001b[49m\u001b[43mkey\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mschema\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 199\u001b[0m \u001b[43m \u001b[49m\u001b[43mstate\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mvalue\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 200\u001b[0m \u001b[43m \u001b[49m\u001b[43mcore\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mcore\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 201\u001b[0m \u001b[43m \u001b[49m\u001b[43mgraph_dict\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mgraph_dict\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 202\u001b[0m \u001b[43m \u001b[49m\u001b[43mpath\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43msubpath\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 203\u001b[0m \u001b[43m \u001b[49m\u001b[43mtop_state\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mtop_state\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 204\u001b[0m \u001b[43m \u001b[49m\u001b[43mremove_nodes\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mremove_nodes\u001b[49m\n\u001b[1;32m 205\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 207\u001b[0m \u001b[38;5;66;03m# get the place edge\u001b[39;00m\n\u001b[1;32m 208\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m node \u001b[38;5;129;01min\u001b[39;00m value\u001b[38;5;241m.\u001b[39mkeys():\n", + "File \u001b[0;32m~/code/bigraph-viz/bigraph_viz/diagram.py:197\u001b[0m, in \u001b[0;36mget_graph_dict\u001b[0;34m(schema, state, core, graph_dict, path, top_state, retain_type_keys, retain_process_keys, remove_nodes, show_process_schema_keys)\u001b[0m\n\u001b[1;32m 194\u001b[0m removed_process_schema_keys \u001b[38;5;241m=\u001b[39m [subpath \u001b[38;5;241m+\u001b[39m (schema_key,) \u001b[38;5;28;01mfor\u001b[39;00m schema_key \u001b[38;5;129;01min\u001b[39;00m removed_process_keys]\n\u001b[1;32m 195\u001b[0m remove_nodes\u001b[38;5;241m.\u001b[39mextend(removed_process_schema_keys)\n\u001b[0;32m--> 197\u001b[0m graph_dict \u001b[38;5;241m=\u001b[39m \u001b[43mget_graph_dict\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 198\u001b[0m \u001b[43m \u001b[49m\u001b[43mschema\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mschema\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget\u001b[49m\u001b[43m(\u001b[49m\u001b[43mkey\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mschema\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 199\u001b[0m \u001b[43m \u001b[49m\u001b[43mstate\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mvalue\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 200\u001b[0m \u001b[43m \u001b[49m\u001b[43mcore\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mcore\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 201\u001b[0m \u001b[43m \u001b[49m\u001b[43mgraph_dict\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mgraph_dict\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 202\u001b[0m \u001b[43m \u001b[49m\u001b[43mpath\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43msubpath\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 203\u001b[0m \u001b[43m \u001b[49m\u001b[43mtop_state\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mtop_state\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 204\u001b[0m \u001b[43m \u001b[49m\u001b[43mremove_nodes\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mremove_nodes\u001b[49m\n\u001b[1;32m 205\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 207\u001b[0m \u001b[38;5;66;03m# get the place edge\u001b[39;00m\n\u001b[1;32m 208\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m node \u001b[38;5;129;01min\u001b[39;00m value\u001b[38;5;241m.\u001b[39mkeys():\n", + " \u001b[0;31m[... skipping similar frames: get_graph_dict at line 197 (2951 times)]\u001b[0m\n", + "File \u001b[0;32m~/code/bigraph-viz/bigraph_viz/diagram.py:197\u001b[0m, in \u001b[0;36mget_graph_dict\u001b[0;34m(schema, state, core, graph_dict, path, top_state, retain_type_keys, retain_process_keys, remove_nodes, show_process_schema_keys)\u001b[0m\n\u001b[1;32m 194\u001b[0m removed_process_schema_keys \u001b[38;5;241m=\u001b[39m [subpath \u001b[38;5;241m+\u001b[39m (schema_key,) \u001b[38;5;28;01mfor\u001b[39;00m schema_key \u001b[38;5;129;01min\u001b[39;00m removed_process_keys]\n\u001b[1;32m 195\u001b[0m remove_nodes\u001b[38;5;241m.\u001b[39mextend(removed_process_schema_keys)\n\u001b[0;32m--> 197\u001b[0m graph_dict \u001b[38;5;241m=\u001b[39m \u001b[43mget_graph_dict\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 198\u001b[0m \u001b[43m \u001b[49m\u001b[43mschema\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mschema\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget\u001b[49m\u001b[43m(\u001b[49m\u001b[43mkey\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mschema\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 199\u001b[0m \u001b[43m \u001b[49m\u001b[43mstate\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mvalue\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 200\u001b[0m \u001b[43m \u001b[49m\u001b[43mcore\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mcore\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 201\u001b[0m \u001b[43m \u001b[49m\u001b[43mgraph_dict\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mgraph_dict\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 202\u001b[0m \u001b[43m \u001b[49m\u001b[43mpath\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43msubpath\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 203\u001b[0m \u001b[43m \u001b[49m\u001b[43mtop_state\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mtop_state\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 204\u001b[0m \u001b[43m \u001b[49m\u001b[43mremove_nodes\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mremove_nodes\u001b[49m\n\u001b[1;32m 205\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 207\u001b[0m \u001b[38;5;66;03m# get the place edge\u001b[39;00m\n\u001b[1;32m 208\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m node \u001b[38;5;129;01min\u001b[39;00m value\u001b[38;5;241m.\u001b[39mkeys():\n", + "File \u001b[0;32m~/code/bigraph-viz/bigraph_viz/diagram.py:162\u001b[0m, in \u001b[0;36mget_graph_dict\u001b[0;34m(schema, state, core, graph_dict, path, top_state, retain_type_keys, retain_process_keys, remove_nodes, show_process_schema_keys)\u001b[0m\n\u001b[1;32m 153\u001b[0m \u001b[38;5;28;01mcontinue\u001b[39;00m\n\u001b[1;32m 155\u001b[0m node_spec \u001b[38;5;241m=\u001b[39m {\n\u001b[1;32m 156\u001b[0m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mname\u001b[39m\u001b[38;5;124m'\u001b[39m: key,\n\u001b[1;32m 157\u001b[0m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mpath\u001b[39m\u001b[38;5;124m'\u001b[39m: subpath,\n\u001b[1;32m 158\u001b[0m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mvalue\u001b[39m\u001b[38;5;124m'\u001b[39m: \u001b[38;5;28;01mNone\u001b[39;00m,\n\u001b[1;32m 159\u001b[0m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mtype\u001b[39m\u001b[38;5;124m'\u001b[39m: \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[1;32m 160\u001b[0m }\n\u001b[0;32m--> 162\u001b[0m is_edge \u001b[38;5;241m=\u001b[39m \u001b[43mcore\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcheck\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43medge\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mvalue\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 163\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m is_edge: \u001b[38;5;66;03m# this is a process/edge node\u001b[39;00m\n\u001b[1;32m 164\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m key \u001b[38;5;129;01min\u001b[39;00m removed_process_keys \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m retain_process_keys:\n", + "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:465\u001b[0m, in \u001b[0;36mTypeSystem.check\u001b[0;34m(self, initial_schema, state)\u001b[0m\n\u001b[1;32m 463\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mcheck\u001b[39m(\u001b[38;5;28mself\u001b[39m, initial_schema, state):\n\u001b[1;32m 464\u001b[0m schema \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mretrieve(initial_schema)\n\u001b[0;32m--> 465\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcheck_state\u001b[49m\u001b[43m(\u001b[49m\u001b[43mschema\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mstate\u001b[49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:457\u001b[0m, in \u001b[0;36mTypeSystem.check_state\u001b[0;34m(self, schema, state)\u001b[0m\n\u001b[1;32m 452\u001b[0m check_key \u001b[38;5;241m=\u001b[39m any_type[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m_check\u001b[39m\u001b[38;5;124m'\u001b[39m]\n\u001b[1;32m 454\u001b[0m check_function \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mtype_registry\u001b[38;5;241m.\u001b[39mcheck_registry\u001b[38;5;241m.\u001b[39maccess(\n\u001b[1;32m 455\u001b[0m check_key)\n\u001b[0;32m--> 457\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mcheck_function\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 458\u001b[0m \u001b[43m \u001b[49m\u001b[43mschema\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 459\u001b[0m \u001b[43m \u001b[49m\u001b[43mstate\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 460\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:1923\u001b[0m, in \u001b[0;36mcheck_edge\u001b[0;34m(schema, state, core)\u001b[0m\n\u001b[1;32m 1922\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mcheck_edge\u001b[39m(schema, state, core):\n\u001b[0;32m-> 1923\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(state, \u001b[38;5;28mdict\u001b[39m) \u001b[38;5;129;01mand\u001b[39;00m check_ports(state, core, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124minputs\u001b[39m\u001b[38;5;124m'\u001b[39m) \u001b[38;5;129;01mand\u001b[39;00m \u001b[43mcheck_ports\u001b[49m\u001b[43m(\u001b[49m\u001b[43mstate\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mcore\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43moutputs\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:1917\u001b[0m, in \u001b[0;36mcheck_ports\u001b[0;34m(state, core, key)\u001b[0m\n\u001b[1;32m 1916\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mcheck_ports\u001b[39m(state, core, key):\n\u001b[0;32m-> 1917\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m key \u001b[38;5;129;01min\u001b[39;00m state \u001b[38;5;129;01mand\u001b[39;00m \u001b[43mcore\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcheck\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 1918\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mwires\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1919\u001b[0m \u001b[43m \u001b[49m\u001b[43mstate\u001b[49m\u001b[43m[\u001b[49m\u001b[43mkey\u001b[49m\u001b[43m]\u001b[49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:465\u001b[0m, in \u001b[0;36mTypeSystem.check\u001b[0;34m(self, initial_schema, state)\u001b[0m\n\u001b[1;32m 463\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mcheck\u001b[39m(\u001b[38;5;28mself\u001b[39m, initial_schema, state):\n\u001b[1;32m 464\u001b[0m schema \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mretrieve(initial_schema)\n\u001b[0;32m--> 465\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcheck_state\u001b[49m\u001b[43m(\u001b[49m\u001b[43mschema\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mstate\u001b[49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:457\u001b[0m, in \u001b[0;36mTypeSystem.check_state\u001b[0;34m(self, schema, state)\u001b[0m\n\u001b[1;32m 452\u001b[0m check_key \u001b[38;5;241m=\u001b[39m any_type[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m_check\u001b[39m\u001b[38;5;124m'\u001b[39m]\n\u001b[1;32m 454\u001b[0m check_function \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mtype_registry\u001b[38;5;241m.\u001b[39mcheck_registry\u001b[38;5;241m.\u001b[39maccess(\n\u001b[1;32m 455\u001b[0m check_key)\n\u001b[0;32m--> 457\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mcheck_function\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 458\u001b[0m \u001b[43m \u001b[49m\u001b[43mschema\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 459\u001b[0m \u001b[43m \u001b[49m\u001b[43mstate\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 460\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:1648\u001b[0m, in \u001b[0;36mcheck_tree\u001b[0;34m(schema, state, core)\u001b[0m\n\u001b[1;32m 1646\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(state, \u001b[38;5;28mdict\u001b[39m):\n\u001b[1;32m 1647\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m key, value \u001b[38;5;129;01min\u001b[39;00m state\u001b[38;5;241m.\u001b[39mitems():\n\u001b[0;32m-> 1648\u001b[0m check \u001b[38;5;241m=\u001b[39m \u001b[43mcore\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcheck\u001b[49m\u001b[43m(\u001b[49m\u001b[43m{\u001b[49m\n\u001b[1;32m 1649\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43m_type\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mtree\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1650\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43m_leaf\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mleaf_type\u001b[49m\u001b[43m}\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1651\u001b[0m \u001b[43m \u001b[49m\u001b[43mvalue\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1653\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m check:\n\u001b[1;32m 1654\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m core\u001b[38;5;241m.\u001b[39mcheck(\n\u001b[1;32m 1655\u001b[0m leaf_type,\n\u001b[1;32m 1656\u001b[0m value)\n", + "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:465\u001b[0m, in \u001b[0;36mTypeSystem.check\u001b[0;34m(self, initial_schema, state)\u001b[0m\n\u001b[1;32m 463\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mcheck\u001b[39m(\u001b[38;5;28mself\u001b[39m, initial_schema, state):\n\u001b[1;32m 464\u001b[0m schema \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mretrieve(initial_schema)\n\u001b[0;32m--> 465\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcheck_state\u001b[49m\u001b[43m(\u001b[49m\u001b[43mschema\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mstate\u001b[49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:457\u001b[0m, in \u001b[0;36mTypeSystem.check_state\u001b[0;34m(self, schema, state)\u001b[0m\n\u001b[1;32m 452\u001b[0m check_key \u001b[38;5;241m=\u001b[39m any_type[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m_check\u001b[39m\u001b[38;5;124m'\u001b[39m]\n\u001b[1;32m 454\u001b[0m check_function \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mtype_registry\u001b[38;5;241m.\u001b[39mcheck_registry\u001b[38;5;241m.\u001b[39maccess(\n\u001b[1;32m 455\u001b[0m check_key)\n\u001b[0;32m--> 457\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mcheck_function\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 458\u001b[0m \u001b[43m \u001b[49m\u001b[43mschema\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 459\u001b[0m \u001b[43m \u001b[49m\u001b[43mstate\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 460\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:1660\u001b[0m, in \u001b[0;36mcheck_tree\u001b[0;34m(schema, state, core)\u001b[0m\n\u001b[1;32m 1658\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;01mTrue\u001b[39;00m\n\u001b[1;32m 1659\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m-> 1660\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mcore\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcheck\u001b[49m\u001b[43m(\u001b[49m\u001b[43mleaf_type\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mstate\u001b[49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:465\u001b[0m, in \u001b[0;36mTypeSystem.check\u001b[0;34m(self, initial_schema, state)\u001b[0m\n\u001b[1;32m 463\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mcheck\u001b[39m(\u001b[38;5;28mself\u001b[39m, initial_schema, state):\n\u001b[1;32m 464\u001b[0m schema \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mretrieve(initial_schema)\n\u001b[0;32m--> 465\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcheck_state\u001b[49m\u001b[43m(\u001b[49m\u001b[43mschema\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mstate\u001b[49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:457\u001b[0m, in \u001b[0;36mTypeSystem.check_state\u001b[0;34m(self, schema, state)\u001b[0m\n\u001b[1;32m 452\u001b[0m check_key \u001b[38;5;241m=\u001b[39m any_type[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m_check\u001b[39m\u001b[38;5;124m'\u001b[39m]\n\u001b[1;32m 454\u001b[0m check_function \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mtype_registry\u001b[38;5;241m.\u001b[39mcheck_registry\u001b[38;5;241m.\u001b[39maccess(\n\u001b[1;32m 455\u001b[0m check_key)\n\u001b[0;32m--> 457\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mcheck_function\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 458\u001b[0m \u001b[43m \u001b[49m\u001b[43mschema\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 459\u001b[0m \u001b[43m \u001b[49m\u001b[43mstate\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 460\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:1586\u001b[0m, in \u001b[0;36mcheck_list\u001b[0;34m(schema, state, core)\u001b[0m\n\u001b[1;32m 1584\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(state, \u001b[38;5;28mlist\u001b[39m):\n\u001b[1;32m 1585\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m element \u001b[38;5;129;01min\u001b[39;00m state:\n\u001b[0;32m-> 1586\u001b[0m check \u001b[38;5;241m=\u001b[39m \u001b[43mcore\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcheck\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 1587\u001b[0m \u001b[43m \u001b[49m\u001b[43melement_type\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1588\u001b[0m \u001b[43m \u001b[49m\u001b[43melement\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1590\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m check:\n\u001b[1;32m 1591\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;01mFalse\u001b[39;00m\n", + "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:464\u001b[0m, in \u001b[0;36mTypeSystem.check\u001b[0;34m(self, initial_schema, state)\u001b[0m\n\u001b[1;32m 463\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mcheck\u001b[39m(\u001b[38;5;28mself\u001b[39m, initial_schema, state):\n\u001b[0;32m--> 464\u001b[0m schema \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mretrieve\u001b[49m\u001b[43m(\u001b[49m\u001b[43minitial_schema\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 465\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mcheck_state(schema, state)\n", + "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:95\u001b[0m, in \u001b[0;36mTypeSystem.retrieve\u001b[0;34m(self, schema)\u001b[0m\n\u001b[1;32m 90\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mretrieve\u001b[39m(\u001b[38;5;28mself\u001b[39m, schema):\n\u001b[1;32m 91\u001b[0m \u001b[38;5;250m \u001b[39m\u001b[38;5;124;03m'''\u001b[39;00m\n\u001b[1;32m 92\u001b[0m \u001b[38;5;124;03m like access(schema) but raises an exception if nothing is found\u001b[39;00m\n\u001b[1;32m 93\u001b[0m \u001b[38;5;124;03m '''\u001b[39;00m\n\u001b[0;32m---> 95\u001b[0m found \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43maccess\u001b[49m\u001b[43m(\u001b[49m\u001b[43mschema\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 96\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m found \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m 97\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mException\u001b[39;00m(\u001b[38;5;124mf\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mschema not found for type: \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mschema\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m'\u001b[39m)\n", + "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:85\u001b[0m, in \u001b[0;36mTypeSystem.access\u001b[0;34m(self, schema)\u001b[0m\n\u001b[1;32m 84\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21maccess\u001b[39m(\u001b[38;5;28mself\u001b[39m, schema):\n\u001b[0;32m---> 85\u001b[0m found \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mtype_registry\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43maccess\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 86\u001b[0m \u001b[43m \u001b[49m\u001b[43mschema\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 87\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m found\n", + "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/registry.py:998\u001b[0m, in \u001b[0;36mTypeRegistry.access\u001b[0;34m(self, schema)\u001b[0m\n\u001b[1;32m 992\u001b[0m \u001b[38;5;250m\u001b[39m\u001b[38;5;124;03m'''\u001b[39;00m\n\u001b[1;32m 993\u001b[0m \u001b[38;5;124;03mexpand the schema to its full type information from the type registry\u001b[39;00m\n\u001b[1;32m 994\u001b[0m \u001b[38;5;124;03m'''\u001b[39;00m\n\u001b[1;32m 996\u001b[0m found \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[0;32m--> 998\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28;43misinstance\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43mschema\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43mdict\u001b[39;49m\u001b[43m)\u001b[49m:\n\u001b[1;32m 999\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124m_description\u001b[39m\u001b[38;5;124m'\u001b[39m \u001b[38;5;129;01min\u001b[39;00m schema:\n\u001b[1;32m 1000\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m schema\n", "\u001b[0;31mRecursionError\u001b[0m: maximum recursion depth exceeded while calling a Python object" ] } diff --git a/notebooks/format.ipynb b/notebooks/format.ipynb index 1a723a4..d5f09e1 100644 --- a/notebooks/format.ipynb +++ b/notebooks/format.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 15, + "execution_count": 1, "id": "bb80269d-cc1e-42c9-9667-57ade3f98a21", "metadata": { "tags": [] @@ -16,7 +16,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 2, "id": "f90fe969-5506-4c10-8828-499b9a361017", "metadata": { "tags": [] @@ -26,7 +26,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "bigraph-viz==0.0.29\n" + "-e git+https://github.com/vivarium-collective/bigraph-viz.git@846f9a2bfd4f601146f9143a7f5bf2c80e559393#egg=bigraph_viz\n" ] } ], @@ -37,7 +37,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 3, "id": "51ccd25e-7bad-48ac-ac75-a08f8eb40e60", "metadata": { "tags": [] @@ -47,45 +47,9 @@ "name": "stdout", "output_type": "stream", "text": [ - "Help on function plot_bigraph in module bigraph_viz.plot:\n", + "Help on function plot_bigraph in module bigraph_viz.diagram:\n", "\n", - "plot_bigraph(bigraph_schema, size='16,10', node_label_size='12pt', show_values=False, show_types=False, collapse_processes=False, port_labels=True, port_label_size='10pt', rankdir='TB', node_border_colors=None, node_fill_colors=None, node_groups=False, remove_nodes=None, invisible_edges=False, mark_top=False, remove_process_place_edges=False, print_source=False, dpi='70', file_format='png', out_dir=None, filename=None)\n", - " Plot a bigraph from bigraph schema.\n", - " \n", - " Args:\n", - " bigraph_schema (dict): The bigraph schema dict that will be plotted.\n", - " size (str, optional): The size of the output figure (example: '16,10'). Default is '16,10'.\n", - " node_label_size (str, optional): The font size for the node labels. Default is None.\n", - " show_values (bool, optional): Display on value info in node label. Default is False.\n", - " show_types (bool, optional): Display on type info in node label. Default is False.\n", - " collapse_processes (bool, optional): Collapse rectangular process nodes to a hyperedge vertex. Default is False.\n", - " port_labels (bool, optional): Turn on port labels. Default is True.\n", - " port_label_size (str, optional): The font size of the port labels (example: '10pt'). Default is None.\n", - " rankdir (str, optional): Sets direction of graph layout. 'TB'=top-to-bottom, 'LR'=left-to-right.\n", - " Default is 'TB'.\n", - " node_border_colors (dict, optional): Colors of node borders, with node path tuples mapped to the node color as\n", - " the value: {('path', 'to', 'node',): 'color'}. Colors at https://graphviz.org/doc/info/colors.html\n", - " node_fill_colors (dict, optional): Colors of node fills, with node path tuples mapped to the node color as\n", - " the value: {('path', 'to', 'node',): 'color'}. Colors at https://graphviz.org/doc/info/colors.html\n", - " node_groups (list, optional): A list of lists of nodes.\n", - " Each sub-list is a grouping of nodes that will be aligned at the same rank.\n", - " For example: [[('path to', 'group1 node1',), ('path to', 'group1 node2',)], [another group]]\n", - " Default is None.\n", - " remove_nodes (list, optional): A list of nodes to be removed.\n", - " invisible_edges (list, optional): A list of edge tuples. The edge tuples have the (source, target) node\n", - " according to the nodes' paths. For example: [(('top',), ('top', 'inner1')), (another edge)]\n", - " Default is None.\n", - " mark_top (bool). Turn on to mark the top nodes with a double outline.\n", - " remove_process_place_edges (bool, optional): Turn off process place edges from plotting. Default is False.\n", - " print_source (bool, optional): Print the graphviz DOT source code as string. Default is False.\n", - " file_format (str, optional): File format of the output image. Default is 'png'.\n", - " out_dir (bool, optional): The output directory for the bigraph image. Default is None.\n", - " filename (bool, optional): The file name for the bigraph image. Default is None.\n", - " \n", - " Notes:\n", - " You can adjust node labels using HTML syntax for fonts, colors, sizes, subscript, superscript. For example:\n", - " H2O will print H2O with 2 as a subscript with smaller font.\n", - " You can also make newlines by adding with
\n", + "plot_bigraph(state, schema=None, core=None, out_dir=None, filename=None, file_format='png', size='16,10', node_label_size='12pt', show_values=False, show_types=False, port_labels=True, port_label_size='10pt', rankdir='TB', print_source=False, dpi='70', label_margin='0.05', node_border_colors=None, node_fill_colors=None, node_groups=False, remove_nodes=None, invisible_edges=False, remove_process_place_edges=False, show_process_schema_keys=['interval'])\n", "\n" ] } @@ -106,138 +70,30 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 6, "id": "5f0f7e7e-4216-40ac-a39f-3c6f7599b526", "metadata": { "tags": [] }, "outputs": [ { - "data": { - "image/svg+xml": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "bigraph\n", - "\n", - "\n", - "\n", - "('store1',)\n", - "\n", - "store1\n", - "\n", - "\n", - "\n", - "('store1', 'store1.1')\n", - "\n", - "store1.1\n", - "\n", - "\n", - "\n", - "('store1',)->('store1', 'store1.1')\n", - "\n", - "\n", - "\n", - "\n", - "('store1', 'store1.2')\n", - "\n", - "store1.2\n", - "\n", - "\n", - "\n", - "('store1',)->('store1', 'store1.2')\n", - "\n", - "\n", - "\n", - "\n", - "('store1', 'store1.3')\n", - "\n", - "store1.3\n", - "\n", - "\n", - "\n", - "('store1',)->('store1', 'store1.3')\n", - "\n", - "\n", - "\n", - "\n", - "('store1', 'process1')\n", - "\n", - "process1\n", - "\n", - "\n", - "\n", - "('store1',)->('store1', 'process1')\n", - "\n", - "\n", - "\n", - "\n", - "('store1', 'process2')\n", - "\n", - "process2\n", - "\n", - "\n", - "\n", - "('store1',)->('store1', 'process2')\n", - "\n", - "\n", - "\n", - "\n", - "('process3',)\n", - "\n", - "process3\n", - "\n", - "\n", - "\n", - "('store1',)->('process3',)\n", - "\n", - "\n", - "port1\n", - "\n", - "\n", - "\n", - "('store1', 'store1.1')->('store1', 'process1')\n", - "\n", - "\n", - "port1\n", - "\n", - "\n", - "\n", - "('store1', 'store1.1')->('store1', 'process2')\n", - "\n", - "\n", - "port1\n", - "\n", - "\n", - "\n", - "('store1', 'store1.2')->('store1', 'process1')\n", - "\n", - "\n", - "port2\n", - "\n", - "\n", - "\n", - "('store1', 'store1.2')->('store1', 'process2')\n", - "\n", - "\n", - "port2\n", - "\n", - "\n", - "\n" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 18, - "metadata": {}, - "output_type": "execute_result" + "ename": "Exception", + "evalue": "schema not found for type: 2", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mException\u001b[0m Traceback (most recent call last)", + "Cell \u001b[0;32mIn[6], line 42\u001b[0m\n\u001b[1;32m 1\u001b[0m nested_composite_spec \u001b[38;5;241m=\u001b[39m {\n\u001b[1;32m 2\u001b[0m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mstore1\u001b[39m\u001b[38;5;124m'\u001b[39m: {\n\u001b[1;32m 3\u001b[0m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mstore1.1\u001b[39m\u001b[38;5;124m'\u001b[39m: {\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 40\u001b[0m }\n\u001b[1;32m 41\u001b[0m }\n\u001b[0;32m---> 42\u001b[0m \u001b[43mplot_bigraph\u001b[49m\u001b[43m(\u001b[49m\u001b[43mnested_composite_spec\u001b[49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m~/code/bigraph-viz/bigraph_viz/diagram.py:430\u001b[0m, in \u001b[0;36mplot_bigraph\u001b[0;34m(state, schema, core, out_dir, filename, file_format, size, node_label_size, show_values, show_types, port_labels, port_label_size, rankdir, print_source, dpi, label_margin, node_border_colors, node_fill_colors, node_groups, remove_nodes, invisible_edges, remove_process_place_edges, show_process_schema_keys)\u001b[0m\n\u001b[1;32m 427\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m core\u001b[38;5;241m.\u001b[39mexists(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mprocess\u001b[39m\u001b[38;5;124m'\u001b[39m):\n\u001b[1;32m 428\u001b[0m core\u001b[38;5;241m.\u001b[39mregister(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mprocess\u001b[39m\u001b[38;5;124m'\u001b[39m, process_type)\n\u001b[0;32m--> 430\u001b[0m schema, state \u001b[38;5;241m=\u001b[39m \u001b[43mcore\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcomplete\u001b[49m\u001b[43m(\u001b[49m\u001b[43mschema\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mstate\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 432\u001b[0m \u001b[38;5;66;03m# parse out the network\u001b[39;00m\n\u001b[1;32m 433\u001b[0m graph_dict \u001b[38;5;241m=\u001b[39m get_graph_dict(\n\u001b[1;32m 434\u001b[0m schema\u001b[38;5;241m=\u001b[39mschema,\n\u001b[1;32m 435\u001b[0m state\u001b[38;5;241m=\u001b[39mstate,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 438\u001b[0m show_process_schema_keys\u001b[38;5;241m=\u001b[39mshow_process_schema_keys,\n\u001b[1;32m 439\u001b[0m )\n", + "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:1334\u001b[0m, in \u001b[0;36mTypeSystem.complete\u001b[0;34m(self, initial_schema, initial_state)\u001b[0m\n\u001b[1;32m 1328\u001b[0m state \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mhydrate(\n\u001b[1;32m 1329\u001b[0m full_schema,\n\u001b[1;32m 1330\u001b[0m initial_state)\n\u001b[1;32m 1332\u001b[0m \u001b[38;5;66;03m# fill in the parts of the composition schema\u001b[39;00m\n\u001b[1;32m 1333\u001b[0m \u001b[38;5;66;03m# determined by the state\u001b[39;00m\n\u001b[0;32m-> 1334\u001b[0m schema, state \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43minfer_schema\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 1335\u001b[0m \u001b[43m \u001b[49m\u001b[43mfull_schema\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1336\u001b[0m \u001b[43m \u001b[49m\u001b[43mstate\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1338\u001b[0m final_state \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mfill(schema, state)\n\u001b[1;32m 1340\u001b[0m \u001b[38;5;66;03m# TODO: add flag to types.access(copy=True)\u001b[39;00m\n", + "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:1260\u001b[0m, in \u001b[0;36mTypeSystem.infer_schema\u001b[0;34m(self, schema, state, top_state, path)\u001b[0m\n\u001b[1;32m 1257\u001b[0m inner_path \u001b[38;5;241m=\u001b[39m path \u001b[38;5;241m+\u001b[39m (key,)\n\u001b[1;32m 1258\u001b[0m \u001b[38;5;66;03m# if get_path(schema, inner_path) is None or get_path(state, inner_path) is None:\u001b[39;00m\n\u001b[0;32m-> 1260\u001b[0m schema, top_state \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43minfer_schema\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 1261\u001b[0m \u001b[43m \u001b[49m\u001b[43mschema\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1262\u001b[0m \u001b[43m \u001b[49m\u001b[43mvalue\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1263\u001b[0m \u001b[43m \u001b[49m\u001b[43mtop_state\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mtop_state\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1264\u001b[0m \u001b[43m \u001b[49m\u001b[43mpath\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43minner_path\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1266\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(state, \u001b[38;5;28mstr\u001b[39m):\n\u001b[1;32m 1267\u001b[0m \u001b[38;5;28;01mpass\u001b[39;00m\n", + "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:1260\u001b[0m, in \u001b[0;36mTypeSystem.infer_schema\u001b[0;34m(self, schema, state, top_state, path)\u001b[0m\n\u001b[1;32m 1257\u001b[0m inner_path \u001b[38;5;241m=\u001b[39m path \u001b[38;5;241m+\u001b[39m (key,)\n\u001b[1;32m 1258\u001b[0m \u001b[38;5;66;03m# if get_path(schema, inner_path) is None or get_path(state, inner_path) is None:\u001b[39;00m\n\u001b[0;32m-> 1260\u001b[0m schema, top_state \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43minfer_schema\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 1261\u001b[0m \u001b[43m \u001b[49m\u001b[43mschema\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1262\u001b[0m \u001b[43m \u001b[49m\u001b[43mvalue\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1263\u001b[0m \u001b[43m \u001b[49m\u001b[43mtop_state\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mtop_state\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1264\u001b[0m \u001b[43m \u001b[49m\u001b[43mpath\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43minner_path\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1266\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(state, \u001b[38;5;28mstr\u001b[39m):\n\u001b[1;32m 1267\u001b[0m \u001b[38;5;28;01mpass\u001b[39;00m\n", + "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:1218\u001b[0m, in \u001b[0;36mTypeSystem.infer_schema\u001b[0;34m(self, schema, state, top_state, path)\u001b[0m\n\u001b[1;32m 1211\u001b[0m state_type \u001b[38;5;241m=\u001b[39m {\n\u001b[1;32m 1212\u001b[0m key: value\n\u001b[1;32m 1213\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m key, value \u001b[38;5;129;01min\u001b[39;00m state\u001b[38;5;241m.\u001b[39mitems()\n\u001b[1;32m 1214\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m key\u001b[38;5;241m.\u001b[39mstartswith(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m_\u001b[39m\u001b[38;5;124m'\u001b[39m)}\n\u001b[1;32m 1215\u001b[0m state_schema \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39maccess(\n\u001b[1;32m 1216\u001b[0m state_type)\n\u001b[0;32m-> 1218\u001b[0m hydrated_state \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mdeserialize\u001b[49m\u001b[43m(\u001b[49m\u001b[43mstate_schema\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mstate\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1219\u001b[0m top_state \u001b[38;5;241m=\u001b[39m set_path(\n\u001b[1;32m 1220\u001b[0m top_state,\n\u001b[1;32m 1221\u001b[0m path,\n\u001b[1;32m 1222\u001b[0m hydrated_state)\n\u001b[1;32m 1224\u001b[0m update \u001b[38;5;241m=\u001b[39m state_type\n", + "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:684\u001b[0m, in \u001b[0;36mTypeSystem.deserialize\u001b[0;34m(self, schema, encoded)\u001b[0m\n\u001b[1;32m 682\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m key, branch \u001b[38;5;129;01min\u001b[39;00m encoded\u001b[38;5;241m.\u001b[39mitems():\n\u001b[1;32m 683\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m key \u001b[38;5;129;01min\u001b[39;00m schema:\n\u001b[0;32m--> 684\u001b[0m result[key] \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mdeserialize\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 685\u001b[0m \u001b[43m \u001b[49m\u001b[43mschema\u001b[49m\u001b[43m[\u001b[49m\u001b[43mkey\u001b[49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 686\u001b[0m \u001b[43m \u001b[49m\u001b[43mbranch\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 687\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m result\n\u001b[1;32m 689\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n", + "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:658\u001b[0m, in \u001b[0;36mTypeSystem.deserialize\u001b[0;34m(self, schema, encoded)\u001b[0m\n\u001b[1;32m 657\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mdeserialize\u001b[39m(\u001b[38;5;28mself\u001b[39m, schema, encoded):\n\u001b[0;32m--> 658\u001b[0m found \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mretrieve\u001b[49m\u001b[43m(\u001b[49m\u001b[43mschema\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 660\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124m_deserialize\u001b[39m\u001b[38;5;124m'\u001b[39m \u001b[38;5;129;01min\u001b[39;00m found:\n\u001b[1;32m 661\u001b[0m deserialize \u001b[38;5;241m=\u001b[39m found[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m_deserialize\u001b[39m\u001b[38;5;124m'\u001b[39m]\n", + "File \u001b[0;32m~/code/bigraph-schema/bigraph_schema/type_system.py:97\u001b[0m, in \u001b[0;36mTypeSystem.retrieve\u001b[0;34m(self, schema)\u001b[0m\n\u001b[1;32m 95\u001b[0m found \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39maccess(schema)\n\u001b[1;32m 96\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m found \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[0;32m---> 97\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mException\u001b[39;00m(\u001b[38;5;124mf\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mschema not found for type: \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mschema\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m'\u001b[39m)\n\u001b[1;32m 98\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m found\n", + "\u001b[0;31mException\u001b[0m: schema not found for type: 2" + ] } ], "source": [ @@ -256,28 +112,28 @@ " '_type': 'float',\n", " },\n", " 'process1': {\n", - " '_ports': {\n", - " 'port1': {'_type': 'type'}, \n", - " 'port2': {'_type': 'type'},\n", + " '_outputs': {\n", + " 'port1': 'float', \n", + " 'port2': 'int',\n", " },\n", - " 'wires': {\n", + " 'outputs': {\n", " 'port1': 'store1.1',\n", " 'port2': 'store1.2',\n", " }\n", " },\n", " 'process2': {\n", - " '_ports': {\n", - " 'port1': {'_type': 'type'}, \n", - " 'port2': {'_type': 'type'},\n", + " '_outputs': {\n", + " 'port1': 'float', \n", + " 'port2': 'int',\n", " },\n", - " 'wires': {\n", + " 'outputs': {\n", " 'port1': 'store1.1',\n", " 'port2': 'store1.2',\n", " }\n", " },\n", " },\n", " 'process3': {\n", - " 'wires': {\n", + " 'outputs': {\n", " 'port1': 'store1',\n", " }\n", " }\n", @@ -295,132 +151,12 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": null, "id": "3ac86e22-9914-4508-9890-4105f17c944e", "metadata": { "tags": [] }, - "outputs": [ - { - "data": { - "image/svg+xml": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "bigraph\n", - "\n", - "\n", - "\n", - "('store1',)\n", - "\n", - "store1\n", - "\n", - "\n", - "\n", - "('store1', 'store1.1')\n", - "\n", - "store1.1\n", - "\n", - "\n", - "\n", - "('store1',)->('store1', 'store1.1')\n", - "\n", - "\n", - "\n", - "\n", - "('store1', 'store1.2')\n", - "\n", - "store1.2\n", - "\n", - "\n", - "\n", - "('store1',)->('store1', 'store1.2')\n", - "\n", - "\n", - "\n", - "\n", - "('store1', 'store1.3')\n", - "\n", - "store1.3\n", - "\n", - "\n", - "\n", - "('store1',)->('store1', 'store1.3')\n", - "\n", - "\n", - "\n", - "\n", - "('store1', 'process1')\n", - "\n", - "process1\n", - "\n", - "\n", - "\n", - "\n", - "('store1', 'process2')\n", - "\n", - "process2\n", - "\n", - "\n", - "\n", - "\n", - "('process3',)\n", - "\n", - "process3\n", - "\n", - "\n", - "\n", - "('store1',)->('process3',)\n", - "\n", - "\n", - "port1\n", - "\n", - "\n", - "\n", - "('store1', 'store1.1')->('store1', 'process1')\n", - "\n", - "\n", - "port1\n", - "\n", - "\n", - "\n", - "('store1', 'store1.1')->('store1', 'process2')\n", - "\n", - "\n", - "port1\n", - "\n", - "\n", - "\n", - "('store1', 'store1.2')->('store1', 'process1')\n", - "\n", - "\n", - "port2\n", - "\n", - "\n", - "\n", - "('store1', 'store1.2')->('store1', 'process2')\n", - "\n", - "\n", - "port2\n", - "\n", - "\n", - "\n" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 19, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "plot_settings['remove_process_place_edges'] = True\n", "plot_bigraph(nested_composite_spec, **plot_settings)" @@ -436,119 +172,10 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": null, "id": "9e6b1ea1-8084-41ff-aa87-c654a4d3de08", "metadata": {}, - "outputs": [ - { - "data": { - "image/svg+xml": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "bigraph\n", - "\n", - "\n", - "\n", - "('store1',)\n", - "\n", - "store1\n", - "\n", - "\n", - "\n", - "('store1', 'store1.1')\n", - "\n", - "store1.1\n", - "\n", - "\n", - "\n", - "('store1',)->('store1', 'store1.1')\n", - "\n", - "\n", - "\n", - "\n", - "('store1', 'store1.2')\n", - "\n", - "store1.2\n", - "\n", - "\n", - "\n", - "('store1',)->('store1', 'store1.2')\n", - "\n", - "\n", - "\n", - "\n", - "('store1', 'process1')\n", - "\n", - "process1\n", - "\n", - "\n", - "\n", - "\n", - "('store1', 'process2')\n", - "\n", - "process2\n", - "\n", - "\n", - "\n", - "\n", - "('process3',)\n", - "\n", - "process3\n", - "\n", - "\n", - "\n", - "('store1',)->('process3',)\n", - "\n", - "\n", - "port1\n", - "\n", - "\n", - "\n", - "('store1', 'store1.1')->('store1', 'process1')\n", - "\n", - "\n", - "port1\n", - "\n", - "\n", - "\n", - "('store1', 'store1.1')->('store1', 'process2')\n", - "\n", - "\n", - "port1\n", - "\n", - "\n", - "\n", - "('store1', 'store1.2')->('store1', 'process1')\n", - "\n", - "\n", - "port2\n", - "\n", - "\n", - "\n", - "('store1', 'store1.2')->('store1', 'process2')\n", - "\n", - "\n", - "port2\n", - "\n", - "\n", - "\n" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 20, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "remove_nodes = [\n", " ('store1', 'store1.3'),\n", @@ -567,116 +194,12 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": null, "id": "2c109939-715b-4757-9914-388bdb93a213", "metadata": { "tags": [] }, - "outputs": [ - { - "data": { - "image/svg+xml": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "bigraph\n", - "\n", - "\n", - "\n", - "('store1',)\n", - "\n", - "store1\n", - "\n", - "\n", - "\n", - "('store1', 'store1.1')\n", - "\n", - "store1.1\n", - "\n", - "\n", - "\n", - "('store1',)->('store1', 'store1.1')\n", - "\n", - "\n", - "\n", - "\n", - "('store1', 'store1.2')\n", - "\n", - "store1.2\n", - "\n", - "\n", - "\n", - "('store1',)->('store1', 'store1.2')\n", - "\n", - "\n", - "\n", - "\n", - "('store1', 'process1')\n", - "\n", - "process1\n", - "\n", - "\n", - "\n", - "\n", - "('store1', 'process2')\n", - "\n", - "process2\n", - "\n", - "\n", - "\n", - "\n", - "('process3',)\n", - "\n", - "process3\n", - "\n", - "\n", - "\n", - "('store1',)->('process3',)\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "('store1', 'store1.1')->('store1', 'process1')\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "('store1', 'store1.1')->('store1', 'process2')\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "('store1', 'store1.2')->('store1', 'process1')\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "('store1', 'store1.2')->('store1', 'process2')\n", - "\n", - "\n", - "\n", - "\n", - "\n" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 21, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "plot_settings['port_labels'] = False\n", "plot_bigraph(nested_composite_spec, **plot_settings)" @@ -692,116 +215,12 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": null, "id": "4042e0b5-8677-42ef-ab66-83f08861d867", "metadata": { "tags": [] }, - "outputs": [ - { - "data": { - "image/svg+xml": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "bigraph\n", - "\n", - "\n", - "\n", - "('store1',)\n", - "\n", - "store1\n", - "\n", - "\n", - "\n", - "('store1', 'store1.1')\n", - "\n", - "store1.1\n", - "\n", - "\n", - "\n", - "('store1',)->('store1', 'store1.1')\n", - "\n", - "\n", - "\n", - "\n", - "('store1', 'store1.2')\n", - "\n", - "store1.2\n", - "\n", - "\n", - "\n", - "('store1',)->('store1', 'store1.2')\n", - "\n", - "\n", - "\n", - "\n", - "('store1', 'process1')\n", - "\n", - "process1\n", - "\n", - "\n", - "\n", - "\n", - "('store1', 'process2')\n", - "\n", - "process2\n", - "\n", - "\n", - "\n", - "\n", - "('process3',)\n", - "\n", - "process3\n", - "\n", - "\n", - "\n", - "('store1',)->('process3',)\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "('store1', 'store1.1')->('store1', 'process1')\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "('store1', 'store1.1')->('store1', 'process2')\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "('store1', 'store1.2')->('store1', 'process1')\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "('store1', 'store1.2')->('store1', 'process2')\n", - "\n", - "\n", - "\n", - "\n", - "\n" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 22, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "plot_settings['node_border_colors'] = {\n", " ('store1', 'store1.1'): 'blue',\n", @@ -822,118 +241,12 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": null, "id": "447cce01-c619-4012-8a4e-1f8edf9515e9", "metadata": { "tags": [] }, - "outputs": [ - { - "data": { - "image/svg+xml": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "bigraph\n", - "\n", - "\n", - "\n", - "('store1',)\n", - "\n", - "store1\n", - "\n", - "\n", - "\n", - "('store1', 'store1.1')\n", - "\n", - "store1.1\n", - "\n", - "\n", - "\n", - "('store1',)->('store1', 'store1.1')\n", - "\n", - "\n", - "\n", - "\n", - "('store1', 'store1.2')\n", - "\n", - "store1.2\n", - "\n", - "\n", - "\n", - "('store1',)->('store1', 'store1.2')\n", - "\n", - "\n", - "\n", - "\n", - "('store1', 'process1')\n", - "\n", - "process1\n", - "\n", - "\n", - "\n", - "\n", - "('store1', 'process2')\n", - "\n", - "process2\n", - "\n", - "\n", - "\n", - "\n", - "('process3',)\n", - "\n", - "process3\n", - "\n", - "\n", - "\n", - "('store1',)->('process3',)\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "('store1', 'store1.1')->('store1', 'process1')\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "('store1', 'store1.1')->('store1', 'process2')\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "('store1', 'store1.2')->('store1', 'process1')\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "('store1', 'store1.2')->('store1', 'process2')\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 23, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "plot_settings['node_groups'] = [\n", " [('store1', 'process1'), ('store1', 'process2'), ('process3',)]\n", @@ -951,118 +264,12 @@ }, { "cell_type": "code", - "execution_count": 25, + "execution_count": null, "id": "d0c5d918-4fa9-495c-8424-4254e495efc9", "metadata": { "tags": [] }, - "outputs": [ - { - "data": { - "image/svg+xml": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "bigraph\n", - "\n", - "\n", - "\n", - "('store1',)\n", - "\n", - "store1\n", - "\n", - "\n", - "\n", - "('store1', 'store1.1')\n", - "\n", - "store1.1\n", - "\n", - "\n", - "\n", - "('store1',)->('store1', 'store1.1')\n", - "\n", - "\n", - "\n", - "\n", - "('store1', 'store1.2')\n", - "\n", - "store1.2\n", - "\n", - "\n", - "\n", - "('store1',)->('store1', 'store1.2')\n", - "\n", - "\n", - "\n", - "\n", - "('store1', 'process1')\n", - "\n", - "process1\n", - "\n", - "\n", - "\n", - "\n", - "('store1', 'process2')\n", - "\n", - "process2\n", - "\n", - "\n", - "\n", - "\n", - "('process3',)\n", - "\n", - "process3\n", - "\n", - "\n", - "\n", - "('store1',)->('process3',)\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "('store1', 'store1.1')->('store1', 'process1')\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "('store1', 'store1.1')->('store1', 'process2')\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "('store1', 'store1.2')->('store1', 'process1')\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "('store1', 'store1.2')->('store1', 'process2')\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 25, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "plot_settings['rankdir'] = 'LR'\n", "plot_bigraph(nested_composite_spec, **plot_settings)"