From e64ed3b6e130ecc8a26ce50fc9537f6a4d4ecab1 Mon Sep 17 00:00:00 2001 From: Ryan Spangler Date: Thu, 25 Jan 2024 15:13:06 -0800 Subject: [PATCH 1/2] bmca notebook --- .gitignore | 3 + notebooks/BMCA.ipynb | 315 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 318 insertions(+) create mode 100644 notebooks/BMCA.ipynb diff --git a/.gitignore b/.gitignore index 480e8c4..e3b8b43 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ # Distribution / packaging +__pycache__/ .Python env/ build/ @@ -18,3 +19,5 @@ wheels/ *.egg *.out out/ +.python-version +.ipynb_checkpoints/ diff --git a/notebooks/BMCA.ipynb b/notebooks/BMCA.ipynb new file mode 100644 index 0000000..a40235c --- /dev/null +++ b/notebooks/BMCA.ipynb @@ -0,0 +1,315 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "id": "5c510aab", + "metadata": {}, + "outputs": [], + "source": [ + "from bigraph_viz import plot_bigraph\n" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "id": "17969769", + "metadata": {}, + "outputs": [ + { + "data": { + "image/svg+xml": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "bigraph\n", + "\n", + "\n", + "\n", + "('BMCA_workflow', 'fluxes')\n", + "\n", + "fluxes\n", + "\n", + "\n", + "\n", + "('BMCA_workflow', 'BMCA_inference')\n", + "\n", + "BMCA_inference\n", + "\n", + "\n", + "\n", + "('BMCA_workflow', 'fluxes')->('BMCA_workflow', 'BMCA_inference')\n", + "\n", + "\n", + "input_fluxes\n", + "\n", + "\n", + "\n", + "('BMCA_workflow', 'eflux')\n", + "\n", + "eflux\n", + "\n", + "\n", + "\n", + "('BMCA_workflow', 'fluxes')->('BMCA_workflow', 'eflux')\n", + "\n", + "\n", + "output_fluxes\n", + "\n", + "\n", + "\n", + "('BMCA_workflow', 'internal_metabolites')\n", + "\n", + "internal_metabolites\n", + "\n", + "\n", + "\n", + "('BMCA_workflow', 'external_metabolites')\n", + "\n", + "external_metabolites\n", + "\n", + "\n", + "\n", + "('BMCA_workflow', 'enzymes')\n", + "\n", + "enzymes\n", + "\n", + "\n", + "\n", + "('BMCA_workflow',)\n", + "\n", + "\n", + "BMCA_workflow\n", + "\n", + "\n", + "\n", + "('BMCA_workflow',)->('BMCA_workflow', 'fluxes')\n", + "\n", + "\n", + "\n", + "\n", + "('BMCA_workflow',)->('BMCA_workflow', 'internal_metabolites')\n", + "\n", + "\n", + "\n", + "\n", + "('BMCA_workflow',)->('BMCA_workflow', 'external_metabolites')\n", + "\n", + "\n", + "\n", + "\n", + "('BMCA_workflow',)->('BMCA_workflow', 'enzymes')\n", + "\n", + "\n", + "\n", + "\n", + "('BMCA_workflow',)->('BMCA_workflow', 'BMCA_inference')\n", + "\n", + "\n", + "\n", + "\n", + "('BMCA_workflow',)->('BMCA_workflow', 'eflux')\n", + "\n", + "\n", + "\n", + "\n", + "('BMCA_workflow', 'eflux', 'FBA')\n", + "\n", + "FBA\n", + "\n", + "\n", + "\n", + "('BMCA_workflow', 'eflux')->('BMCA_workflow', 'eflux', 'FBA')\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "('BMCA_workflow', 'expression')->('BMCA_workflow',)\n", + "\n", + "\n", + "expression\n", + "\n", + "\n", + "\n", + "\n", + "('BMCA_workflow', 'eflux', 'input_expression')->('BMCA_workflow', 'eflux')\n", + "\n", + "\n", + "input_expression\n", + "\n", + "\n", + "\n", + "\n", + "('BMCA_workflow', 'eflux', 'input_model')->('BMCA_workflow', 'eflux')\n", + "\n", + "\n", + "input_model\n", + "\n", + "\n", + "\n", + "\n", + "('BMCA_workflow', 'eflux', 'FBA', 'input_bounds')->('BMCA_workflow', 'eflux', 'FBA')\n", + "\n", + "\n", + "input_bounds\n", + "\n", + "\n", + "\n", + "\n", + "('BMCA_workflow', 'eflux', 'FBA', 'input_objective')->('BMCA_workflow', 'eflux', 'FBA')\n", + "\n", + "\n", + "input_objective\n", + "\n", + "\n", + "\n", + "\n", + "('BMCA_workflow', 'eflux', 'FBA', 'input_model')->('BMCA_workflow', 'eflux', 'FBA')\n", + "\n", + "\n", + "input_model\n", + "\n", + "\n", + "\n", + "\n", + "('BMCA_workflow', 'eflux', 'FBA', 'output_metabolite_dual_values')->('BMCA_workflow', 'eflux', 'FBA')\n", + "\n", + "\n", + "output_metabolite_dual_values\n", + "\n", + "\n", + "\n", + "\n", + "('BMCA_workflow', 'eflux', 'FBA', 'output_reaction_dual_values')->('BMCA_workflow', 'eflux', 'FBA')\n", + "\n", + "\n", + "output_reaction_dual_values\n", + "\n", + "\n", + "\n", + "\n", + "('BMCA_workflow', 'eflux', 'FBA', 'output_fluxes')->('BMCA_workflow', 'eflux', 'FBA')\n", + "\n", + "\n", + "output_fluxes\n", + "\n", + "\n", + "\n" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 13, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "bounds_type = {\n", + " 'upper': 'float',\n", + " 'lower': 'float',\n", + "}\n", + "\n", + "objective_type = 'function[array[(decisions),float],float]~string'\n", + "\n", + "gene_type = 'string'\n", + "reaction_type = 'string'\n", + "metabolite_type = 'string'\n", + "\n", + "perturbation_type = {\n", + " 'entity': 'reaction~gene',\n", + " 'direction': 'boolean',\n", + "}\n", + "\n", + "medium_type = 'map[reaction,bounds]'\n", + "\n", + "condition_type = '(medium|list[perturbation])'\n", + "\n", + "spec = {\n", + " 'BMCA_workflow': {\n", + " 'fluxes': {},\n", + " 'internal_metabolites': {},\n", + " 'external_metabolites': {},\n", + " 'enzymes': {},\n", + " \n", + " '_ports': {\n", + " 'expression': 'map[array[(genes),float]]',\n", + " },\n", + " 'BMCA_inference': {\n", + " '_ports': {\n", + " 'input_fluxes': 'map[array[(reactions),float]]',\n", + " 'input_enzymes': 'map[array[(enzymes), float]]',\n", + " },\n", + " 'wires': {\n", + " 'input_fluxes': ['fluxes'],\n", + " },\n", + " },\n", + " 'eflux': {\n", + " '_ports': {\n", + " 'input_expression': 'map[array[(genes),float]]',\n", + " 'input_model': 'sbml',\n", + " 'output_fluxes': 'map[array[(reactions),float]]',\n", + " },\n", + " 'config': {\n", + " 'condition_normalization': 'A',\n", + " 'scaling': 'media',\n", + " },\n", + " 'FBA': {\n", + " '_ports': {\n", + " 'input_bounds': 'array[(reactions),bounds]',\n", + " 'input_objective': 'objective',\n", + " 'input_model': 'sbml',\n", + " 'output_metabolite_dual_values': 'array[(metabolites),float]',\n", + " 'output_reaction_dual_values': 'array[(reactions),float]',\n", + " 'output_fluxes': 'array[(reactions),float]',\n", + " },\n", + " },\n", + " 'wires': {\n", + " 'output_fluxes': ['fluxes'],\n", + " },\n", + " },\n", + " }\n", + "}\n", + "\n", + "plot_bigraph(spec)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "1af3b2fe", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "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.10.9" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} From c4f8cfd67ede39509162b04cf77432058df24c61 Mon Sep 17 00:00:00 2001 From: Eran Date: Thu, 1 Feb 2024 18:11:58 -0500 Subject: [PATCH 2/2] update BMCA notebook --- notebooks/BMCA.ipynb | 422 ++++++++++++++++++++++++++++++------------- 1 file changed, 292 insertions(+), 130 deletions(-) diff --git a/notebooks/BMCA.ipynb b/notebooks/BMCA.ipynb index a40235c..e756624 100644 --- a/notebooks/BMCA.ipynb +++ b/notebooks/BMCA.ipynb @@ -7,12 +7,12 @@ "metadata": {}, "outputs": [], "source": [ - "from bigraph_viz import plot_bigraph\n" + "from bigraph_viz import plot_bigraph" ] }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 14, "id": "17969769", "metadata": {}, "outputs": [ @@ -22,192 +22,275 @@ "\n", "\n", - "\n", "\n", - "\n", - "\n", + "\n", + "\n", "bigraph\n", - "\n", + "\n", "\n", "\n", "('BMCA_workflow', 'fluxes')\n", - "\n", - "fluxes\n", + "\n", + "fluxes\n", "\n", "\n", "\n", "('BMCA_workflow', 'BMCA_inference')\n", - "\n", - "BMCA_inference\n", + "\n", + "BMCA_inference\n", "\n", "\n", - "\n", + "\n", "('BMCA_workflow', 'fluxes')->('BMCA_workflow', 'BMCA_inference')\n", - "\n", - "\n", - "input_fluxes\n", + "\n", + "\n", + "input_fluxes\n", "\n", - "\n", + "\n", "\n", - "('BMCA_workflow', 'eflux')\n", - "\n", - "eflux\n", + "('BMCA_workflow', 'get_flux_from_expression')\n", + "\n", + "get_flux_from_expression\n", "\n", - "\n", - "\n", - "('BMCA_workflow', 'fluxes')->('BMCA_workflow', 'eflux')\n", - "\n", - "\n", - "output_fluxes\n", + "\n", + "\n", + "('BMCA_workflow', 'fluxes')->('BMCA_workflow', 'get_flux_from_expression')\n", + "\n", + "\n", + "output_fluxes\n", "\n", "\n", "\n", "('BMCA_workflow', 'internal_metabolites')\n", - "\n", - "internal_metabolites\n", + "\n", + "internal_metabolites\n", "\n", "\n", "\n", "('BMCA_workflow', 'external_metabolites')\n", - "\n", - "external_metabolites\n", + "\n", + "external_metabolites\n", "\n", "\n", "\n", "('BMCA_workflow', 'enzymes')\n", - "\n", - "enzymes\n", + "\n", + "enzymes\n", "\n", "\n", "\n", "('BMCA_workflow',)\n", - "\n", - "\n", - "BMCA_workflow\n", + "\n", + "\n", + "BMCA_workflow\n", "\n", "\n", - "\n", + "\n", "('BMCA_workflow',)->('BMCA_workflow', 'fluxes')\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "('BMCA_workflow',)->('BMCA_workflow', 'internal_metabolites')\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "('BMCA_workflow',)->('BMCA_workflow', 'external_metabolites')\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "('BMCA_workflow',)->('BMCA_workflow', 'enzymes')\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "('BMCA_workflow',)->('BMCA_workflow', 'BMCA_inference')\n", - "\n", + "\n", "\n", - "\n", - "\n", - "('BMCA_workflow',)->('BMCA_workflow', 'eflux')\n", - "\n", + "\n", + "\n", + "('BMCA_workflow',)->('BMCA_workflow', 'get_flux_from_expression')\n", + "\n", "\n", - "\n", + "\n", "\n", - "('BMCA_workflow', 'eflux', 'FBA')\n", - "\n", - "FBA\n", + "('BMCA_workflow', 'get_flux_from_expression', 'flux_variability_analysis')\n", + "\n", + "flux_variability_analysis\n", "\n", - "\n", - "\n", - "('BMCA_workflow', 'eflux')->('BMCA_workflow', 'eflux', 'FBA')\n", - "\n", + "\n", + "\n", + "('BMCA_workflow', 'get_flux_from_expression')->('BMCA_workflow', 'get_flux_from_expression', 'flux_variability_analysis')\n", + "\n", "\n", - "\n", - "\n", - "\n", - "('BMCA_workflow', 'expression')->('BMCA_workflow',)\n", - "\n", - "\n", - "expression\n", + "\n", + "\n", + "('BMCA_workflow', 'get_flux_from_expression', 'flux_variability_analysis', 'FBA')\n", + "\n", + "FBA\n", "\n", - "\n", - "\n", + "\n", + "\n", + "('BMCA_workflow', 'get_flux_from_expression', 'flux_variability_analysis')->('BMCA_workflow', 'get_flux_from_expression', 'flux_variability_analysis', 'FBA')\n", + "\n", + "\n", + "\n", + "\n", "\n", - "('BMCA_workflow', 'eflux', 'input_expression')->('BMCA_workflow', 'eflux')\n", - "\n", - "\n", - "input_expression\n", + "('BMCA_workflow', 'input_expression')->('BMCA_workflow',)\n", + "\n", + "\n", + "input_expression\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", - "('BMCA_workflow', 'eflux', 'input_model')->('BMCA_workflow', 'eflux')\n", - "\n", - "\n", - "input_model\n", + "('BMCA_workflow', 'input_model')->('BMCA_workflow',)\n", + "\n", + "\n", + "input_model\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", - "('BMCA_workflow', 'eflux', 'FBA', 'input_bounds')->('BMCA_workflow', 'eflux', 'FBA')\n", - "\n", - "\n", - "input_bounds\n", + "('BMCA_workflow', 'input_flux_data')->('BMCA_workflow',)\n", + "\n", + "\n", + "input_flux_data\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", - "('BMCA_workflow', 'eflux', 'FBA', 'input_objective')->('BMCA_workflow', 'eflux', 'FBA')\n", - "\n", - "\n", - "input_objective\n", + "('BMCA_workflow', 'output_flux_control_coeff')->('BMCA_workflow',)\n", + "\n", + "\n", + "output_flux_control_coeff\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", - "('BMCA_workflow', 'eflux', 'FBA', 'input_model')->('BMCA_workflow', 'eflux', 'FBA')\n", - "\n", - "\n", - "input_model\n", + "('BMCA_workflow', 'output_metabolite_control_coeffs')->('BMCA_workflow',)\n", + "\n", + "\n", + "output_metabolite_control_coeffs\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", - "('BMCA_workflow', 'eflux', 'FBA', 'output_metabolite_dual_values')->('BMCA_workflow', 'eflux', 'FBA')\n", - "\n", - "\n", - "output_metabolite_dual_values\n", + "('BMCA_workflow', 'BMCA_inference', 'input_enzymes')->('BMCA_workflow', 'BMCA_inference')\n", + "\n", + "\n", + "input_enzymes\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", - "('BMCA_workflow', 'eflux', 'FBA', 'output_reaction_dual_values')->('BMCA_workflow', 'eflux', 'FBA')\n", - "\n", - "\n", - "output_reaction_dual_values\n", + "('BMCA_workflow', 'get_flux_from_expression', 'input_method')->('BMCA_workflow', 'get_flux_from_expression')\n", + "\n", + "\n", + "input_method\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", - "('BMCA_workflow', 'eflux', 'FBA', 'output_fluxes')->('BMCA_workflow', 'eflux', 'FBA')\n", - "\n", - "\n", - "output_fluxes\n", + "('BMCA_workflow', 'get_flux_from_expression', 'input_expression')->('BMCA_workflow', 'get_flux_from_expression')\n", + "\n", + "\n", + "input_expression\n", + "\n", + "\n", + "\n", + "\n", + "('BMCA_workflow', 'get_flux_from_expression', 'input_model')->('BMCA_workflow', 'get_flux_from_expression')\n", + "\n", + "\n", + "input_model\n", + "\n", + "\n", + "\n", + "\n", + "('BMCA_workflow', 'get_flux_from_expression', 'flux_variability_analysis', 'input_model')->('BMCA_workflow', 'get_flux_from_expression', 'flux_variability_analysis')\n", + "\n", + "\n", + "input_model\n", + "\n", + "\n", + "\n", + "\n", + "('BMCA_workflow', 'get_flux_from_expression', 'flux_variability_analysis', 'input_conditions')->('BMCA_workflow', 'get_flux_from_expression', 'flux_variability_analysis')\n", + "\n", + "\n", + "input_conditions\n", + "\n", + "\n", + "\n", + "\n", + "('BMCA_workflow', 'get_flux_from_expression', 'flux_variability_analysis', 'output_flux_bounds')->('BMCA_workflow', 'get_flux_from_expression', 'flux_variability_analysis')\n", + "\n", + "\n", + "output_flux_bounds\n", + "\n", + "\n", + "\n", + "\n", + "('BMCA_workflow', 'get_flux_from_expression', 'flux_variability_analysis', 'FBA', 'input_bounds')->('BMCA_workflow', 'get_flux_from_expression', 'flux_variability_analysis', 'FBA')\n", + "\n", + "\n", + "input_bounds\n", + "\n", + "\n", + "\n", + "\n", + "('BMCA_workflow', 'get_flux_from_expression', 'flux_variability_analysis', 'FBA', 'input_objective')->('BMCA_workflow', 'get_flux_from_expression', 'flux_variability_analysis', 'FBA')\n", + "\n", + "\n", + "input_objective\n", + "\n", + "\n", + "\n", + "\n", + "('BMCA_workflow', 'get_flux_from_expression', 'flux_variability_analysis', 'FBA', 'input_model')->('BMCA_workflow', 'get_flux_from_expression', 'flux_variability_analysis', 'FBA')\n", + "\n", + "\n", + "input_model\n", + "\n", + "\n", + "\n", + "\n", + "('BMCA_workflow', 'get_flux_from_expression', 'flux_variability_analysis', 'FBA', 'output_metabolite_dual_values')->('BMCA_workflow', 'get_flux_from_expression', 'flux_variability_analysis', 'FBA')\n", + "\n", + "\n", + "output_metabolite_dual_values\n", + "\n", + "\n", + "\n", + "\n", + "('BMCA_workflow', 'get_flux_from_expression', 'flux_variability_analysis', 'FBA', 'output_reaction_dual_values')->('BMCA_workflow', 'get_flux_from_expression', 'flux_variability_analysis', 'FBA')\n", + "\n", + "\n", + "output_reaction_dual_values\n", + "\n", + "\n", + "\n", + "\n", + "('BMCA_workflow', 'get_flux_from_expression', 'flux_variability_analysis', 'FBA', 'output_fluxes')->('BMCA_workflow', 'get_flux_from_expression', 'flux_variability_analysis', 'FBA')\n", + "\n", + "\n", + "output_fluxes\n", "\n", "\n", "\n" ], "text/plain": [ - "" + "" ] }, - "execution_count": 13, + "execution_count": 14, "metadata": {}, "output_type": "execute_result" } @@ -235,14 +318,23 @@ "\n", "spec = {\n", " 'BMCA_workflow': {\n", + "\n", + " # top-level ports\n", + " '_ports': {\n", + " 'input_expression': 'map[array[(genes),float]]',\n", + " 'input_model': 'sbml',\n", + " 'input_flux_data': 'maybe[array[(reactions),maybe[float]]]',\n", + " 'output_flux_control_coeff': 'array[(external_metabolites|reactions),float]',\n", + " 'output_metabolite_control_coeffs': 'array[(external_metabolites|reactions),float]',\n", + " },\n", + "\n", + " # internal states\n", " 'fluxes': {},\n", " 'internal_metabolites': {},\n", " 'external_metabolites': {},\n", " 'enzymes': {},\n", - " \n", - " '_ports': {\n", - " 'expression': 'map[array[(genes),float]]',\n", - " },\n", + "\n", + " # internal processes\n", " 'BMCA_inference': {\n", " '_ports': {\n", " 'input_fluxes': 'map[array[(reactions),float]]',\n", @@ -252,41 +344,111 @@ " 'input_fluxes': ['fluxes'],\n", " },\n", " },\n", - " 'eflux': {\n", + " 'get_flux_from_expression': {\n", " '_ports': {\n", + " 'input_method': 'enum[(e-flux,imat)]', # E-flux, iMAT\n", " 'input_expression': 'map[array[(genes),float]]',\n", " 'input_model': 'sbml',\n", " 'output_fluxes': 'map[array[(reactions),float]]',\n", + " # 'output_fba_config': ''\n", + " },\n", + " 'wires': {\n", + " 'output_fluxes': ['fluxes'],\n", " },\n", " 'config': {\n", " 'condition_normalization': 'A',\n", " 'scaling': 'media',\n", " },\n", - " 'FBA': {\n", + " 'flux_variability_analysis': {\n", " '_ports': {\n", - " 'input_bounds': 'array[(reactions),bounds]',\n", - " 'input_objective': 'objective',\n", " 'input_model': 'sbml',\n", - " 'output_metabolite_dual_values': 'array[(metabolites),float]',\n", - " 'output_reaction_dual_values': 'array[(reactions),float]',\n", - " 'output_fluxes': 'array[(reactions),float]',\n", + " 'input_conditions': '', # media conditions\n", + " 'output_flux_bounds': 'map[bounds]' # from reaction to bounds, launches 2 FBAs for each\n", + " },\n", + " 'FBA': { # these will actually be launched following the output of FVA\n", + " '_ports': {\n", + " 'input_bounds': 'array[(reactions),bounds]',\n", + " 'input_objective': 'objective',\n", + " 'input_model': 'sbml',\n", + " 'output_metabolite_dual_values': 'array[(total_metabolites),float]', # total_metabolites = internal_metabolites + external_metabolites\n", + " 'output_reaction_dual_values': 'array[(reactions),float]',\n", + " 'output_fluxes': 'array[(reactions),float]',\n", + " },\n", " },\n", - " },\n", - " 'wires': {\n", - " 'output_fluxes': ['fluxes'],\n", " },\n", " },\n", " }\n", "}\n", "\n", - "plot_bigraph(spec)" + "plot_bigraph(spec, \n", + " # remove_process_place_edges=True\n", + " )" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 7, "id": "1af3b2fe", "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Help on function plot_bigraph in module bigraph_viz.plot:\n", + "\n", + "plot_bigraph(bigraph_schema, size='16,10', node_label_size='12pt', show_values=False, show_types=False, show_process_schema=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', label_margin='0.05', 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", + " show_process_schema (bool, optional): Display process schema info as internal nodes. 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", + " label_margin (str, optional): The margin size around a label. Default is '0.05'.\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", + "\n" + ] + } + ], + "source": [ + "help(plot_bigraph)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "ad27ee01-e86d-4615-8ebe-b71d06ca9c6c", + "metadata": {}, "outputs": [], "source": [] } @@ -307,7 +469,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.9" + "version": "3.9.6" } }, "nbformat": 4,