From 73770281f341502c78a48aaf27913898573255be Mon Sep 17 00:00:00 2001 From: alexPatrie Date: Mon, 4 Mar 2024 18:24:22 -0500 Subject: [PATCH] updated single process with emitter in copasi notebook --- biosimulator_processes/data_model.py | 7 +- notebooks/copasi_process_composer.ipynb | 1297 ++++++++++++++++- .../single_copasi_process_with_emitter.json | 121 ++ 3 files changed, 1387 insertions(+), 38 deletions(-) create mode 100644 notebooks/out/single_copasi_process_with_emitter.json diff --git a/biosimulator_processes/data_model.py b/biosimulator_processes/data_model.py index e75579160..4e183e271 100644 --- a/biosimulator_processes/data_model.py +++ b/biosimulator_processes/data_model.py @@ -182,11 +182,16 @@ def set_value(cls): for input_value in cls.input_value_names} -class EmittedType: +class EmittedType(BaseModel): value_name: str _type: str # ie: 'tree[float]' +class EmitterConfig(BaseModel): + name: str + emit: Dict[str, str] # ie: 'floating_species': 'tree[float]', + + class EmitterInstance: _type: str = Field(default='step') address: str = Field(default='local:ram-emitter') diff --git a/notebooks/copasi_process_composer.ipynb b/notebooks/copasi_process_composer.ipynb index 8e516cb4b..9e1e52b5d 100644 --- a/notebooks/copasi_process_composer.ipynb +++ b/notebooks/copasi_process_composer.ipynb @@ -16,8 +16,8 @@ "id": "b43cd4493a594e60", "metadata": { "ExecuteTime": { - "end_time": "2024-03-04T23:07:14.317471Z", - "start_time": "2024-03-04T23:07:14.313373Z" + "end_time": "2024-03-04T23:17:58.240414Z", + "start_time": "2024-03-04T23:17:58.235247Z" }, "collapsed": false }, @@ -34,8 +34,8 @@ "id": "65385e04f4f5dd1a", "metadata": { "ExecuteTime": { - "end_time": "2024-03-04T23:07:17.585337Z", - "start_time": "2024-03-04T23:07:15.870759Z" + "end_time": "2024-03-04T23:17:59.982871Z", + "start_time": "2024-03-04T23:17:58.421455Z" }, "collapsed": false }, @@ -110,8 +110,8 @@ "id": "edf123175ec3408c", "metadata": { "ExecuteTime": { - "end_time": "2024-03-04T23:07:19.458874Z", - "start_time": "2024-03-04T23:07:19.454059Z" + "end_time": "2024-03-04T23:18:01.760731Z", + "start_time": "2024-03-04T23:18:01.755568Z" }, "collapsed": false }, @@ -2776,8 +2776,8 @@ "id": "ce4f0c6ccf60f638", "metadata": { "ExecuteTime": { - "end_time": "2024-03-04T23:07:30.348989Z", - "start_time": "2024-03-04T23:07:30.346625Z" + "end_time": "2024-03-04T23:18:09.840334Z", + "start_time": "2024-03-04T23:18:09.837494Z" }, "collapsed": false }, @@ -2796,8 +2796,8 @@ "id": "19a579660793cc7c", "metadata": { "ExecuteTime": { - "end_time": "2024-03-04T23:07:31.069807Z", - "start_time": "2024-03-04T23:07:31.067106Z" + "end_time": "2024-03-04T23:18:10.115381Z", + "start_time": "2024-03-04T23:18:10.113077Z" }, "collapsed": false }, @@ -2815,8 +2815,8 @@ "id": "680c6eb9d0fecba5", "metadata": { "ExecuteTime": { - "end_time": "2024-03-04T23:07:31.845501Z", - "start_time": "2024-03-04T23:07:31.843041Z" + "end_time": "2024-03-04T23:18:10.653564Z", + "start_time": "2024-03-04T23:18:10.650623Z" }, "collapsed": false }, @@ -2852,8 +2852,8 @@ "id": "23bbb7a5bed8008f", "metadata": { "ExecuteTime": { - "end_time": "2024-03-04T23:07:32.556442Z", - "start_time": "2024-03-04T23:07:32.502463Z" + "end_time": "2024-03-04T23:18:11.702178Z", + "start_time": "2024-03-04T23:18:11.646590Z" }, "collapsed": false }, @@ -2872,8 +2872,8 @@ "id": "170e47387a664a4a", "metadata": { "ExecuteTime": { - "end_time": "2024-03-04T23:07:33.009670Z", - "start_time": "2024-03-04T23:07:33.007819Z" + "end_time": "2024-03-04T23:18:12.334129Z", + "start_time": "2024-03-04T23:18:12.332044Z" }, "collapsed": false }, @@ -2888,8 +2888,8 @@ "id": "331ecf77da2a7c94", "metadata": { "ExecuteTime": { - "end_time": "2024-03-04T23:07:33.733036Z", - "start_time": "2024-03-04T23:07:33.548555Z" + "end_time": "2024-03-04T23:18:12.831152Z", + "start_time": "2024-03-04T23:18:12.670269Z" }, "collapsed": false }, @@ -3534,7 +3534,7 @@ "\n" ], "text/plain": [ - "" + "" ] }, "execution_count": 9, @@ -3552,8 +3552,8 @@ "id": "428c2e6ba402c64c", "metadata": { "ExecuteTime": { - "end_time": "2024-03-04T23:07:35.461662Z", - "start_time": "2024-03-04T23:07:35.457756Z" + "end_time": "2024-03-04T23:18:13.342371Z", + "start_time": "2024-03-04T23:18:13.339370Z" }, "collapsed": false }, @@ -3580,7 +3580,7 @@ " 'model_parameters': [ 'model_parameters_store'],\n", " 'reactions': ['reactions_store'],\n", " 'time': ['time_store']},\n", - " 'instance': ,\n", + " 'instance': ,\n", " 'interval': 1.0,\n", " 'outputs': { 'floating_species': [ 'floating_species_store'],\n", " 'time': ['time_store']}}})\n" @@ -3597,8 +3597,8 @@ "id": "4a56a56e317062f4", "metadata": { "ExecuteTime": { - "end_time": "2024-03-04T23:07:36.551010Z", - "start_time": "2024-03-04T23:07:36.543603Z" + "end_time": "2024-03-04T23:18:14.214419Z", + "start_time": "2024-03-04T23:18:14.206698Z" }, "collapsed": false }, @@ -3613,8 +3613,8 @@ "id": "a1b3395080f3a8e", "metadata": { "ExecuteTime": { - "end_time": "2024-03-04T23:07:38.694129Z", - "start_time": "2024-03-04T23:07:37.275923Z" + "end_time": "2024-03-04T23:18:16.748270Z", + "start_time": "2024-03-04T23:18:15.294011Z" }, "collapsed": false }, @@ -3623,7 +3623,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "Error while initializing the simulation: >ERROR 2024-03-04T18:07:37<\n", + "Error while initializing the simulation: >ERROR 2024-03-04T18:18:15<\n", " At least one reaction is reversible. That means stochastic simulation is not possible. \n", " You can use \"Tools|Convert to irreversible\" which will split the reversible reactions \n", " into two irreversible reactions. However you should check the kinetics afterwards.\n", @@ -3631,7 +3631,7 @@ "\n", "Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", "\n", - "Error while initializing the simulation: >ERROR 2024-03-04T18:07:37<\n", + "Error while initializing the simulation: >ERROR 2024-03-04T18:18:15<\n", " At least one reaction is reversible. That means stochastic simulation is not possible. \n", " You can use \"Tools|Convert to irreversible\" which will split the reversible reactions \n", " into two irreversible reactions. However you should check the kinetics afterwards.\n" @@ -3651,11 +3651,11 @@ "name": "stderr", "output_type": "stream", "text": [ - "Error while initializing the simulation: >ERROR 2024-03-04T18:07:37<\n", + "Error while initializing the simulation: >ERROR 2024-03-04T18:18:15<\n", " At least one reaction is reversible. That means stochastic simulation is not possible. \n", " You can use \"Tools|Convert to irreversible\" which will split the reversible reactions \n", " into two irreversible reactions. However you should check the kinetics afterwards.\n", - "Error while initializing the simulation: >ERROR 2024-03-04T18:07:37<\n", + "Error while initializing the simulation: >ERROR 2024-03-04T18:18:15<\n", " At least one reaction is reversible. That means stochastic simulation is not possible. \n", " You can use \"Tools|Convert to irreversible\" which will split the reversible reactions \n", " into two irreversible reactions. However you should check the kinetics afterwards.\n" @@ -3675,11 +3675,11 @@ "name": "stderr", "output_type": "stream", "text": [ - "Error while initializing the simulation: >ERROR 2024-03-04T18:07:37<\n", + "Error while initializing the simulation: >ERROR 2024-03-04T18:18:16<\n", " At least one reaction is reversible. That means stochastic simulation is not possible. \n", " You can use \"Tools|Convert to irreversible\" which will split the reversible reactions \n", " into two irreversible reactions. However you should check the kinetics afterwards.\n", - "Error while initializing the simulation: >ERROR 2024-03-04T18:07:38<\n", + "Error while initializing the simulation: >ERROR 2024-03-04T18:18:16<\n", " At least one reaction is reversible. That means stochastic simulation is not possible. \n", " You can use \"Tools|Convert to irreversible\" which will split the reversible reactions \n", " into two irreversible reactions. However you should check the kinetics afterwards.\n" @@ -3699,11 +3699,11 @@ "name": "stderr", "output_type": "stream", "text": [ - "Error while initializing the simulation: >ERROR 2024-03-04T18:07:38<\n", + "Error while initializing the simulation: >ERROR 2024-03-04T18:18:16<\n", " At least one reaction is reversible. That means stochastic simulation is not possible. \n", " You can use \"Tools|Convert to irreversible\" which will split the reversible reactions \n", " into two irreversible reactions. However you should check the kinetics afterwards.\n", - "Error while initializing the simulation: >ERROR 2024-03-04T18:07:38<\n", + "Error while initializing the simulation: >ERROR 2024-03-04T18:18:16<\n", " At least one reaction is reversible. That means stochastic simulation is not possible. \n", " You can use \"Tools|Convert to irreversible\" which will split the reversible reactions \n", " into two irreversible reactions. However you should check the kinetics afterwards.\n" @@ -3723,11 +3723,11 @@ "name": "stderr", "output_type": "stream", "text": [ - "Error while initializing the simulation: >ERROR 2024-03-04T18:07:38<\n", + "Error while initializing the simulation: >ERROR 2024-03-04T18:18:16<\n", " At least one reaction is reversible. That means stochastic simulation is not possible. \n", " You can use \"Tools|Convert to irreversible\" which will split the reversible reactions \n", " into two irreversible reactions. However you should check the kinetics afterwards.\n", - "Error while initializing the simulation: >ERROR 2024-03-04T18:07:38<\n", + "Error while initializing the simulation: >ERROR 2024-03-04T18:18:16<\n", " At least one reaction is reversible. That means stochastic simulation is not possible. \n", " You can use \"Tools|Convert to irreversible\" which will split the reversible reactions \n", " into two irreversible reactions. However you should check the kinetics afterwards.\n" @@ -3760,10 +3760,1233 @@ "Connect the single process to an emitter instance" ] }, + { + "cell_type": "code", + "execution_count": 13, + "id": "3b6c7e20988585e3", + "metadata": { + "ExecuteTime": { + "end_time": "2024-03-04T23:18:29.171822Z", + "start_time": "2024-03-04T23:18:29.168968Z" + }, + "collapsed": false + }, + "outputs": [], + "source": [ + "from biosimulator_processes.data_model import EmitterConfig, EmittedType\n", + "\n", + "\n", + "emitter_config = EmitterConfig(\n", + " emit=[\n", + " EmittedType(value_name='floating_species', _type='tree[float]'),\n", + " EmittedType(value_name='time', _type='float')\n", + " \n", + " ],\n", + " name='emitter'\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "id": "da53d193fa852065", + "metadata": { + "ExecuteTime": { + "end_time": "2024-03-04T23:19:49.999139Z", + "start_time": "2024-03-04T23:19:49.994864Z" + }, + "collapsed": false + }, + "outputs": [], + "source": [ + "b2[emitter_config.name].add_process(\n", + " name='ram-emitter',\n", + " emit={\n", + " 'floating_species': 'tree[float]',\n", + " 'time': 'float',\n", + " }\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "id": "76a20f80917f5cef", + "metadata": { + "ExecuteTime": { + "end_time": "2024-03-04T23:20:21.279681Z", + "start_time": "2024-03-04T23:20:21.277296Z" + }, + "collapsed": false + }, + "outputs": [], + "source": [ + "b2.connect_all()" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "id": "2d19f7c22becc02d", + "metadata": { + "ExecuteTime": { + "end_time": "2024-03-04T23:20:30.062556Z", + "start_time": "2024-03-04T23:20:29.893681Z" + }, + "collapsed": false + }, + "outputs": [ + { + "data": { + "image/svg+xml": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "bigraph\n", + "\n", + "\n", + "\n", + "('single_copasi_process', 'interval')\n", + "\n", + "interval\n", + "\n", + "\n", + "\n", + "('time_store',)\n", + "\n", + "time_store\n", + "\n", + "\n", + "\n", + "('single_copasi_process',)\n", + "\n", + "single_copasi_process\n", + "\n", + "\n", + "\n", + "('time_store',)->('single_copasi_process',)\n", + "\n", + "\n", + "time\n", + "\n", + "\n", + "\n", + "('time_store',)->('single_copasi_process',)\n", + "\n", + "\n", + "time\n", + "\n", + "\n", + "\n", + "('emitter',)\n", + "\n", + "emitter\n", + "\n", + "\n", + "\n", + "('time_store',)->('emitter',)\n", + "\n", + "\n", + "time\n", + "\n", + "\n", + "\n", + "('floating_species_store',)\n", + "\n", + "floating_species_store\n", + "\n", + "\n", + "\n", + "('floating_species_store', 'Extracellular glucose')\n", + "\n", + "Extracellular glucose\n", + "\n", + "\n", + "\n", + "('floating_species_store',)->('floating_species_store', 'Extracellular glucose')\n", + "\n", + "\n", + "\n", + "\n", + "('floating_species_store', 'Cytosolic glucose')\n", + "\n", + "Cytosolic glucose\n", + "\n", + "\n", + "\n", + "('floating_species_store',)->('floating_species_store', 'Cytosolic glucose')\n", + "\n", + "\n", + "\n", + "\n", + "('floating_species_store', 'ATP')\n", + "\n", + "ATP\n", + "\n", + "\n", + "\n", + "('floating_species_store',)->('floating_species_store', 'ATP')\n", + "\n", + "\n", + "\n", + "\n", + "('floating_species_store', 'Glucose-6-Phosphate')\n", + "\n", + "Glucose-6-Phosphate\n", + "\n", + "\n", + "\n", + "('floating_species_store',)->('floating_species_store', 'Glucose-6-Phosphate')\n", + "\n", + "\n", + "\n", + "\n", + "('floating_species_store', 'ADP')\n", + "\n", + "ADP\n", + "\n", + "\n", + "\n", + "('floating_species_store',)->('floating_species_store', 'ADP')\n", + "\n", + "\n", + "\n", + "\n", + "('floating_species_store', 'Fructose-6-Phosphate')\n", + "\n", + "Fructose-6-Phosphate\n", + "\n", + "\n", + "\n", + "('floating_species_store',)->('floating_species_store', 'Fructose-6-Phosphate')\n", + "\n", + "\n", + "\n", + "\n", + "('floating_species_store', 'Fructose 1,6-bisphosphate')\n", + "\n", + "Fructose 1,6-bisphosphate\n", + "\n", + "\n", + "\n", + "('floating_species_store',)->('floating_species_store', 'Fructose 1,6-bisphosphate')\n", + "\n", + "\n", + "\n", + "\n", + "('floating_species_store', 'Glyceraldehyde 3-phosphate')\n", + "\n", + "Glyceraldehyde 3-phosphate\n", + "\n", + "\n", + "\n", + "('floating_species_store',)->('floating_species_store', 'Glyceraldehyde 3-phosphate')\n", + "\n", + "\n", + "\n", + "\n", + "('floating_species_store', 'Dihydroxyacetone phosphate')\n", + "\n", + "Dihydroxyacetone phosphate\n", + "\n", + "\n", + "\n", + "('floating_species_store',)->('floating_species_store', 'Dihydroxyacetone phosphate')\n", + "\n", + "\n", + "\n", + "\n", + "('floating_species_store', 'NAD')\n", + "\n", + "NAD\n", + "\n", + "\n", + "\n", + "('floating_species_store',)->('floating_species_store', 'NAD')\n", + "\n", + "\n", + "\n", + "\n", + "('floating_species_store', '1,3-Bisphosphoglycerate')\n", + "\n", + "1,3-Bisphosphoglycerate\n", + "\n", + "\n", + "\n", + "('floating_species_store',)->('floating_species_store', '1,3-Bisphosphoglycerate')\n", + "\n", + "\n", + "\n", + "\n", + "('floating_species_store', 'NADH')\n", + "\n", + "NADH\n", + "\n", + "\n", + "\n", + "('floating_species_store',)->('floating_species_store', 'NADH')\n", + "\n", + "\n", + "\n", + "\n", + "('floating_species_store', 'Phosphoenolpyruvate')\n", + "\n", + "Phosphoenolpyruvate\n", + "\n", + "\n", + "\n", + "('floating_species_store',)->('floating_species_store', 'Phosphoenolpyruvate')\n", + "\n", + "\n", + "\n", + "\n", + "('floating_species_store', 'Pyruvate')\n", + "\n", + "Pyruvate\n", + "\n", + "\n", + "\n", + "('floating_species_store',)->('floating_species_store', 'Pyruvate')\n", + "\n", + "\n", + "\n", + "\n", + "('floating_species_store', 'Acetaldehyde')\n", + "\n", + "Acetaldehyde\n", + "\n", + "\n", + "\n", + "('floating_species_store',)->('floating_species_store', 'Acetaldehyde')\n", + "\n", + "\n", + "\n", + "\n", + "('floating_species_store', 'EtOH')\n", + "\n", + "EtOH\n", + "\n", + "\n", + "\n", + "('floating_species_store',)->('floating_species_store', 'EtOH')\n", + "\n", + "\n", + "\n", + "\n", + "('floating_species_store', 'Extracellular ethanol')\n", + "\n", + "Extracellular ethanol\n", + "\n", + "\n", + "\n", + "('floating_species_store',)->('floating_species_store', 'Extracellular ethanol')\n", + "\n", + "\n", + "\n", + "\n", + "('floating_species_store', 'Glycerol')\n", + "\n", + "Glycerol\n", + "\n", + "\n", + "\n", + "('floating_species_store',)->('floating_species_store', 'Glycerol')\n", + "\n", + "\n", + "\n", + "\n", + "('floating_species_store', 'Extracellular glycerol')\n", + "\n", + "Extracellular glycerol\n", + "\n", + "\n", + "\n", + "('floating_species_store',)->('floating_species_store', 'Extracellular glycerol')\n", + "\n", + "\n", + "\n", + "\n", + "('floating_species_store', 'Extracellular acetaldehyde')\n", + "\n", + "Extracellular acetaldehyde\n", + "\n", + "\n", + "\n", + "('floating_species_store',)->('floating_species_store', 'Extracellular acetaldehyde')\n", + "\n", + "\n", + "\n", + "\n", + "('floating_species_store', 'Extracellular cyanide')\n", + "\n", + "Extracellular cyanide\n", + "\n", + "\n", + "\n", + "('floating_species_store',)->('floating_species_store', 'Extracellular cyanide')\n", + "\n", + "\n", + "\n", + "\n", + "('floating_species_store', 'AMP')\n", + "\n", + "AMP\n", + "\n", + "\n", + "\n", + "('floating_species_store',)->('floating_species_store', 'AMP')\n", + "\n", + "\n", + "\n", + "\n", + "('floating_species_store', 'P')\n", + "\n", + "P\n", + "\n", + "\n", + "\n", + "('floating_species_store',)->('floating_species_store', 'P')\n", + "\n", + "\n", + "\n", + "\n", + "('floating_species_store', 'Mixed flow cyanide')\n", + "\n", + "Mixed flow cyanide\n", + "\n", + "\n", + "\n", + "('floating_species_store',)->('floating_species_store', 'Mixed flow cyanide')\n", + "\n", + "\n", + "\n", + "\n", + "('floating_species_store', 'Mixed flow glucose')\n", + "\n", + "Mixed flow glucose\n", + "\n", + "\n", + "\n", + "('floating_species_store',)->('floating_species_store', 'Mixed flow glucose')\n", + "\n", + "\n", + "\n", + "\n", + "('floating_species_store',)->('single_copasi_process',)\n", + "\n", + "\n", + "floating_species\n", + "\n", + "\n", + "\n", + "('floating_species_store',)->('single_copasi_process',)\n", + "\n", + "\n", + "floating_species\n", + "\n", + "\n", + "\n", + "('floating_species_store',)->('emitter',)\n", + "\n", + "\n", + "floating_species\n", + "\n", + "\n", + "\n", + "('model_parameters_store',)\n", + "\n", + "model_parameters_store\n", + "\n", + "\n", + "\n", + "('model_parameters_store',)->('single_copasi_process',)\n", + "\n", + "\n", + "model_parameters\n", + "\n", + "\n", + "\n", + "('reactions_store',)\n", + "\n", + "reactions_store\n", + "\n", + "\n", + "\n", + "('reactions_store', 'Glucose Mixed flow to extracellular medium')\n", + "\n", + "Glucose Mixed flow to extracellular medium\n", + "\n", + "\n", + "\n", + "('reactions_store',)->('reactions_store', 'Glucose Mixed flow to extracellular medium')\n", + "\n", + "\n", + "\n", + "\n", + "('reactions_store', 'Glucose uptake')\n", + "\n", + "Glucose uptake\n", + "\n", + "\n", + "\n", + "('reactions_store',)->('reactions_store', 'Glucose uptake')\n", + "\n", + "\n", + "\n", + "\n", + "('reactions_store', 'Hexokinase')\n", + "\n", + "Hexokinase\n", + "\n", + "\n", + "\n", + "('reactions_store',)->('reactions_store', 'Hexokinase')\n", + "\n", + "\n", + "\n", + "\n", + "('reactions_store', 'Phosphoglucoisomerase')\n", + "\n", + "Phosphoglucoisomerase\n", + "\n", + "\n", + "\n", + "('reactions_store',)->('reactions_store', 'Phosphoglucoisomerase')\n", + "\n", + "\n", + "\n", + "\n", + "('reactions_store', 'Phosphofructokinase')\n", + "\n", + "Phosphofructokinase\n", + "\n", + "\n", + "\n", + "('reactions_store',)->('reactions_store', 'Phosphofructokinase')\n", + "\n", + "\n", + "\n", + "\n", + "('reactions_store', 'Aldolase')\n", + "\n", + "Aldolase\n", + "\n", + "\n", + "\n", + "('reactions_store',)->('reactions_store', 'Aldolase')\n", + "\n", + "\n", + "\n", + "\n", + "('reactions_store', 'Triosephosphate isomerase')\n", + "\n", + "Triosephosphate isomerase\n", + "\n", + "\n", + "\n", + "('reactions_store',)->('reactions_store', 'Triosephosphate isomerase')\n", + "\n", + "\n", + "\n", + "\n", + "('reactions_store', 'Glyceraldehyde 3-phosphate dehydrogenase')\n", + "\n", + "Glyceraldehyde 3-phosphate dehydrogenase\n", + "\n", + "\n", + "\n", + "('reactions_store',)->('reactions_store', 'Glyceraldehyde 3-phosphate dehydrogenase')\n", + "\n", + "\n", + "\n", + "\n", + "('reactions_store', 'Phosphoenolpyruvate synthesis')\n", + "\n", + "Phosphoenolpyruvate synthesis\n", + "\n", + "\n", + "\n", + "('reactions_store',)->('reactions_store', 'Phosphoenolpyruvate synthesis')\n", + "\n", + "\n", + "\n", + "\n", + "('reactions_store', 'Pyruvate kinase')\n", + "\n", + "Pyruvate kinase\n", + "\n", + "\n", + "\n", + "('reactions_store',)->('reactions_store', 'Pyruvate kinase')\n", + "\n", + "\n", + "\n", + "\n", + "('reactions_store', 'Pyruvate decarboxylase')\n", + "\n", + "Pyruvate decarboxylase\n", + "\n", + "\n", + "\n", + "('reactions_store',)->('reactions_store', 'Pyruvate decarboxylase')\n", + "\n", + "\n", + "\n", + "\n", + "('reactions_store', 'Alcohol dehydrogenase')\n", + "\n", + "Alcohol dehydrogenase\n", + "\n", + "\n", + "\n", + "('reactions_store',)->('reactions_store', 'Alcohol dehydrogenase')\n", + "\n", + "\n", + "\n", + "\n", + "('reactions_store', 'Ethanol out')\n", + "\n", + "Ethanol out\n", + "\n", + "\n", + "\n", + "('reactions_store',)->('reactions_store', 'Ethanol out')\n", + "\n", + "\n", + "\n", + "\n", + "('reactions_store', 'Ethanol flow')\n", + "\n", + "Ethanol flow\n", + "\n", + "\n", + "\n", + "('reactions_store',)->('reactions_store', 'Ethanol flow')\n", + "\n", + "\n", + "\n", + "\n", + "('reactions_store', 'Glycerol synthesis')\n", + "\n", + "Glycerol synthesis\n", + "\n", + "\n", + "\n", + "('reactions_store',)->('reactions_store', 'Glycerol synthesis')\n", + "\n", + "\n", + "\n", + "\n", + "('reactions_store', 'Glycerol out')\n", + "\n", + "Glycerol out\n", + "\n", + "\n", + "\n", + "('reactions_store',)->('reactions_store', 'Glycerol out')\n", + "\n", + "\n", + "\n", + "\n", + "('reactions_store', 'Glycerol flow')\n", + "\n", + "Glycerol flow\n", + "\n", + "\n", + "\n", + "('reactions_store',)->('reactions_store', 'Glycerol flow')\n", + "\n", + "\n", + "\n", + "\n", + "('reactions_store', 'Acetaldehyde out')\n", + "\n", + "Acetaldehyde out\n", + "\n", + "\n", + "\n", + "('reactions_store',)->('reactions_store', 'Acetaldehyde out')\n", + "\n", + "\n", + "\n", + "\n", + "('reactions_store', 'Acetaldehyde flow')\n", + "\n", + "Acetaldehyde flow\n", + "\n", + "\n", + "\n", + "('reactions_store',)->('reactions_store', 'Acetaldehyde flow')\n", + "\n", + "\n", + "\n", + "\n", + "('reactions_store', 'Cyanide-Acetaldehyde flow')\n", + "\n", + "Cyanide-Acetaldehyde flow\n", + "\n", + "\n", + "\n", + "('reactions_store',)->('reactions_store', 'Cyanide-Acetaldehyde flow')\n", + "\n", + "\n", + "\n", + "\n", + "('reactions_store', 'Cyanide flow')\n", + "\n", + "Cyanide flow\n", + "\n", + "\n", + "\n", + "('reactions_store',)->('reactions_store', 'Cyanide flow')\n", + "\n", + "\n", + "\n", + "\n", + "('reactions_store', 'Storage')\n", + "\n", + "Storage\n", + "\n", + "\n", + "\n", + "('reactions_store',)->('reactions_store', 'Storage')\n", + "\n", + "\n", + "\n", + "\n", + "('reactions_store', 'ATP consumption')\n", + "\n", + "ATP consumption\n", + "\n", + "\n", + "\n", + "('reactions_store',)->('reactions_store', 'ATP consumption')\n", + "\n", + "\n", + "\n", + "\n", + "('reactions_store', 'Adenylate kinase')\n", + "\n", + "Adenylate kinase\n", + "\n", + "\n", + "\n", + "('reactions_store',)->('reactions_store', 'Adenylate kinase')\n", + "\n", + "\n", + "\n", + "\n", + "('reactions_store',)->('single_copasi_process',)\n", + "\n", + "\n", + "reactions\n", + "\n", + "\n", + "\n", + "('single_copasi_process',)->('single_copasi_process', 'interval')\n", + "\n", + "\n", + "\n", + "\n" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 17, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "b2.visualize()" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "id": "1631f93c85561972", + "metadata": { + "ExecuteTime": { + "end_time": "2024-03-04T23:20:42.489238Z", + "start_time": "2024-03-04T23:20:42.485673Z" + }, + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "Builder({ 'emitter': { '_type': 'step',\n", + " 'address': 'local:ram-emitter',\n", + " 'config': { 'emit': { 'floating_species': 'tree[float]',\n", + " 'time': 'float'}},\n", + " 'inputs': { 'floating_species': ['floating_species_store'],\n", + " 'time': ['time_store']},\n", + " 'instance': ,\n", + " 'outputs': {}},\n", + " 'floating_species_store': { '1,3-Bisphosphoglycerate': 0.0,\n", + " 'ADP': 0.0,\n", + " 'AMP': 0.0,\n", + " 'ATP': 0.0,\n", + " 'Acetaldehyde': 0.0,\n", + " 'Cytosolic glucose': 0.0,\n", + " 'Dihydroxyacetone phosphate': 0.0,\n", + " 'EtOH': 0.0,\n", + " 'Extracellular acetaldehyde': 0.0,\n", + " 'Extracellular cyanide': 0.0,\n", + " 'Extracellular ethanol': 0.0,\n", + " 'Extracellular glucose': 0.0,\n", + " 'Extracellular glycerol': 0.0,\n", + " 'Fructose 1,6-bisphosphate': 0.0,\n", + " 'Fructose-6-Phosphate': 0.0,\n", + " 'Glucose-6-Phosphate': 0.0,\n", + " 'Glyceraldehyde 3-phosphate': 0.0,\n", + " 'Glycerol': 0.0,\n", + " 'Mixed flow cyanide': 0.0,\n", + " 'Mixed flow glucose': 0.0,\n", + " 'NAD': 0.0,\n", + " 'NADH': 0.0,\n", + " 'P': 0.0,\n", + " 'Phosphoenolpyruvate': 0.0,\n", + " 'Pyruvate': 0.0},\n", + " 'global_time': 0.0,\n", + " 'model_parameters_store': {},\n", + " 'reactions_store': { 'ATP consumption': 0.0,\n", + " 'Acetaldehyde flow': 0.0,\n", + " 'Acetaldehyde out': 0.0,\n", + " 'Adenylate kinase': 0.0,\n", + " 'Alcohol dehydrogenase': 0.0,\n", + " 'Aldolase': 0.0,\n", + " 'Cyanide flow': 0.0,\n", + " 'Cyanide-Acetaldehyde flow': 0.0,\n", + " 'Ethanol flow': 0.0,\n", + " 'Ethanol out': 0.0,\n", + " 'Glucose Mixed flow to extracellular medium': 0.0,\n", + " 'Glucose uptake': 0.0,\n", + " 'Glyceraldehyde 3-phosphate dehydrogenase': 0.0,\n", + " 'Glycerol flow': 0.0,\n", + " 'Glycerol out': 0.0,\n", + " 'Glycerol synthesis': 0.0,\n", + " 'Hexokinase': 0.0,\n", + " 'Phosphoenolpyruvate synthesis': 0.0,\n", + " 'Phosphofructokinase': 0.0,\n", + " 'Phosphoglucoisomerase': 0.0,\n", + " 'Pyruvate decarboxylase': 0.0,\n", + " 'Pyruvate kinase': 0.0,\n", + " 'Storage': 0.0,\n", + " 'Triosephosphate isomerase': 0.0},\n", + " 'single_copasi_process': { '_type': 'process',\n", + " 'address': 'local:CopasiProcess',\n", + " 'config': { 'method': 'stochastic',\n", + " 'model': { 'model_changes': { 'global_parameter_changes': None,\n", + " 'reaction_changes': None,\n", + " 'species_changes': None},\n", + " 'model_id': 'BIOMD0000000061',\n", + " 'model_language': 'sbml',\n", + " 'model_name': 'Unnamed '\n", + " 'Composite '\n", + " 'Process '\n", + " 'Model',\n", + " 'model_source': { 'value': '../biosimulator_processes/model_files/BIOMD0000000061_url.xml'},\n", + " 'model_units': None}},\n", + " 'inputs': { 'floating_species': [ 'floating_species_store'],\n", + " 'model_parameters': [ 'model_parameters_store'],\n", + " 'reactions': ['reactions_store'],\n", + " 'time': ['time_store']},\n", + " 'instance': ,\n", + " 'interval': 1.0,\n", + " 'outputs': { 'floating_species': [ 'floating_species_store'],\n", + " 'time': ['time_store']}},\n", + " 'time_store': 0.0})" + ] + }, + "execution_count": 18, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "b2" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "id": "1efa617f7caaac83", + "metadata": { + "ExecuteTime": { + "end_time": "2024-03-04T23:21:55.432800Z", + "start_time": "2024-03-04T23:21:55.427188Z" + }, + "collapsed": false + }, + "outputs": [], + "source": [ + "composite3 = b2.generate()" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "id": "11e12cfd47a836d4", + "metadata": { + "ExecuteTime": { + "end_time": "2024-03-04T23:22:05.031018Z", + "start_time": "2024-03-04T23:22:03.619753Z" + }, + "collapsed": false + }, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "Error while initializing the simulation: >ERROR 2024-03-04T18:22:03<\n", + " At least one reaction is reversible. That means stochastic simulation is not possible. \n", + " You can use \"Tools|Convert to irreversible\" which will split the reversible reactions \n", + " into two irreversible reactions. However you should check the kinetics afterwards.\n", + "/Users/alex/Desktop/uchc_work/biosimulator-processes/notebooks/../biosimulator_processes/processes/copasi_process.py:253: FutureWarning:\n", + "\n", + "Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n", + "\n", + "Error while initializing the simulation: >ERROR 2024-03-04T18:22:03<\n", + " At least one reaction is reversible. That means stochastic simulation is not possible. \n", + " You can use \"Tools|Convert to irreversible\" which will split the reversible reactions \n", + " into two irreversible reactions. However you should check the kinetics afterwards.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "THE RESULTS AT INTERVAL 1.0:\n", + "{'time': 1.0, 'floating_species': {'Extracellular glucose': 6.7, 'Cytosolic glucose': 0.573074, 'ATP': 2.1, 'Glucose-6-Phosphate': 4.2, 'ADP': 1.5, 'Fructose-6-Phosphate': 0.49, 'Fructose 1,6-bisphosphate': 4.64, 'Glyceraldehyde 3-phosphate': 0.115, 'Dihydroxyacetone phosphate': 2.95, 'NAD': 0.65, '1,3-Bisphosphoglycerate': 0.00027, 'NADH': 0.33, 'Phosphoenolpyruvate': 0.04, 'Pyruvate': 8.7, 'Acetaldehyde': 1.48153, 'EtOH': 19.2379, 'Extracellular ethanol': 16.4514, 'Glycerol': 4.196, 'Extracellular glycerol': 1.68478, 'Extracellular acetaldehyde': 1.28836, 'Extracellular cyanide': 5.20358, 'AMP': 0.33, 'P': 0.0, 'Mixed flow cyanide': 5.6, 'Mixed flow glucose': 24.0}}\n", + "THE RESULTS AT INTERVAL 1.0:\n", + "{'time': 1.0, 'floating_species': {'Extracellular glucose': 6.7, 'Cytosolic glucose': 0.573074, 'ATP': 2.1, 'Glucose-6-Phosphate': 4.2, 'ADP': 1.5, 'Fructose-6-Phosphate': 0.49, 'Fructose 1,6-bisphosphate': 4.64, 'Glyceraldehyde 3-phosphate': 0.115, 'Dihydroxyacetone phosphate': 2.95, 'NAD': 0.65, '1,3-Bisphosphoglycerate': 0.00027, 'NADH': 0.33, 'Phosphoenolpyruvate': 0.04, 'Pyruvate': 8.7, 'Acetaldehyde': 1.48153, 'EtOH': 19.2379, 'Extracellular ethanol': 16.4514, 'Glycerol': 4.196, 'Extracellular glycerol': 1.68478, 'Extracellular acetaldehyde': 1.28836, 'Extracellular cyanide': 5.20358, 'AMP': 0.33, 'P': 0.0, 'Mixed flow cyanide': 5.6, 'Mixed flow glucose': 24.0}}\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "Error while initializing the simulation: >ERROR 2024-03-04T18:22:04<\n", + " At least one reaction is reversible. That means stochastic simulation is not possible. \n", + " You can use \"Tools|Convert to irreversible\" which will split the reversible reactions \n", + " into two irreversible reactions. However you should check the kinetics afterwards.\n", + "Error while initializing the simulation: >ERROR 2024-03-04T18:22:04<\n", + " At least one reaction is reversible. That means stochastic simulation is not possible. \n", + " You can use \"Tools|Convert to irreversible\" which will split the reversible reactions \n", + " into two irreversible reactions. However you should check the kinetics afterwards.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "THE RESULTS AT INTERVAL 1.0:\n", + "{'time': 1.0, 'floating_species': {'Extracellular glucose': 6.7, 'Cytosolic glucose': 0.573074, 'ATP': 2.1, 'Glucose-6-Phosphate': 4.2, 'ADP': 1.5, 'Fructose-6-Phosphate': 0.49, 'Fructose 1,6-bisphosphate': 4.64, 'Glyceraldehyde 3-phosphate': 0.115, 'Dihydroxyacetone phosphate': 2.95, 'NAD': 0.65, '1,3-Bisphosphoglycerate': 0.00027, 'NADH': 0.33, 'Phosphoenolpyruvate': 0.04, 'Pyruvate': 8.7, 'Acetaldehyde': 1.48153, 'EtOH': 19.2379, 'Extracellular ethanol': 16.4514, 'Glycerol': 4.196, 'Extracellular glycerol': 1.68478, 'Extracellular acetaldehyde': 1.28836, 'Extracellular cyanide': 5.20358, 'AMP': 0.33, 'P': 0.0, 'Mixed flow cyanide': 5.6, 'Mixed flow glucose': 24.0}}\n", + "THE RESULTS AT INTERVAL 1.0:\n", + "{'time': 1.0, 'floating_species': {'Extracellular glucose': 6.7, 'Cytosolic glucose': 0.573074, 'ATP': 2.1, 'Glucose-6-Phosphate': 4.2, 'ADP': 1.5, 'Fructose-6-Phosphate': 0.49, 'Fructose 1,6-bisphosphate': 4.64, 'Glyceraldehyde 3-phosphate': 0.115, 'Dihydroxyacetone phosphate': 2.95, 'NAD': 0.65, '1,3-Bisphosphoglycerate': 0.00027, 'NADH': 0.33, 'Phosphoenolpyruvate': 0.04, 'Pyruvate': 8.7, 'Acetaldehyde': 1.48153, 'EtOH': 19.2379, 'Extracellular ethanol': 16.4514, 'Glycerol': 4.196, 'Extracellular glycerol': 1.68478, 'Extracellular acetaldehyde': 1.28836, 'Extracellular cyanide': 5.20358, 'AMP': 0.33, 'P': 0.0, 'Mixed flow cyanide': 5.6, 'Mixed flow glucose': 24.0}}\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "Error while initializing the simulation: >ERROR 2024-03-04T18:22:04<\n", + " At least one reaction is reversible. That means stochastic simulation is not possible. \n", + " You can use \"Tools|Convert to irreversible\" which will split the reversible reactions \n", + " into two irreversible reactions. However you should check the kinetics afterwards.\n", + "Error while initializing the simulation: >ERROR 2024-03-04T18:22:04<\n", + " At least one reaction is reversible. That means stochastic simulation is not possible. \n", + " You can use \"Tools|Convert to irreversible\" which will split the reversible reactions \n", + " into two irreversible reactions. However you should check the kinetics afterwards.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "THE RESULTS AT INTERVAL 1.0:\n", + "{'time': 1.0, 'floating_species': {'Extracellular glucose': 6.7, 'Cytosolic glucose': 0.573074, 'ATP': 2.1, 'Glucose-6-Phosphate': 4.2, 'ADP': 1.5, 'Fructose-6-Phosphate': 0.49, 'Fructose 1,6-bisphosphate': 4.64, 'Glyceraldehyde 3-phosphate': 0.115, 'Dihydroxyacetone phosphate': 2.95, 'NAD': 0.65, '1,3-Bisphosphoglycerate': 0.00027, 'NADH': 0.33, 'Phosphoenolpyruvate': 0.04, 'Pyruvate': 8.7, 'Acetaldehyde': 1.48153, 'EtOH': 19.2379, 'Extracellular ethanol': 16.4514, 'Glycerol': 4.196, 'Extracellular glycerol': 1.68478, 'Extracellular acetaldehyde': 1.28836, 'Extracellular cyanide': 5.20358, 'AMP': 0.33, 'P': 0.0, 'Mixed flow cyanide': 5.6, 'Mixed flow glucose': 24.0}}\n", + "THE RESULTS AT INTERVAL 1.0:\n", + "{'time': 1.0, 'floating_species': {'Extracellular glucose': 6.7, 'Cytosolic glucose': 0.573074, 'ATP': 2.1, 'Glucose-6-Phosphate': 4.2, 'ADP': 1.5, 'Fructose-6-Phosphate': 0.49, 'Fructose 1,6-bisphosphate': 4.64, 'Glyceraldehyde 3-phosphate': 0.115, 'Dihydroxyacetone phosphate': 2.95, 'NAD': 0.65, '1,3-Bisphosphoglycerate': 0.00027, 'NADH': 0.33, 'Phosphoenolpyruvate': 0.04, 'Pyruvate': 8.7, 'Acetaldehyde': 1.48153, 'EtOH': 19.2379, 'Extracellular ethanol': 16.4514, 'Glycerol': 4.196, 'Extracellular glycerol': 1.68478, 'Extracellular acetaldehyde': 1.28836, 'Extracellular cyanide': 5.20358, 'AMP': 0.33, 'P': 0.0, 'Mixed flow cyanide': 5.6, 'Mixed flow glucose': 24.0}}\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "Error while initializing the simulation: >ERROR 2024-03-04T18:22:04<\n", + " At least one reaction is reversible. That means stochastic simulation is not possible. \n", + " You can use \"Tools|Convert to irreversible\" which will split the reversible reactions \n", + " into two irreversible reactions. However you should check the kinetics afterwards.\n", + "Error while initializing the simulation: >ERROR 2024-03-04T18:22:04<\n", + " At least one reaction is reversible. That means stochastic simulation is not possible. \n", + " You can use \"Tools|Convert to irreversible\" which will split the reversible reactions \n", + " into two irreversible reactions. However you should check the kinetics afterwards.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "THE RESULTS AT INTERVAL 1.0:\n", + "{'time': 1.0, 'floating_species': {'Extracellular glucose': 6.7, 'Cytosolic glucose': 0.573074, 'ATP': 2.1, 'Glucose-6-Phosphate': 4.2, 'ADP': 1.5, 'Fructose-6-Phosphate': 0.49, 'Fructose 1,6-bisphosphate': 4.64, 'Glyceraldehyde 3-phosphate': 0.115, 'Dihydroxyacetone phosphate': 2.95, 'NAD': 0.65, '1,3-Bisphosphoglycerate': 0.00027, 'NADH': 0.33, 'Phosphoenolpyruvate': 0.04, 'Pyruvate': 8.7, 'Acetaldehyde': 1.48153, 'EtOH': 19.2379, 'Extracellular ethanol': 16.4514, 'Glycerol': 4.196, 'Extracellular glycerol': 1.68478, 'Extracellular acetaldehyde': 1.28836, 'Extracellular cyanide': 5.20358, 'AMP': 0.33, 'P': 0.0, 'Mixed flow cyanide': 5.6, 'Mixed flow glucose': 24.0}}\n", + "THE RESULTS AT INTERVAL 1.0:\n", + "{'time': 1.0, 'floating_species': {'Extracellular glucose': 6.7, 'Cytosolic glucose': 0.573074, 'ATP': 2.1, 'Glucose-6-Phosphate': 4.2, 'ADP': 1.5, 'Fructose-6-Phosphate': 0.49, 'Fructose 1,6-bisphosphate': 4.64, 'Glyceraldehyde 3-phosphate': 0.115, 'Dihydroxyacetone phosphate': 2.95, 'NAD': 0.65, '1,3-Bisphosphoglycerate': 0.00027, 'NADH': 0.33, 'Phosphoenolpyruvate': 0.04, 'Pyruvate': 8.7, 'Acetaldehyde': 1.48153, 'EtOH': 19.2379, 'Extracellular ethanol': 16.4514, 'Glycerol': 4.196, 'Extracellular glycerol': 1.68478, 'Extracellular acetaldehyde': 1.28836, 'Extracellular cyanide': 5.20358, 'AMP': 0.33, 'P': 0.0, 'Mixed flow cyanide': 5.6, 'Mixed flow glucose': 24.0}}\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "Error while initializing the simulation: >ERROR 2024-03-04T18:22:04<\n", + " At least one reaction is reversible. That means stochastic simulation is not possible. \n", + " You can use \"Tools|Convert to irreversible\" which will split the reversible reactions \n", + " into two irreversible reactions. However you should check the kinetics afterwards.\n", + "Error while initializing the simulation: >ERROR 2024-03-04T18:22:05<\n", + " At least one reaction is reversible. That means stochastic simulation is not possible. \n", + " You can use \"Tools|Convert to irreversible\" which will split the reversible reactions \n", + " into two irreversible reactions. However you should check the kinetics afterwards.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "THE RESULTS AT INTERVAL 1.0:\n", + "{'time': 1.0, 'floating_species': {'Extracellular glucose': 6.7, 'Cytosolic glucose': 0.573074, 'ATP': 2.1, 'Glucose-6-Phosphate': 4.2, 'ADP': 1.5, 'Fructose-6-Phosphate': 0.49, 'Fructose 1,6-bisphosphate': 4.64, 'Glyceraldehyde 3-phosphate': 0.115, 'Dihydroxyacetone phosphate': 2.95, 'NAD': 0.65, '1,3-Bisphosphoglycerate': 0.00027, 'NADH': 0.33, 'Phosphoenolpyruvate': 0.04, 'Pyruvate': 8.7, 'Acetaldehyde': 1.48153, 'EtOH': 19.2379, 'Extracellular ethanol': 16.4514, 'Glycerol': 4.196, 'Extracellular glycerol': 1.68478, 'Extracellular acetaldehyde': 1.28836, 'Extracellular cyanide': 5.20358, 'AMP': 0.33, 'P': 0.0, 'Mixed flow cyanide': 5.6, 'Mixed flow glucose': 24.0}}\n", + "THE RESULTS AT INTERVAL 1.0:\n", + "{'time': 1.0, 'floating_species': {'Extracellular glucose': 6.7, 'Cytosolic glucose': 0.573074, 'ATP': 2.1, 'Glucose-6-Phosphate': 4.2, 'ADP': 1.5, 'Fructose-6-Phosphate': 0.49, 'Fructose 1,6-bisphosphate': 4.64, 'Glyceraldehyde 3-phosphate': 0.115, 'Dihydroxyacetone phosphate': 2.95, 'NAD': 0.65, '1,3-Bisphosphoglycerate': 0.00027, 'NADH': 0.33, 'Phosphoenolpyruvate': 0.04, 'Pyruvate': 8.7, 'Acetaldehyde': 1.48153, 'EtOH': 19.2379, 'Extracellular ethanol': 16.4514, 'Glycerol': 4.196, 'Extracellular glycerol': 1.68478, 'Extracellular acetaldehyde': 1.28836, 'Extracellular cyanide': 5.20358, 'AMP': 0.33, 'P': 0.0, 'Mixed flow cyanide': 5.6, 'Mixed flow glucose': 24.0}}\n" + ] + } + ], + "source": [ + "composite3.run(10)" + ] + }, + { + "cell_type": "markdown", + "id": "15fd08060616b9", + "metadata": { + "collapsed": false + }, + "source": [ + "Save the composite to a file" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "id": "7bee095fb9b44a98", + "metadata": { + "ExecuteTime": { + "end_time": "2024-03-04T23:23:16.692323Z", + "start_time": "2024-03-04T23:23:16.689132Z" + }, + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "File 'single_copasi_process_with_emitter' successfully written in 'out' directory.\n" + ] + } + ], + "source": [ + "b2.write(filename='single_copasi_process_with_emitter')" + ] + }, + { + "cell_type": "markdown", + "id": "c4eb72c1bdc49509", + "metadata": { + "collapsed": false + }, + "source": [] + }, + { + "cell_type": "code", + "execution_count": 22, + "id": "1c8ed454cde6f6d9", + "metadata": { + "ExecuteTime": { + "end_time": "2024-03-04T23:23:39.391938Z", + "start_time": "2024-03-04T23:23:39.259134Z" + }, + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "single_copasi_process_with_emitter.json\r\n" + ] + } + ], + "source": [ + "!ls out" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "id": "c04b11acb055eaa8", + "metadata": { + "ExecuteTime": { + "end_time": "2024-03-04T23:24:02.071587Z", + "start_time": "2024-03-04T23:24:01.951001Z" + }, + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{\r\n", + " \"single_copasi_process\": {\r\n", + " \"_type\": \"process\",\r\n", + " \"address\": \"local:CopasiProcess\",\r\n", + " \"config\": {\r\n", + " \"model\": {\r\n", + " \"model_id\": \"BIOMD0000000061\",\r\n", + " \"model_source\": {\r\n", + " \"value\": \"../biosimulator_processes/model_files/BIOMD0000000061_url.xml\"\r\n", + " },\r\n", + " \"model_language\": \"sbml\",\r\n", + " \"model_name\": \"Unnamed Composite Process Model\",\r\n", + " \"model_changes\": {\r\n", + " \"species_changes\": null,\r\n", + " \"global_parameter_changes\": null,\r\n", + " \"reaction_changes\": null\r\n", + " },\r\n", + " \"model_units\": null\r\n", + " },\r\n", + " \"method\": \"stochastic\"\r\n", + " },\r\n", + " \"inputs\": {\r\n", + " \"time\": [\r\n", + " \"time_store\"\r\n", + " ],\r\n", + " \"floating_species\": [\r\n", + " \"floating_species_store\"\r\n", + " ],\r\n", + " \"model_parameters\": [\r\n", + " \"model_parameters_store\"\r\n", + " ],\r\n", + " \"reactions\": [\r\n", + " \"reactions_store\"\r\n", + " ]\r\n", + " },\r\n", + " \"outputs\": {\r\n", + " \"time\": [\r\n", + " \"time_store\"\r\n", + " ],\r\n", + " \"floating_species\": [\r\n", + " \"floating_species_store\"\r\n", + " ]\r\n", + " },\r\n", + " \"interval\": 1.0\r\n", + " },\r\n", + " \"global_time\": \"0.0\",\r\n", + " \"time_store\": \"0.0\",\r\n", + " \"floating_species_store\": {\r\n", + " \"Extracellular glucose\": \"0.0\",\r\n", + " \"Cytosolic glucose\": \"0.0\",\r\n", + " \"ATP\": \"0.0\",\r\n", + " \"Glucose-6-Phosphate\": \"0.0\",\r\n", + " \"ADP\": \"0.0\",\r\n", + " \"Fructose-6-Phosphate\": \"0.0\",\r\n", + " \"Fructose 1,6-bisphosphate\": \"0.0\",\r\n", + " \"Glyceraldehyde 3-phosphate\": \"0.0\",\r\n", + " \"Dihydroxyacetone phosphate\": \"0.0\",\r\n", + " \"NAD\": \"0.0\",\r\n", + " \"1,3-Bisphosphoglycerate\": \"0.0\",\r\n", + " \"NADH\": \"0.0\",\r\n", + " \"Phosphoenolpyruvate\": \"0.0\",\r\n", + " \"Pyruvate\": \"0.0\",\r\n", + " \"Acetaldehyde\": \"0.0\",\r\n", + " \"EtOH\": \"0.0\",\r\n", + " \"Extracellular ethanol\": \"0.0\",\r\n", + " \"Glycerol\": \"0.0\",\r\n", + " \"Extracellular glycerol\": \"0.0\",\r\n", + " \"Extracellular acetaldehyde\": \"0.0\",\r\n", + " \"Extracellular cyanide\": \"0.0\",\r\n", + " \"AMP\": \"0.0\",\r\n", + " \"P\": \"0.0\",\r\n", + " \"Mixed flow cyanide\": \"0.0\",\r\n", + " \"Mixed flow glucose\": \"0.0\"\r\n", + " },\r\n", + " \"model_parameters_store\": {},\r\n", + " \"reactions_store\": {\r\n", + " \"Glucose Mixed flow to extracellular medium\": \"0.0\",\r\n", + " \"Glucose uptake\": \"0.0\",\r\n", + " \"Hexokinase\": \"0.0\",\r\n", + " \"Phosphoglucoisomerase\": \"0.0\",\r\n", + " \"Phosphofructokinase\": \"0.0\",\r\n", + " \"Aldolase\": \"0.0\",\r\n", + " \"Triosephosphate isomerase\": \"0.0\",\r\n", + " \"Glyceraldehyde 3-phosphate dehydrogenase\": \"0.0\",\r\n", + " \"Phosphoenolpyruvate synthesis\": \"0.0\",\r\n", + " \"Pyruvate kinase\": \"0.0\",\r\n", + " \"Pyruvate decarboxylase\": \"0.0\",\r\n", + " \"Alcohol dehydrogenase\": \"0.0\",\r\n", + " \"Ethanol out\": \"0.0\",\r\n", + " \"Ethanol flow\": \"0.0\",\r\n", + " \"Glycerol synthesis\": \"0.0\",\r\n", + " \"Glycerol out\": \"0.0\",\r\n", + " \"Glycerol flow\": \"0.0\",\r\n", + " \"Acetaldehyde out\": \"0.0\",\r\n", + " \"Acetaldehyde flow\": \"0.0\",\r\n", + " \"Cyanide-Acetaldehyde flow\": \"0.0\",\r\n", + " \"Cyanide flow\": \"0.0\",\r\n", + " \"Storage\": \"0.0\",\r\n", + " \"ATP consumption\": \"0.0\",\r\n", + " \"Adenylate kinase\": \"0.0\"\r\n", + " },\r\n", + " \"emitter\": {\r\n", + " \"_type\": \"step\",\r\n", + " \"address\": \"local:ram-emitter\",\r\n", + " \"config\": {\r\n", + " \"emit\": {\r\n", + " \"floating_species\": \"tree[float]\",\r\n", + " \"time\": \"float\"\r\n", + " }\r\n", + " },\r\n", + " \"inputs\": {\r\n", + " \"floating_species\": [\r\n", + " \"floating_species_store\"\r\n", + " ],\r\n", + " \"time\": [\r\n", + " \"time_store\"\r\n", + " ]\r\n", + " },\r\n", + " \"outputs\": {}\r\n", + " }\r\n", + "}" + ] + } + ], + "source": [ + "!cat out/single_copasi_process_with_emitter.json" + ] + }, { "cell_type": "code", "execution_count": null, - "id": "477c5b2aa2f550c5", + "id": "6745bf0c8cdd2ddc", "metadata": { "collapsed": false }, diff --git a/notebooks/out/single_copasi_process_with_emitter.json b/notebooks/out/single_copasi_process_with_emitter.json new file mode 100644 index 000000000..25d9fc48e --- /dev/null +++ b/notebooks/out/single_copasi_process_with_emitter.json @@ -0,0 +1,121 @@ +{ + "single_copasi_process": { + "_type": "process", + "address": "local:CopasiProcess", + "config": { + "model": { + "model_id": "BIOMD0000000061", + "model_source": { + "value": "../biosimulator_processes/model_files/BIOMD0000000061_url.xml" + }, + "model_language": "sbml", + "model_name": "Unnamed Composite Process Model", + "model_changes": { + "species_changes": null, + "global_parameter_changes": null, + "reaction_changes": null + }, + "model_units": null + }, + "method": "stochastic" + }, + "inputs": { + "time": [ + "time_store" + ], + "floating_species": [ + "floating_species_store" + ], + "model_parameters": [ + "model_parameters_store" + ], + "reactions": [ + "reactions_store" + ] + }, + "outputs": { + "time": [ + "time_store" + ], + "floating_species": [ + "floating_species_store" + ] + }, + "interval": 1.0 + }, + "global_time": "0.0", + "time_store": "0.0", + "floating_species_store": { + "Extracellular glucose": "0.0", + "Cytosolic glucose": "0.0", + "ATP": "0.0", + "Glucose-6-Phosphate": "0.0", + "ADP": "0.0", + "Fructose-6-Phosphate": "0.0", + "Fructose 1,6-bisphosphate": "0.0", + "Glyceraldehyde 3-phosphate": "0.0", + "Dihydroxyacetone phosphate": "0.0", + "NAD": "0.0", + "1,3-Bisphosphoglycerate": "0.0", + "NADH": "0.0", + "Phosphoenolpyruvate": "0.0", + "Pyruvate": "0.0", + "Acetaldehyde": "0.0", + "EtOH": "0.0", + "Extracellular ethanol": "0.0", + "Glycerol": "0.0", + "Extracellular glycerol": "0.0", + "Extracellular acetaldehyde": "0.0", + "Extracellular cyanide": "0.0", + "AMP": "0.0", + "P": "0.0", + "Mixed flow cyanide": "0.0", + "Mixed flow glucose": "0.0" + }, + "model_parameters_store": {}, + "reactions_store": { + "Glucose Mixed flow to extracellular medium": "0.0", + "Glucose uptake": "0.0", + "Hexokinase": "0.0", + "Phosphoglucoisomerase": "0.0", + "Phosphofructokinase": "0.0", + "Aldolase": "0.0", + "Triosephosphate isomerase": "0.0", + "Glyceraldehyde 3-phosphate dehydrogenase": "0.0", + "Phosphoenolpyruvate synthesis": "0.0", + "Pyruvate kinase": "0.0", + "Pyruvate decarboxylase": "0.0", + "Alcohol dehydrogenase": "0.0", + "Ethanol out": "0.0", + "Ethanol flow": "0.0", + "Glycerol synthesis": "0.0", + "Glycerol out": "0.0", + "Glycerol flow": "0.0", + "Acetaldehyde out": "0.0", + "Acetaldehyde flow": "0.0", + "Cyanide-Acetaldehyde flow": "0.0", + "Cyanide flow": "0.0", + "Storage": "0.0", + "ATP consumption": "0.0", + "Adenylate kinase": "0.0" + }, + "emitter": { + "_type": "step", + "address": "local:ram-emitter", + "config": { + "emit": { + "floating_species": "tree[float]", + "time": "float" + } + }, + "inputs": { + "floating_species": [ + "floating_species_store" + ], + "time": [ + "time_store" + ] + }, + "outputs": {} + } +} \ No newline at end of file