From 75a33f5faec00a989d5e80a9ffb933e767f743a1 Mon Sep 17 00:00:00 2001 From: alexPatrie Date: Mon, 4 Mar 2024 11:39:33 -0500 Subject: [PATCH] reafactor --- .../processes/copasi_process.py | 17 +- notebooks/copasi_process_composer.ipynb | 405 ++++++++++-------- 2 files changed, 236 insertions(+), 186 deletions(-) diff --git a/biosimulator_processes/processes/copasi_process.py b/biosimulator_processes/processes/copasi_process.py index 19f585296..8ec64b79f 100644 --- a/biosimulator_processes/processes/copasi_process.py +++ b/biosimulator_processes/processes/copasi_process.py @@ -138,14 +138,18 @@ def __init__(self, config=None, core=None): if species_changes: for species_change in species_changes: if isinstance(species_change, dict): - set_species(**species_change, model=self.copasi_model_object) + species_name = species_change.pop('name') + changes_to_apply = {} + for spec_param_type, spec_param_value in species_change.items(): + if spec_param_value: + changes_to_apply[spec_param_type] = spec_param_value + set_species(**changes_to_apply, model=self.copasi_model_object) # Get the species (floating only) TODO: add boundary species self.floating_species_list = get_species(model=self.copasi_model_object).index.tolist() self.floating_species_initial = get_species(model=self.copasi_model_object)['concentration'].tolist() # ----GLOBAL PARAMS: set global parameter changes - existing_global_parameters = get_parameters(model=self.copasi_model_object).index global_parameter_changes = self.model_changes.get('global_parameter_changes', []) if global_parameter_changes: for param_change in global_parameter_changes: @@ -156,9 +160,12 @@ def __init__(self, config=None, core=None): # handle changes to existing params set_parameters(name=param_name, **param_change, model=self.copasi_model_object) # set new params - if param_name not in existing_global_parameters: - assert param_change.get('initial_concentration') is not None, "You must pass an initial_concentration value if adding a new global parameter." - add_parameter(name=param_name, **param_change, model=self.copasi_model_object) + global_params = get_parameters(model=self.copasi_model_object) + if global_params: + existing_global_parameters = global_params.index + if param_name not in existing_global_parameters: + assert param_change.get('initial_concentration') is not None, "You must pass an initial_concentration value if adding a new global parameter." + add_parameter(name=param_name, **param_change, model=self.copasi_model_object) # Get the list of parameters and their values (it is possible to run a model without any parameters) model_parameters = get_parameters(model=self.copasi_model_object) diff --git a/notebooks/copasi_process_composer.ipynb b/notebooks/copasi_process_composer.ipynb index 1c360e803..5b0763b25 100644 --- a/notebooks/copasi_process_composer.ipynb +++ b/notebooks/copasi_process_composer.ipynb @@ -12,7 +12,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 1, "outputs": [], "source": [ "import sys \n", @@ -22,15 +22,15 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2024-03-04T15:50:54.165547Z", - "start_time": "2024-03-04T15:50:54.159995Z" + "end_time": "2024-03-04T16:36:20.943311Z", + "start_time": "2024-03-04T16:36:20.937615Z" } }, "id": "b43cd4493a594e60" }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 2, "outputs": [ { "name": "stdout", @@ -53,8 +53,8 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2024-03-04T15:50:55.445556Z", - "start_time": "2024-03-04T15:50:54.313818Z" + "end_time": "2024-03-04T16:36:22.632529Z", + "start_time": "2024-03-04T16:36:21.102685Z" } }, "id": "65385e04f4f5dd1a" @@ -71,27 +71,44 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "outputs": [], "source": [ "b = BiosimulatorBuilder()" ], "metadata": { - "collapsed": false + "collapsed": false, + "ExecuteTime": { + "end_time": "2024-03-04T16:36:22.633232Z", + "start_time": "2024-03-04T16:36:22.631252Z" + } }, "id": "cc709690e20090cf" }, { "cell_type": "code", - "execution_count": null, - "outputs": [], + "execution_count": 4, + "outputs": [ + { + "data": { + "text/plain": "['CobraProcess',\n 'TelluriumProcess',\n 'CopasiProcess',\n 'ram-emitter',\n 'SmoldynProcess',\n 'console-emitter']" + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "###### list registered processes\n", "\n", "b.list_processes()" ], "metadata": { - "collapsed": false + "collapsed": false, + "ExecuteTime": { + "end_time": "2024-03-04T16:36:22.637077Z", + "start_time": "2024-03-04T16:36:22.634683Z" + } }, "id": "41034be54d9cf16" }, @@ -107,11 +124,15 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 4, "outputs": [], "source": [], "metadata": { - "collapsed": false + "collapsed": false, + "ExecuteTime": { + "end_time": "2024-03-04T16:36:23.744581Z", + "start_time": "2024-03-04T16:36:23.741537Z" + } }, "id": "f1e5eedb251a22c3" }, @@ -137,7 +158,16 @@ }, { "cell_type": "code", - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": "True" + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "from basico import * \n", "\n", @@ -147,28 +177,61 @@ "os.path.exists(model_filepath)" ], "metadata": { - "collapsed": false + "collapsed": false, + "ExecuteTime": { + "end_time": "2024-03-04T16:36:24.589871Z", + "start_time": "2024-03-04T16:36:24.585837Z" + } }, "id": "edf123175ec3408c", - "execution_count": null + "execution_count": 5 }, { "cell_type": "code", - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": " compartment type unit \\\nname \nExtracellular glucose extracellular reactions mmol/l \nCytosolic glucose cytosol reactions mmol/l \nATP cytosol reactions mmol/l \nGlucose-6-Phosphate cytosol reactions mmol/l \nADP cytosol reactions mmol/l \nFructose-6-Phosphate cytosol reactions mmol/l \nFructose 1,6-bisphosphate cytosol reactions mmol/l \nGlyceraldehyde 3-phosphate cytosol reactions mmol/l \nDihydroxyacetone phosphate cytosol reactions mmol/l \nNAD cytosol reactions mmol/l \n1,3-Bisphosphoglycerate cytosol reactions mmol/l \nNADH cytosol reactions mmol/l \nPhosphoenolpyruvate cytosol reactions mmol/l \nPyruvate cytosol reactions mmol/l \nAcetaldehyde cytosol reactions mmol/l \nEtOH cytosol reactions mmol/l \nExtracellular ethanol extracellular reactions mmol/l \nGlycerol cytosol reactions mmol/l \nExtracellular glycerol extracellular reactions mmol/l \nExtracellular acetaldehyde extracellular reactions mmol/l \nExtracellular cyanide extracellular reactions mmol/l \nAMP cytosol reactions mmol/l \nP extracellular fixed mmol/l \nMixed flow cyanide extracellular fixed mmol/l \nMixed flow glucose extracellular fixed mmol/l \n\n initial_concentration initial_particle_number \\\nname \nExtracellular glucose 6.700000 4.034834e+21 \nCytosolic glucose 0.573074 3.451132e+20 \nATP 2.100000 1.264650e+21 \nGlucose-6-Phosphate 4.200000 2.529299e+21 \nADP 1.500000 9.033211e+20 \nFructose-6-Phosphate 0.490000 2.950849e+20 \nFructose 1,6-bisphosphate 4.640000 2.794273e+21 \nGlyceraldehyde 3-phosphate 0.115000 6.925462e+19 \nDihydroxyacetone phosphate 2.950000 1.776532e+21 \nNAD 0.650000 3.914391e+20 \n1,3-Bisphosphoglycerate 0.000270 1.625978e+17 \nNADH 0.330000 1.987306e+20 \nPhosphoenolpyruvate 0.040000 2.408856e+19 \nPyruvate 8.700000 5.239262e+21 \nAcetaldehyde 1.481530 8.921982e+20 \nEtOH 19.237900 1.158533e+22 \nExtracellular ethanol 16.451400 9.907265e+21 \nGlycerol 4.196000 2.526890e+21 \nExtracellular glycerol 1.684780 1.014598e+21 \nExtracellular acetaldehyde 1.288360 7.758685e+20 \nExtracellular cyanide 5.203580 3.133669e+21 \nAMP 0.330000 1.987306e+20 \nP 0.000000 0.000000e+00 \nMixed flow cyanide 5.600000 3.372399e+21 \nMixed flow glucose 24.000000 1.445314e+22 \n\n initial_expression expression concentration \\\nname \nExtracellular glucose 6.700000 \nCytosolic glucose 0.573074 \nATP 2.100000 \nGlucose-6-Phosphate 4.200000 \nADP 1.500000 \nFructose-6-Phosphate 0.490000 \nFructose 1,6-bisphosphate 4.640000 \nGlyceraldehyde 3-phosphate 0.115000 \nDihydroxyacetone phosphate 2.950000 \nNAD 0.650000 \n1,3-Bisphosphoglycerate 0.000270 \nNADH 0.330000 \nPhosphoenolpyruvate 0.040000 \nPyruvate 8.700000 \nAcetaldehyde 1.481530 \nEtOH 19.237900 \nExtracellular ethanol 16.451400 \nGlycerol 4.196000 \nExtracellular glycerol 1.684780 \nExtracellular acetaldehyde 1.288360 \nExtracellular cyanide 5.203580 \nAMP 0.330000 \nP 0.000000 \nMixed flow cyanide 5.600000 \nMixed flow glucose 24.000000 \n\n particle_number rate \\\nname \nExtracellular glucose 4.034834e+21 -1.139132e+00 \nCytosolic glucose 3.451132e+20 6.820866e+01 \nATP 1.264650e+21 -5.374740e-04 \nGlucose-6-Phosphate 2.529299e+21 2.292073e-05 \nADP 9.033211e+20 9.874740e-04 \nFructose-6-Phosphate 2.950849e+20 -2.357096e-05 \nFructose 1,6-bisphosphate 2.794273e+21 3.000184e-05 \nGlyceraldehyde 3-phosphate 6.925462e+19 -1.056219e-04 \nDihydroxyacetone phosphate 1.776532e+21 8.613930e-05 \nNAD 3.914391e+20 -5.799246e-05 \n1,3-Bisphosphoglycerate 1.625978e+17 5.878219e-05 \nNADH 1.987306e+20 5.799246e-05 \nPhosphoenolpyruvate 2.408856e+19 -2.664671e-05 \nPyruvate 5.239262e+21 -3.001996e-05 \nAcetaldehyde 8.921982e+20 5.754463e-05 \nEtOH 1.158533e+22 7.012204e-05 \nExtracellular ethanol 9.907265e+21 -1.437288e-06 \nGlycerol 2.526890e+21 -1.733231e-05 \nExtracellular glycerol 1.014598e+21 3.566102e-07 \nExtracellular acetaldehyde 7.758685e+20 1.261075e-07 \nExtracellular cyanide 3.133669e+21 9.153125e-08 \nAMP 1.987306e+20 -4.500000e-04 \nP 0.000000e+00 0.000000e+00 \nMixed flow cyanide 3.372399e+21 0.000000e+00 \nMixed flow glucose 1.445314e+22 0.000000e+00 \n\n particle_number_rate key sbml_id \nname \nExtracellular glucose -6.860013e+20 Metabolite_0 GlcX \nCytosolic glucose 4.107622e+22 Metabolite_1 Glc \nATP -3.236744e+17 Metabolite_2 ATP \nGlucose-6-Phosphate 1.380319e+16 Metabolite_3 G6P \nADP 5.946708e+17 Metabolite_4 ADP \nFructose-6-Phosphate -1.419477e+16 Metabolite_5 F6P \nFructose 1,6-bisphosphate 1.806753e+16 Metabolite_6 FBP \nGlyceraldehyde 3-phosphate -6.360699e+16 Metabolite_7 GAP \nDihydroxyacetone phosphate 5.187430e+16 Metabolite_8 DHAP \nNAD -3.492388e+16 Metabolite_9 NAD \n1,3-Bisphosphoglycerate 3.539946e+16 Metabolite_10 BPG \nNADH 3.492388e+16 Metabolite_11 NADH \nPhosphoenolpyruvate -1.604702e+16 Metabolite_12 PEP \nPyruvate -1.807844e+16 Metabolite_13 Pyr \nAcetaldehyde 3.465418e+16 Metabolite_14 ACA \nEtOH 4.222848e+16 Metabolite_15 EtOH \nExtracellular ethanol -8.655551e+14 Metabolite_16 EtOHX \nGlycerol -1.043776e+16 Metabolite_17 Glyc \nExtracellular glycerol 2.147557e+14 Metabolite_18 GlycX \nExtracellular acetaldehyde 7.594373e+13 Metabolite_19 ACAX \nExtracellular cyanide 5.512141e+13 Metabolite_20 CNX \nAMP -2.709963e+17 Metabolite_21 AMP \nP 0.000000e+00 Metabolite_22 P \nMixed flow cyanide 0.000000e+00 Metabolite_23 CNX0 \nMixed flow glucose 0.000000e+00 Metabolite_24 GlcX0 ", + "text/html": "
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
compartmenttypeunitinitial_concentrationinitial_particle_numberinitial_expressionexpressionconcentrationparticle_numberrateparticle_number_ratekeysbml_id
name
Extracellular glucoseextracellularreactionsmmol/l6.7000004.034834e+216.7000004.034834e+21-1.139132e+00-6.860013e+20Metabolite_0GlcX
Cytosolic glucosecytosolreactionsmmol/l0.5730743.451132e+200.5730743.451132e+206.820866e+014.107622e+22Metabolite_1Glc
ATPcytosolreactionsmmol/l2.1000001.264650e+212.1000001.264650e+21-5.374740e-04-3.236744e+17Metabolite_2ATP
Glucose-6-Phosphatecytosolreactionsmmol/l4.2000002.529299e+214.2000002.529299e+212.292073e-051.380319e+16Metabolite_3G6P
ADPcytosolreactionsmmol/l1.5000009.033211e+201.5000009.033211e+209.874740e-045.946708e+17Metabolite_4ADP
Fructose-6-Phosphatecytosolreactionsmmol/l0.4900002.950849e+200.4900002.950849e+20-2.357096e-05-1.419477e+16Metabolite_5F6P
Fructose 1,6-bisphosphatecytosolreactionsmmol/l4.6400002.794273e+214.6400002.794273e+213.000184e-051.806753e+16Metabolite_6FBP
Glyceraldehyde 3-phosphatecytosolreactionsmmol/l0.1150006.925462e+190.1150006.925462e+19-1.056219e-04-6.360699e+16Metabolite_7GAP
Dihydroxyacetone phosphatecytosolreactionsmmol/l2.9500001.776532e+212.9500001.776532e+218.613930e-055.187430e+16Metabolite_8DHAP
NADcytosolreactionsmmol/l0.6500003.914391e+200.6500003.914391e+20-5.799246e-05-3.492388e+16Metabolite_9NAD
1,3-Bisphosphoglyceratecytosolreactionsmmol/l0.0002701.625978e+170.0002701.625978e+175.878219e-053.539946e+16Metabolite_10BPG
NADHcytosolreactionsmmol/l0.3300001.987306e+200.3300001.987306e+205.799246e-053.492388e+16Metabolite_11NADH
Phosphoenolpyruvatecytosolreactionsmmol/l0.0400002.408856e+190.0400002.408856e+19-2.664671e-05-1.604702e+16Metabolite_12PEP
Pyruvatecytosolreactionsmmol/l8.7000005.239262e+218.7000005.239262e+21-3.001996e-05-1.807844e+16Metabolite_13Pyr
Acetaldehydecytosolreactionsmmol/l1.4815308.921982e+201.4815308.921982e+205.754463e-053.465418e+16Metabolite_14ACA
EtOHcytosolreactionsmmol/l19.2379001.158533e+2219.2379001.158533e+227.012204e-054.222848e+16Metabolite_15EtOH
Extracellular ethanolextracellularreactionsmmol/l16.4514009.907265e+2116.4514009.907265e+21-1.437288e-06-8.655551e+14Metabolite_16EtOHX
Glycerolcytosolreactionsmmol/l4.1960002.526890e+214.1960002.526890e+21-1.733231e-05-1.043776e+16Metabolite_17Glyc
Extracellular glycerolextracellularreactionsmmol/l1.6847801.014598e+211.6847801.014598e+213.566102e-072.147557e+14Metabolite_18GlycX
Extracellular acetaldehydeextracellularreactionsmmol/l1.2883607.758685e+201.2883607.758685e+201.261075e-077.594373e+13Metabolite_19ACAX
Extracellular cyanideextracellularreactionsmmol/l5.2035803.133669e+215.2035803.133669e+219.153125e-085.512141e+13Metabolite_20CNX
AMPcytosolreactionsmmol/l0.3300001.987306e+200.3300001.987306e+20-4.500000e-04-2.709963e+17Metabolite_21AMP
Pextracellularfixedmmol/l0.0000000.000000e+000.0000000.000000e+000.000000e+000.000000e+00Metabolite_22P
Mixed flow cyanideextracellularfixedmmol/l5.6000003.372399e+215.6000003.372399e+210.000000e+000.000000e+00Metabolite_23CNX0
Mixed flow glucoseextracellularfixedmmol/l24.0000001.445314e+2224.0000001.445314e+220.000000e+000.000000e+00Metabolite_24GlcX0
\n
" + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "model_from_file = load_model(model_filepath)\n", "get_species(model=model_from_file)" ], "metadata": { - "collapsed": false + "collapsed": false, + "ExecuteTime": { + "end_time": "2024-03-04T16:36:25.770840Z", + "start_time": "2024-03-04T16:36:25.706021Z" + } }, "id": "40ab6f70ac3f4996", - "execution_count": null + "execution_count": 6 }, { "cell_type": "code", - "execution_count": null, - "outputs": [], + "execution_count": 7, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{ 'global_parameter_changes': [],\n", + " 'reaction_changes': [],\n", + " 'species_changes': [ { 'expression': '',\n", + " 'initial_concentration': 9.261000000000001,\n", + " 'initial_expression': '',\n", + " 'initial_particle_number': None,\n", + " 'name': 'ADP',\n", + " 'unit': ''}]}\n" + ] + } + ], "source": [ "# 1. specify model changes\n", "process_model_changes = ModelChanges(\n", @@ -179,14 +242,38 @@ "pp(process_model_changes.model_dump())" ], "metadata": { - "collapsed": false + "collapsed": false, + "ExecuteTime": { + "end_time": "2024-03-04T16:36:26.438108Z", + "start_time": "2024-03-04T16:36:26.432170Z" + } }, "id": "d02a547b85138f96" }, { "cell_type": "code", - "execution_count": null, - "outputs": [], + "execution_count": 8, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{ 'model_changes': { 'global_parameter_changes': [],\n", + " 'reaction_changes': [],\n", + " 'species_changes': [ { 'expression': '',\n", + " 'initial_concentration': 9.261000000000001,\n", + " 'initial_expression': '',\n", + " 'initial_particle_number': None,\n", + " 'name': 'ADP',\n", + " 'unit': ''}]},\n", + " 'model_id': 'copasi_process_from_file',\n", + " 'model_language': 'sbml',\n", + " 'model_name': 'Simple Composite Process from File',\n", + " 'model_source': { 'value': '../biosimulator_processes/model_files/BIOMD0000000061_url.xml'},\n", + " 'model_units': None}\n" + ] + } + ], "source": [ "# 2. define the model schema to be used by the composite process (one of the copasiprocess config parameters)\n", "\n", @@ -201,14 +288,40 @@ "pp(process_model_from_file.model_dump())" ], "metadata": { - "collapsed": false + "collapsed": false, + "ExecuteTime": { + "end_time": "2024-03-04T16:36:27.149616Z", + "start_time": "2024-03-04T16:36:27.137212Z" + } }, "id": "1b6c269646357d7d" }, { "cell_type": "code", - "execution_count": null, - "outputs": [], + "execution_count": 9, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{ 'method': 'stochastic',\n", + " 'model': { 'model_changes': { 'global_parameter_changes': [],\n", + " 'reaction_changes': [],\n", + " 'species_changes': [ { 'expression': '',\n", + " 'initial_concentration': 9.261000000000001,\n", + " 'initial_expression': '',\n", + " 'initial_particle_number': None,\n", + " 'name': 'ADP',\n", + " 'unit': ''}]},\n", + " 'model_id': 'copasi_process_from_file',\n", + " 'model_language': 'sbml',\n", + " 'model_name': 'Simple Composite Process from File',\n", + " 'model_source': { 'value': '../biosimulator_processes/model_files/BIOMD0000000061_url.xml'},\n", + " 'model_units': None},\n", + " 'process_name': 'simple_copasi'}\n" + ] + } + ], "source": [ "# 3. Define config schema to be used as 'config' parameter of Process constructor\n", "process_config_from_file = CopasiProcessConfigSchema(\n", @@ -221,26 +334,63 @@ "pp(process_config_from_file.model_dump())" ], "metadata": { - "collapsed": false + "collapsed": false, + "ExecuteTime": { + "end_time": "2024-03-04T16:36:27.762814Z", + "start_time": "2024-03-04T16:36:27.760168Z" + } }, "id": "5d434956e65b1a42" }, { "cell_type": "code", - "execution_count": null, - "outputs": [], + "execution_count": 10, + "outputs": [ + { + "data": { + "text/plain": "{'model_id': 'copasi_process_from_file',\n 'model_source': {'value': '../biosimulator_processes/model_files/BIOMD0000000061_url.xml'},\n 'model_language': 'sbml',\n 'model_name': 'Simple Composite Process from File',\n 'model_changes': {'species_changes': [{'name': 'ADP',\n 'unit': '',\n 'initial_concentration': 9.261000000000001,\n 'initial_particle_number': None,\n 'initial_expression': '',\n 'expression': ''}],\n 'global_parameter_changes': [],\n 'reaction_changes': []},\n 'model_units': None}" + }, + "execution_count": 10, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "process_config_from_file.model" ], "metadata": { - "collapsed": false + "collapsed": false, + "ExecuteTime": { + "end_time": "2024-03-04T16:36:28.458757Z", + "start_time": "2024-03-04T16:36:28.455080Z" + } }, "id": "de88e95d8f616779" }, { "cell_type": "code", - "execution_count": null, - "outputs": [], + "execution_count": 11, + "outputs": [ + { + "ename": "AttributeError", + "evalue": "'NoneType' object has no attribute 'index'", + "output_type": "error", + "traceback": [ + "\u001B[0;31m---------------------------------------------------------------------------\u001B[0m", + "\u001B[0;31mAttributeError\u001B[0m Traceback (most recent call last)", + "Cell \u001B[0;32mIn[11], line 4\u001B[0m\n\u001B[1;32m 1\u001B[0m \u001B[38;5;66;03m# 4. Add the process instance by the name of 'simple_copasi' to the builder\u001B[39;00m\n\u001B[0;32m----> 4\u001B[0m \u001B[43mb\u001B[49m\u001B[43m[\u001B[49m\u001B[43mprocess_config_from_file\u001B[49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mprocess_name\u001B[49m\u001B[43m]\u001B[49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43madd_process\u001B[49m\u001B[43m(\u001B[49m\n\u001B[1;32m 5\u001B[0m \u001B[43m \u001B[49m\u001B[43mname\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[38;5;124;43m'\u001B[39;49m\u001B[38;5;124;43mCopasiProcess\u001B[39;49m\u001B[38;5;124;43m'\u001B[39;49m\u001B[43m,\u001B[49m\n\u001B[1;32m 6\u001B[0m \u001B[43m \u001B[49m\u001B[43mmodel\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[43mprocess_config_from_file\u001B[49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mmodel\u001B[49m\u001B[43m,\u001B[49m\n\u001B[1;32m 7\u001B[0m \u001B[43m \u001B[49m\u001B[43mmethod\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[43mprocess_config_from_file\u001B[49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mmethod\u001B[49m\n\u001B[1;32m 8\u001B[0m \u001B[43m)\u001B[49m\n", + "File \u001B[0;32m~/Library/Caches/pypoetry/virtualenvs/biosimulator-processes-KVuYbFzt-py3.10/lib/python3.10/site-packages/builder/builder_api.py:148\u001B[0m, in \u001B[0;36mBuilderNode.add_process\u001B[0;34m(self, name, config, inputs, outputs, **kwargs)\u001B[0m\n\u001B[1;32m 139\u001B[0m state \u001B[38;5;241m=\u001B[39m {\n\u001B[1;32m 140\u001B[0m \u001B[38;5;124m'\u001B[39m\u001B[38;5;124m_type\u001B[39m\u001B[38;5;124m'\u001B[39m: edge_type,\n\u001B[1;32m 141\u001B[0m \u001B[38;5;124m'\u001B[39m\u001B[38;5;124maddress\u001B[39m\u001B[38;5;124m'\u001B[39m: \u001B[38;5;124mf\u001B[39m\u001B[38;5;124m'\u001B[39m\u001B[38;5;124mlocal:\u001B[39m\u001B[38;5;132;01m{\u001B[39;00mname\u001B[38;5;132;01m}\u001B[39;00m\u001B[38;5;124m'\u001B[39m, \u001B[38;5;66;03m# TODO -- only support local right now?\u001B[39;00m\n\u001B[0;32m (...)\u001B[0m\n\u001B[1;32m 144\u001B[0m \u001B[38;5;124m'\u001B[39m\u001B[38;5;124moutputs\u001B[39m\u001B[38;5;124m'\u001B[39m: {} \u001B[38;5;28;01mif\u001B[39;00m outputs \u001B[38;5;129;01mis\u001B[39;00m \u001B[38;5;28;01mNone\u001B[39;00m \u001B[38;5;28;01melse\u001B[39;00m outputs,\n\u001B[1;32m 145\u001B[0m }\n\u001B[1;32m 147\u001B[0m set_path(tree\u001B[38;5;241m=\u001B[39m\u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39mbuilder\u001B[38;5;241m.\u001B[39mtree, path\u001B[38;5;241m=\u001B[39m\u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39mpath, value\u001B[38;5;241m=\u001B[39mstate)\n\u001B[0;32m--> 148\u001B[0m \u001B[38;5;28;43mself\u001B[39;49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mbuilder\u001B[49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mcomplete\u001B[49m\u001B[43m(\u001B[49m\u001B[43m)\u001B[49m\n", + "File \u001B[0;32m~/Library/Caches/pypoetry/virtualenvs/biosimulator-processes-KVuYbFzt-py3.10/lib/python3.10/site-packages/builder/builder_api.py:233\u001B[0m, in \u001B[0;36mBuilder.complete\u001B[0;34m(self)\u001B[0m\n\u001B[1;32m 232\u001B[0m \u001B[38;5;28;01mdef\u001B[39;00m \u001B[38;5;21mcomplete\u001B[39m(\u001B[38;5;28mself\u001B[39m):\n\u001B[0;32m--> 233\u001B[0m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39mschema, \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39mtree \u001B[38;5;241m=\u001B[39m \u001B[38;5;28;43mself\u001B[39;49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mcore\u001B[49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mcomplete\u001B[49m\u001B[43m(\u001B[49m\u001B[38;5;28;43mself\u001B[39;49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mschema\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[38;5;28;43mself\u001B[39;49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mtree\u001B[49m\u001B[43m)\u001B[49m\n", + "File \u001B[0;32m~/Library/Caches/pypoetry/virtualenvs/biosimulator-processes-KVuYbFzt-py3.10/lib/python3.10/site-packages/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~/Library/Caches/pypoetry/virtualenvs/biosimulator-processes-KVuYbFzt-py3.10/lib/python3.10/site-packages/process_bigraph/composite.py:270\u001B[0m, in \u001B[0;36mProcessTypes.infer_schema\u001B[0;34m(self, schema, state, top_state, path)\u001B[0m\n\u001B[1;32m 267\u001B[0m inner_path \u001B[38;5;241m=\u001B[39m path \u001B[38;5;241m+\u001B[39m (key,)\n\u001B[1;32m 268\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m get_path(schema, inner_path) \u001B[38;5;129;01mis\u001B[39;00m \u001B[38;5;28;01mNone\u001B[39;00m \u001B[38;5;129;01mor\u001B[39;00m get_path(state, inner_path) \u001B[38;5;129;01mis\u001B[39;00m \u001B[38;5;28;01mNone\u001B[39;00m \u001B[38;5;129;01mor\u001B[39;00m (\n\u001B[1;32m 269\u001B[0m \u001B[38;5;28misinstance\u001B[39m(value, \u001B[38;5;28mdict\u001B[39m) \u001B[38;5;129;01mand\u001B[39;00m \u001B[38;5;124m'\u001B[39m\u001B[38;5;124m_type\u001B[39m\u001B[38;5;124m'\u001B[39m \u001B[38;5;129;01min\u001B[39;00m value):\n\u001B[0;32m--> 270\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 271\u001B[0m \u001B[43m \u001B[49m\u001B[43mschema\u001B[49m\u001B[43m,\u001B[49m\n\u001B[1;32m 272\u001B[0m \u001B[43m \u001B[49m\u001B[43mvalue\u001B[49m\u001B[43m,\u001B[49m\n\u001B[1;32m 273\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 274\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 276\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 277\u001B[0m \u001B[38;5;28;01mpass\u001B[39;00m\n", + "File \u001B[0;32m~/Library/Caches/pypoetry/virtualenvs/biosimulator-processes-KVuYbFzt-py3.10/lib/python3.10/site-packages/process_bigraph/composite.py:222\u001B[0m, in \u001B[0;36mProcessTypes.infer_schema\u001B[0;34m(self, schema, state, top_state, path)\u001B[0m\n\u001B[1;32m 219\u001B[0m state_type \u001B[38;5;241m=\u001B[39m state[\u001B[38;5;124m'\u001B[39m\u001B[38;5;124m_type\u001B[39m\u001B[38;5;124m'\u001B[39m]\n\u001B[1;32m 220\u001B[0m state_schema \u001B[38;5;241m=\u001B[39m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39maccess(state_type)\n\u001B[0;32m--> 222\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 223\u001B[0m top_state \u001B[38;5;241m=\u001B[39m set_path(\n\u001B[1;32m 224\u001B[0m top_state,\n\u001B[1;32m 225\u001B[0m path,\n\u001B[1;32m 226\u001B[0m hydrated_state)\n\u001B[1;32m 228\u001B[0m schema \u001B[38;5;241m=\u001B[39m set_path(\n\u001B[1;32m 229\u001B[0m schema,\n\u001B[1;32m 230\u001B[0m path,\n\u001B[1;32m 231\u001B[0m {\u001B[38;5;124m'\u001B[39m\u001B[38;5;124m_type\u001B[39m\u001B[38;5;124m'\u001B[39m: state_type})\n", + "File \u001B[0;32m~/Library/Caches/pypoetry/virtualenvs/biosimulator-processes-KVuYbFzt-py3.10/lib/python3.10/site-packages/bigraph_schema/type_system.py:675\u001B[0m, in \u001B[0;36mTypeSystem.deserialize\u001B[0;34m(self, schema, encoded)\u001B[0m\n\u001B[1;32m 672\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m encoded \u001B[38;5;129;01mis\u001B[39;00m \u001B[38;5;28;01mNone\u001B[39;00m:\n\u001B[1;32m 673\u001B[0m encoded \u001B[38;5;241m=\u001B[39m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39mdefault(schema)\n\u001B[0;32m--> 675\u001B[0m \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[43mdeserialize_function\u001B[49m\u001B[43m(\u001B[49m\n\u001B[1;32m 676\u001B[0m \u001B[43m \u001B[49m\u001B[43mfound\u001B[49m\u001B[43m,\u001B[49m\n\u001B[1;32m 677\u001B[0m \u001B[43m \u001B[49m\u001B[43mencoded\u001B[49m\u001B[43m,\u001B[49m\n\u001B[1;32m 678\u001B[0m \u001B[43m \u001B[49m\u001B[38;5;28;43mself\u001B[39;49m\u001B[43m)\u001B[49m\n\u001B[1;32m 680\u001B[0m \u001B[38;5;28;01melif\u001B[39;00m \u001B[38;5;28misinstance\u001B[39m(encoded, \u001B[38;5;28mdict\u001B[39m):\n\u001B[1;32m 681\u001B[0m result \u001B[38;5;241m=\u001B[39m {}\n", + "File \u001B[0;32m~/Library/Caches/pypoetry/virtualenvs/biosimulator-processes-KVuYbFzt-py3.10/lib/python3.10/site-packages/process_bigraph/composite.py:95\u001B[0m, in \u001B[0;36mdeserialize_process\u001B[0;34m(schema, encoded, core)\u001B[0m\n\u001B[1;32m 90\u001B[0m interval \u001B[38;5;241m=\u001B[39m core\u001B[38;5;241m.\u001B[39mdeserialize(\n\u001B[1;32m 91\u001B[0m \u001B[38;5;124m'\u001B[39m\u001B[38;5;124minterval\u001B[39m\u001B[38;5;124m'\u001B[39m,\n\u001B[1;32m 92\u001B[0m encoded\u001B[38;5;241m.\u001B[39mget(\u001B[38;5;124m'\u001B[39m\u001B[38;5;124minterval\u001B[39m\u001B[38;5;124m'\u001B[39m))\n\u001B[1;32m 94\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;124minstance\u001B[39m\u001B[38;5;124m'\u001B[39m \u001B[38;5;129;01min\u001B[39;00m deserialized:\n\u001B[0;32m---> 95\u001B[0m process \u001B[38;5;241m=\u001B[39m \u001B[43minstantiate\u001B[49m\u001B[43m(\u001B[49m\u001B[43mconfig\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\n\u001B[1;32m 96\u001B[0m deserialized[\u001B[38;5;124m'\u001B[39m\u001B[38;5;124minstance\u001B[39m\u001B[38;5;124m'\u001B[39m] \u001B[38;5;241m=\u001B[39m process\n\u001B[1;32m 98\u001B[0m deserialized[\u001B[38;5;124m'\u001B[39m\u001B[38;5;124mconfig\u001B[39m\u001B[38;5;124m'\u001B[39m] \u001B[38;5;241m=\u001B[39m config\n", + "File \u001B[0;32m~/Desktop/uchc_work/biosimulator-processes/notebooks/../biosimulator_processes/processes/copasi_process.py:153\u001B[0m, in \u001B[0;36mCopasiProcess.__init__\u001B[0;34m(self, config, core)\u001B[0m\n\u001B[1;32m 150\u001B[0m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39mfloating_species_initial \u001B[38;5;241m=\u001B[39m get_species(model\u001B[38;5;241m=\u001B[39m\u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39mcopasi_model_object)[\u001B[38;5;124m'\u001B[39m\u001B[38;5;124mconcentration\u001B[39m\u001B[38;5;124m'\u001B[39m]\u001B[38;5;241m.\u001B[39mtolist()\n\u001B[1;32m 152\u001B[0m \u001B[38;5;66;03m# ----GLOBAL PARAMS: set global parameter changes\u001B[39;00m\n\u001B[0;32m--> 153\u001B[0m existing_global_parameters \u001B[38;5;241m=\u001B[39m \u001B[43mget_parameters\u001B[49m\u001B[43m(\u001B[49m\u001B[43mmodel\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[38;5;28;43mself\u001B[39;49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mcopasi_model_object\u001B[49m\u001B[43m)\u001B[49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mindex\u001B[49m\n\u001B[1;32m 154\u001B[0m global_parameter_changes \u001B[38;5;241m=\u001B[39m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39mmodel_changes\u001B[38;5;241m.\u001B[39mget(\u001B[38;5;124m'\u001B[39m\u001B[38;5;124mglobal_parameter_changes\u001B[39m\u001B[38;5;124m'\u001B[39m, [])\n\u001B[1;32m 155\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m global_parameter_changes:\n", + "\u001B[0;31mAttributeError\u001B[0m: 'NoneType' object has no attribute 'index'" + ] + } + ], "source": [ "# 4. Add the process instance by the name of 'simple_copasi' to the builder\n", "\n", @@ -252,7 +402,11 @@ ")" ], "metadata": { - "collapsed": false + "collapsed": false, + "ExecuteTime": { + "end_time": "2024-03-04T16:36:29.508189Z", + "start_time": "2024-03-04T16:36:28.982186Z" + } }, "id": "52d81ea2ea688d47" }, @@ -268,18 +422,8 @@ }, { "cell_type": "code", - "execution_count": 1, - "outputs": [ - { - "data": { - "text/plain": " compartment type unit initial_concentration \\\nname \nEpoRJAK2 cyt reactions nmol/l 3.976220e+00 \nEpoRpJAK2 cyt reactions nmol/l 0.000000e+00 \np1EpoRpJAK2 cyt reactions nmol/l 0.000000e+00 \np2EpoRpJAK2 cyt reactions nmol/l 0.000000e+00 \np12EpoRpJAK2 cyt reactions nmol/l 0.000000e+00 \nEpoRJAK2_CIS cyt reactions nmol/l 0.000000e+00 \nSHP1 cyt reactions nmol/l 2.672510e+01 \nSHP1Act cyt reactions nmol/l 0.000000e+00 \nSTAT5 cyt reactions nmol/l 7.975350e+01 \npSTAT5 cyt reactions nmol/l 0.000000e+00 \nnpSTAT5 nuc reactions nmol/l 0.000000e+00 \nCISnRNA1 nuc reactions nmol/l 0.000000e+00 \nCISnRNA2 nuc reactions nmol/l 0.000000e+00 \nCISnRNA3 nuc reactions nmol/l 0.000000e+00 \nCISnRNA4 nuc reactions nmol/l 0.000000e+00 \nCISnRNA5 nuc reactions nmol/l 0.000000e+00 \nCISRNA cyt reactions nmol/l 0.000000e+00 \nCIS cyt reactions nmol/l 0.000000e+00 \nSOCS3nRNA1 nuc reactions nmol/l 0.000000e+00 \nSOCS3nRNA2 nuc reactions nmol/l 0.000000e+00 \nSOCS3nRNA3 nuc reactions nmol/l 0.000000e+00 \nSOCS3nRNA4 nuc reactions nmol/l 0.000000e+00 \nSOCS3nRNA5 nuc reactions nmol/l 0.000000e+00 \nSOCS3RNA cyt reactions nmol/l 0.000000e+00 \nSOCS3 cyt reactions nmol/l 0.000000e+00 \nEpo cyt reactions nmol/l 1.249970e-07 \n\n initial_particle_number initial_expression expression \\\nname \nEpoRJAK2 9.578143e+14 \nEpoRpJAK2 0.000000e+00 \np1EpoRpJAK2 0.000000e+00 \np2EpoRpJAK2 0.000000e+00 \np12EpoRpJAK2 0.000000e+00 \nEpoRJAK2_CIS 0.000000e+00 \nSHP1 6.437693e+15 \nSHP1Act 0.000000e+00 \nSTAT5 1.921147e+16 \npSTAT5 0.000000e+00 \nnpSTAT5 0.000000e+00 \nCISnRNA1 0.000000e+00 \nCISnRNA2 0.000000e+00 \nCISnRNA3 0.000000e+00 \nCISnRNA4 0.000000e+00 \nCISnRNA5 0.000000e+00 \nCISRNA 0.000000e+00 \nCIS 0.000000e+00 \nSOCS3nRNA1 0.000000e+00 \nSOCS3nRNA2 0.000000e+00 \nSOCS3nRNA3 0.000000e+00 \nSOCS3nRNA4 0.000000e+00 \nSOCS3nRNA5 0.000000e+00 \nSOCS3RNA 0.000000e+00 \nSOCS3 0.000000e+00 \nEpo 3.010998e+07 \n\n concentration particle_number rate particle_number_rate \\\nname \nEpoRJAK2 3.976220e+00 9.578143e+14 -0.314737 -7.581552e+13 \nEpoRpJAK2 0.000000e+00 0.000000e+00 0.314737 7.581552e+13 \np1EpoRpJAK2 0.000000e+00 0.000000e+00 0.000000 0.000000e+00 \np2EpoRpJAK2 0.000000e+00 0.000000e+00 0.000000 0.000000e+00 \np12EpoRpJAK2 0.000000e+00 0.000000e+00 0.000000 0.000000e+00 \nEpoRJAK2_CIS 0.000000e+00 0.000000e+00 0.000000 0.000000e+00 \nSHP1 2.672510e+01 6.437693e+15 0.000000 0.000000e+00 \nSHP1Act 0.000000e+00 0.000000e+00 0.000000 0.000000e+00 \nSTAT5 7.975350e+01 1.921147e+16 0.000000 0.000000e+00 \npSTAT5 0.000000e+00 0.000000e+00 0.000000 0.000000e+00 \nnpSTAT5 0.000000e+00 0.000000e+00 0.000000 0.000000e+00 \nCISnRNA1 0.000000e+00 0.000000e+00 0.000000 0.000000e+00 \nCISnRNA2 0.000000e+00 0.000000e+00 0.000000 0.000000e+00 \nCISnRNA3 0.000000e+00 0.000000e+00 0.000000 0.000000e+00 \nCISnRNA4 0.000000e+00 0.000000e+00 0.000000 0.000000e+00 \nCISnRNA5 0.000000e+00 0.000000e+00 0.000000 0.000000e+00 \nCISRNA 0.000000e+00 0.000000e+00 0.000000 0.000000e+00 \nCIS 0.000000e+00 0.000000e+00 0.000000 0.000000e+00 \nSOCS3nRNA1 0.000000e+00 0.000000e+00 0.000000 0.000000e+00 \nSOCS3nRNA2 0.000000e+00 0.000000e+00 0.000000 0.000000e+00 \nSOCS3nRNA3 0.000000e+00 0.000000e+00 0.000000 0.000000e+00 \nSOCS3nRNA4 0.000000e+00 0.000000e+00 0.000000 0.000000e+00 \nSOCS3nRNA5 0.000000e+00 0.000000e+00 0.000000 0.000000e+00 \nSOCS3RNA 0.000000e+00 0.000000e+00 0.000000 0.000000e+00 \nSOCS3 0.000000e+00 0.000000e+00 0.000000 0.000000e+00 \nEpo 1.249970e-07 3.010998e+07 0.000000 0.000000e+00 \n\n key sbml_id \nname \nEpoRJAK2 Metabolite_0 EpoRJAK2 \nEpoRpJAK2 Metabolite_1 EpoRpJAK2 \np1EpoRpJAK2 Metabolite_2 p1EpoRpJAK2 \np2EpoRpJAK2 Metabolite_3 p2EpoRpJAK2 \np12EpoRpJAK2 Metabolite_4 p12EpoRpJAK2 \nEpoRJAK2_CIS Metabolite_5 EpoRJAK2_CIS \nSHP1 Metabolite_6 SHP1 \nSHP1Act Metabolite_7 SHP1Act \nSTAT5 Metabolite_8 STAT5 \npSTAT5 Metabolite_9 pSTAT5 \nnpSTAT5 Metabolite_10 npSTAT5 \nCISnRNA1 Metabolite_11 CISnRNA1 \nCISnRNA2 Metabolite_12 CISnRNA2 \nCISnRNA3 Metabolite_13 CISnRNA3 \nCISnRNA4 Metabolite_14 CISnRNA4 \nCISnRNA5 Metabolite_15 CISnRNA5 \nCISRNA Metabolite_16 CISRNA \nCIS Metabolite_17 CIS \nSOCS3nRNA1 Metabolite_18 SOCS3nRNA1 \nSOCS3nRNA2 Metabolite_19 SOCS3nRNA2 \nSOCS3nRNA3 Metabolite_20 SOCS3nRNA3 \nSOCS3nRNA4 Metabolite_21 SOCS3nRNA4 \nSOCS3nRNA5 Metabolite_22 SOCS3nRNA5 \nSOCS3RNA Metabolite_23 SOCS3RNA \nSOCS3 Metabolite_24 SOCS3 \nEpo Metabolite_25 Epo ", - "text/html": "
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
compartmenttypeunitinitial_concentrationinitial_particle_numberinitial_expressionexpressionconcentrationparticle_numberrateparticle_number_ratekeysbml_id
name
EpoRJAK2cytreactionsnmol/l3.976220e+009.578143e+143.976220e+009.578143e+14-0.314737-7.581552e+13Metabolite_0EpoRJAK2
EpoRpJAK2cytreactionsnmol/l0.000000e+000.000000e+000.000000e+000.000000e+000.3147377.581552e+13Metabolite_1EpoRpJAK2
p1EpoRpJAK2cytreactionsnmol/l0.000000e+000.000000e+000.000000e+000.000000e+000.0000000.000000e+00Metabolite_2p1EpoRpJAK2
p2EpoRpJAK2cytreactionsnmol/l0.000000e+000.000000e+000.000000e+000.000000e+000.0000000.000000e+00Metabolite_3p2EpoRpJAK2
p12EpoRpJAK2cytreactionsnmol/l0.000000e+000.000000e+000.000000e+000.000000e+000.0000000.000000e+00Metabolite_4p12EpoRpJAK2
EpoRJAK2_CIScytreactionsnmol/l0.000000e+000.000000e+000.000000e+000.000000e+000.0000000.000000e+00Metabolite_5EpoRJAK2_CIS
SHP1cytreactionsnmol/l2.672510e+016.437693e+152.672510e+016.437693e+150.0000000.000000e+00Metabolite_6SHP1
SHP1Actcytreactionsnmol/l0.000000e+000.000000e+000.000000e+000.000000e+000.0000000.000000e+00Metabolite_7SHP1Act
STAT5cytreactionsnmol/l7.975350e+011.921147e+167.975350e+011.921147e+160.0000000.000000e+00Metabolite_8STAT5
pSTAT5cytreactionsnmol/l0.000000e+000.000000e+000.000000e+000.000000e+000.0000000.000000e+00Metabolite_9pSTAT5
npSTAT5nucreactionsnmol/l0.000000e+000.000000e+000.000000e+000.000000e+000.0000000.000000e+00Metabolite_10npSTAT5
CISnRNA1nucreactionsnmol/l0.000000e+000.000000e+000.000000e+000.000000e+000.0000000.000000e+00Metabolite_11CISnRNA1
CISnRNA2nucreactionsnmol/l0.000000e+000.000000e+000.000000e+000.000000e+000.0000000.000000e+00Metabolite_12CISnRNA2
CISnRNA3nucreactionsnmol/l0.000000e+000.000000e+000.000000e+000.000000e+000.0000000.000000e+00Metabolite_13CISnRNA3
CISnRNA4nucreactionsnmol/l0.000000e+000.000000e+000.000000e+000.000000e+000.0000000.000000e+00Metabolite_14CISnRNA4
CISnRNA5nucreactionsnmol/l0.000000e+000.000000e+000.000000e+000.000000e+000.0000000.000000e+00Metabolite_15CISnRNA5
CISRNAcytreactionsnmol/l0.000000e+000.000000e+000.000000e+000.000000e+000.0000000.000000e+00Metabolite_16CISRNA
CIScytreactionsnmol/l0.000000e+000.000000e+000.000000e+000.000000e+000.0000000.000000e+00Metabolite_17CIS
SOCS3nRNA1nucreactionsnmol/l0.000000e+000.000000e+000.000000e+000.000000e+000.0000000.000000e+00Metabolite_18SOCS3nRNA1
SOCS3nRNA2nucreactionsnmol/l0.000000e+000.000000e+000.000000e+000.000000e+000.0000000.000000e+00Metabolite_19SOCS3nRNA2
SOCS3nRNA3nucreactionsnmol/l0.000000e+000.000000e+000.000000e+000.000000e+000.0000000.000000e+00Metabolite_20SOCS3nRNA3
SOCS3nRNA4nucreactionsnmol/l0.000000e+000.000000e+000.000000e+000.000000e+000.0000000.000000e+00Metabolite_21SOCS3nRNA4
SOCS3nRNA5nucreactionsnmol/l0.000000e+000.000000e+000.000000e+000.000000e+000.0000000.000000e+00Metabolite_22SOCS3nRNA5
SOCS3RNAcytreactionsnmol/l0.000000e+000.000000e+000.000000e+000.000000e+000.0000000.000000e+00Metabolite_23SOCS3RNA
SOCS3cytreactionsnmol/l0.000000e+000.000000e+000.000000e+000.000000e+000.0000000.000000e+00Metabolite_24SOCS3
Epocytreactionsnmol/l1.249970e-073.010998e+071.249970e-073.010998e+070.0000000.000000e+00Metabolite_25Epo
\n
" - }, - "execution_count": 1, - "metadata": {}, - "output_type": "execute_result" - } - ], + "execution_count": null, + "outputs": [], "source": [ "from basico import *\n", "from basico import biomodels\n", @@ -290,45 +434,27 @@ "get_species(model=biomodel)" ], "metadata": { - "collapsed": false, - "ExecuteTime": { - "end_time": "2024-03-04T15:50:41.100625Z", - "start_time": "2024-03-04T15:50:38.514197Z" - } + "collapsed": false }, "id": "f499f96a817d9faf" }, { "cell_type": "code", - "outputs": [ - { - "data": { - "text/plain": " scheme flux \\\nname \nreaction_1 EpoRJAK2 -> EpoRpJAK2; Epo SOCS3 0.125895 \nreaction_2 EpoRpJAK2 -> EpoRJAK2; SHP1Act 0.000000 \nreaction_3 EpoRpJAK2 -> p1EpoRpJAK2; SOCS3 0.000000 \nreaction_4 EpoRpJAK2 -> p2EpoRpJAK2; EpoRJAK2_CIS SOCS3 0.000000 \nreaction_5 p1EpoRpJAK2 -> p12EpoRpJAK2; EpoRJAK2_CIS SOCS3 0.000000 \nreaction_6 p2EpoRpJAK2 -> p12EpoRpJAK2; SOCS3 0.000000 \nreaction_7 p1EpoRpJAK2 -> EpoRJAK2; SHP1Act 0.000000 \nreaction_8 p2EpoRpJAK2 -> EpoRJAK2; SHP1Act 0.000000 \nreaction_9 p12EpoRpJAK2 -> EpoRJAK2; SHP1Act 0.000000 \nreaction_10 EpoRJAK2_CIS -> ; p12EpoRpJAK2 p1EpoRpJAK2 0.000000 \nreaction_11 SHP1 -> SHP1Act; EpoRpJAK2 p12EpoRpJAK2 p1Epo... 0.000000 \nreaction_12 SHP1Act -> SHP1 0.000000 \nreaction_13 STAT5 -> pSTAT5; EpoRpJAK2 SOCS3 p12EpoRpJAK2... 0.000000 \nreaction_14 STAT5 -> pSTAT5; CIS SOCS3 p12EpoRpJAK2 p1Epo... 0.000000 \nreaction_15 pSTAT5 -> npSTAT5 0.000000 \nreaction_16 npSTAT5 -> STAT5 0.000000 \nreaction_17 = CISnRNA1; npSTAT5 0.000000 \nreaction_18 CISnRNA1 -> CISnRNA2 0.000000 \nreaction_19 CISnRNA2 -> CISnRNA3 0.000000 \nreaction_20 CISnRNA3 -> CISnRNA4 0.000000 \nreaction_21 CISnRNA4 -> CISnRNA5 0.000000 \nreaction_22 CISnRNA5 -> CISRNA 0.000000 \nreaction_23 CISRNA -> 0.000000 \nreaction_24 -> CIS; CISRNA 0.000000 \nreaction_25 CIS -> 0.000000 \nreaction_26 -> CIS 0.000000 \nreaction_27 = SOCS3nRNA1; npSTAT5 0.000000 \nreaction_28 SOCS3nRNA1 -> SOCS3nRNA2 0.000000 \nreaction_29 SOCS3nRNA2 -> SOCS3nRNA3 0.000000 \nreaction_30 SOCS3nRNA3 -> SOCS3nRNA4 0.000000 \nreaction_31 SOCS3nRNA4 -> SOCS3nRNA5 0.000000 \nreaction_32 SOCS3nRNA5 -> SOCS3RNA 0.000000 \nreaction_33 SOCS3RNA -> 0.000000 \nreaction_34 -> SOCS3; SOCS3RNA 0.000000 \nreaction_35 SOCS3 -> 0.000000 \nreaction_36 -> SOCS3 0.000000 \n\n particle_flux function key \\\nname \nreaction_1 7.581552e+13 Function for reaction_1 Reaction_0 \nreaction_2 0.000000e+00 Function for reaction_2 Reaction_1 \nreaction_3 0.000000e+00 Function for reaction_3 Reaction_2 \nreaction_4 0.000000e+00 Function for reaction_4 Reaction_3 \nreaction_5 0.000000e+00 Function for reaction_5 Reaction_4 \nreaction_6 0.000000e+00 Function for reaction_6 Reaction_5 \nreaction_7 0.000000e+00 Function for reaction_7 Reaction_6 \nreaction_8 0.000000e+00 Function for reaction_8 Reaction_7 \nreaction_9 0.000000e+00 Function for reaction_9 Reaction_8 \nreaction_10 0.000000e+00 Function for reaction_10 Reaction_9 \nreaction_11 0.000000e+00 Function for reaction_11 Reaction_10 \nreaction_12 0.000000e+00 Mass action (irreversible) Reaction_11 \nreaction_13 0.000000e+00 Function for reaction_13 Reaction_12 \nreaction_14 0.000000e+00 Function for reaction_14 Reaction_13 \nreaction_15 0.000000e+00 Function for reaction_15 Reaction_14 \nreaction_16 0.000000e+00 Function for reaction_16 Reaction_15 \nreaction_17 0.000000e+00 Function for reaction_17 Reaction_16 \nreaction_18 0.000000e+00 Mass action (irreversible) Reaction_17 \nreaction_19 0.000000e+00 Mass action (irreversible) Reaction_18 \nreaction_20 0.000000e+00 Mass action (irreversible) Reaction_19 \nreaction_21 0.000000e+00 Mass action (irreversible) Reaction_20 \nreaction_22 0.000000e+00 Function for reaction_22 Reaction_21 \nreaction_23 0.000000e+00 Mass action (irreversible) Reaction_22 \nreaction_24 0.000000e+00 Function for reaction_24 Reaction_23 \nreaction_25 0.000000e+00 Mass action (irreversible) Reaction_24 \nreaction_26 0.000000e+00 Function for reaction_26 Reaction_25 \nreaction_27 0.000000e+00 Function for reaction_27 Reaction_26 \nreaction_28 0.000000e+00 Mass action (irreversible) Reaction_27 \nreaction_29 0.000000e+00 Mass action (irreversible) Reaction_28 \nreaction_30 0.000000e+00 Mass action (irreversible) Reaction_29 \nreaction_31 0.000000e+00 Mass action (irreversible) Reaction_30 \nreaction_32 0.000000e+00 Function for reaction_32 Reaction_31 \nreaction_33 0.000000e+00 Mass action (irreversible) Reaction_32 \nreaction_34 0.000000e+00 Function for reaction_34 Reaction_33 \nreaction_35 0.000000e+00 Mass action (irreversible) Reaction_34 \nreaction_36 0.000000e+00 Function for reaction_36 Reaction_35 \n\n sbml_id mapping \nname \nreaction_1 reaction_1 {'Epo': 'Epo', 'EpoRJAK2': 'EpoRJAK2', 'JAK2Ac... \nreaction_2 reaction_2 {'EpoRpJAK2': 'EpoRpJAK2', 'JAK2EpoRDeaSHP1': ... \nreaction_3 reaction_3 {'EpoRActJAK2': 'EpoRActJAK2', 'EpoRpJAK2': 'E... \nreaction_4 reaction_4 {'EpoRActJAK2': 'EpoRActJAK2', 'EpoRCISInh': '... \nreaction_5 reaction_5 {'EpoRActJAK2': 'EpoRActJAK2', 'EpoRCISInh': '... \nreaction_6 reaction_6 {'EpoRActJAK2': 'EpoRActJAK2', 'SOCS3': 'SOCS3... \nreaction_7 reaction_7 {'JAK2EpoRDeaSHP1': 'JAK2EpoRDeaSHP1', 'SHP1Ac... \nreaction_8 reaction_8 {'JAK2EpoRDeaSHP1': 'JAK2EpoRDeaSHP1', 'SHP1Ac... \nreaction_9 reaction_9 {'JAK2EpoRDeaSHP1': 'JAK2EpoRDeaSHP1', 'SHP1Ac... \nreaction_10 reaction_10 {'EpoRCISRemove': 'EpoRCISRemove', 'EpoRJAK2_C... \nreaction_11 reaction_11 {'EpoRpJAK2': 'EpoRpJAK2', 'SHP1': 'SHP1', 'SH... \nreaction_12 reaction_12 {'k1': 'SHP1Dea', 'substrate': 'SHP1Act'} \nreaction_13 reaction_13 {'EpoRpJAK2': 'EpoRpJAK2', 'SOCS3': 'SOCS3', '... \nreaction_14 reaction_14 {'CIS': 'CIS', 'CISEqc': 'CISEqc', 'CISInh': '... \nreaction_15 reaction_15 {'STAT5Imp': 'STAT5Imp', 'cyt': 'cyt', 'pSTAT5... \nreaction_16 reaction_16 {'STAT5Exp': 'STAT5Exp', 'npSTAT5': 'npSTAT5',... \nreaction_17 reaction_17 {'ActD': 'ActD', 'CISRNAEqc': 'CISRNAEqc', 'CI... \nreaction_18 reaction_18 {'k1': 'CISRNADelay', 'substrate': 'CISnRNA1'} \nreaction_19 reaction_19 {'k1': 'CISRNADelay', 'substrate': 'CISnRNA2'} \nreaction_20 reaction_20 {'k1': 'CISRNADelay', 'substrate': 'CISnRNA3'} \nreaction_21 reaction_21 {'k1': 'CISRNADelay', 'substrate': 'CISnRNA4'} \nreaction_22 reaction_22 {'CISRNADelay': 'CISRNADelay', 'CISnRNA5': 'CI... \nreaction_23 reaction_23 {'k1': 'CISRNATurn', 'substrate': 'CISRNA'} \nreaction_24 reaction_24 {'CISEqc': 'CISEqc', 'CISRNA': 'CISRNA', 'CISR... \nreaction_25 reaction_25 {'k1': 'CISTurn', 'substrate': 'CIS'} \nreaction_26 reaction_26 {'CISEqc': 'CISEqc', 'CISEqcOE': 'CISEqcOE', '... \nreaction_27 reaction_27 {'ActD': 'ActD', 'SOCS3RNAEqc': 'SOCS3RNAEqc',... \nreaction_28 reaction_28 {'k1': 'SOCS3RNADelay', 'substrate': 'SOCS3nRN... \nreaction_29 reaction_29 {'k1': 'SOCS3RNADelay', 'substrate': 'SOCS3nRN... \nreaction_30 reaction_30 {'k1': 'SOCS3RNADelay', 'substrate': 'SOCS3nRN... \nreaction_31 reaction_31 {'k1': 'SOCS3RNADelay', 'substrate': 'SOCS3nRN... \nreaction_32 reaction_32 {'SOCS3RNADelay': 'SOCS3RNADelay', 'SOCS3nRNA5... \nreaction_33 reaction_33 {'k1': 'SOCS3RNATurn', 'substrate': 'SOCS3RNA'} \nreaction_34 reaction_34 {'SOCS3Eqc': 'SOCS3Eqc', 'SOCS3RNA': 'SOCS3RNA... \nreaction_35 reaction_35 {'k1': 'SOCS3Turn', 'substrate': 'SOCS3'} \nreaction_36 reaction_36 {'SOCS3Eqc': 'SOCS3Eqc', 'SOCS3EqcOE': 'SOCS3E... ", - "text/html": "
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
schemefluxparticle_fluxfunctionkeysbml_idmapping
name
reaction_1EpoRJAK2 -> EpoRpJAK2; Epo SOCS30.1258957.581552e+13Function for reaction_1Reaction_0reaction_1{'Epo': 'Epo', 'EpoRJAK2': 'EpoRJAK2', 'JAK2Ac...
reaction_2EpoRpJAK2 -> EpoRJAK2; SHP1Act0.0000000.000000e+00Function for reaction_2Reaction_1reaction_2{'EpoRpJAK2': 'EpoRpJAK2', 'JAK2EpoRDeaSHP1': ...
reaction_3EpoRpJAK2 -> p1EpoRpJAK2; SOCS30.0000000.000000e+00Function for reaction_3Reaction_2reaction_3{'EpoRActJAK2': 'EpoRActJAK2', 'EpoRpJAK2': 'E...
reaction_4EpoRpJAK2 -> p2EpoRpJAK2; EpoRJAK2_CIS SOCS30.0000000.000000e+00Function for reaction_4Reaction_3reaction_4{'EpoRActJAK2': 'EpoRActJAK2', 'EpoRCISInh': '...
reaction_5p1EpoRpJAK2 -> p12EpoRpJAK2; EpoRJAK2_CIS SOCS30.0000000.000000e+00Function for reaction_5Reaction_4reaction_5{'EpoRActJAK2': 'EpoRActJAK2', 'EpoRCISInh': '...
reaction_6p2EpoRpJAK2 -> p12EpoRpJAK2; SOCS30.0000000.000000e+00Function for reaction_6Reaction_5reaction_6{'EpoRActJAK2': 'EpoRActJAK2', 'SOCS3': 'SOCS3...
reaction_7p1EpoRpJAK2 -> EpoRJAK2; SHP1Act0.0000000.000000e+00Function for reaction_7Reaction_6reaction_7{'JAK2EpoRDeaSHP1': 'JAK2EpoRDeaSHP1', 'SHP1Ac...
reaction_8p2EpoRpJAK2 -> EpoRJAK2; SHP1Act0.0000000.000000e+00Function for reaction_8Reaction_7reaction_8{'JAK2EpoRDeaSHP1': 'JAK2EpoRDeaSHP1', 'SHP1Ac...
reaction_9p12EpoRpJAK2 -> EpoRJAK2; SHP1Act0.0000000.000000e+00Function for reaction_9Reaction_8reaction_9{'JAK2EpoRDeaSHP1': 'JAK2EpoRDeaSHP1', 'SHP1Ac...
reaction_10EpoRJAK2_CIS -> ; p12EpoRpJAK2 p1EpoRpJAK20.0000000.000000e+00Function for reaction_10Reaction_9reaction_10{'EpoRCISRemove': 'EpoRCISRemove', 'EpoRJAK2_C...
reaction_11SHP1 -> SHP1Act; EpoRpJAK2 p12EpoRpJAK2 p1Epo...0.0000000.000000e+00Function for reaction_11Reaction_10reaction_11{'EpoRpJAK2': 'EpoRpJAK2', 'SHP1': 'SHP1', 'SH...
reaction_12SHP1Act -> SHP10.0000000.000000e+00Mass action (irreversible)Reaction_11reaction_12{'k1': 'SHP1Dea', 'substrate': 'SHP1Act'}
reaction_13STAT5 -> pSTAT5; EpoRpJAK2 SOCS3 p12EpoRpJAK2...0.0000000.000000e+00Function for reaction_13Reaction_12reaction_13{'EpoRpJAK2': 'EpoRpJAK2', 'SOCS3': 'SOCS3', '...
reaction_14STAT5 -> pSTAT5; CIS SOCS3 p12EpoRpJAK2 p1Epo...0.0000000.000000e+00Function for reaction_14Reaction_13reaction_14{'CIS': 'CIS', 'CISEqc': 'CISEqc', 'CISInh': '...
reaction_15pSTAT5 -> npSTAT50.0000000.000000e+00Function for reaction_15Reaction_14reaction_15{'STAT5Imp': 'STAT5Imp', 'cyt': 'cyt', 'pSTAT5...
reaction_16npSTAT5 -> STAT50.0000000.000000e+00Function for reaction_16Reaction_15reaction_16{'STAT5Exp': 'STAT5Exp', 'npSTAT5': 'npSTAT5',...
reaction_17= CISnRNA1; npSTAT50.0000000.000000e+00Function for reaction_17Reaction_16reaction_17{'ActD': 'ActD', 'CISRNAEqc': 'CISRNAEqc', 'CI...
reaction_18CISnRNA1 -> CISnRNA20.0000000.000000e+00Mass action (irreversible)Reaction_17reaction_18{'k1': 'CISRNADelay', 'substrate': 'CISnRNA1'}
reaction_19CISnRNA2 -> CISnRNA30.0000000.000000e+00Mass action (irreversible)Reaction_18reaction_19{'k1': 'CISRNADelay', 'substrate': 'CISnRNA2'}
reaction_20CISnRNA3 -> CISnRNA40.0000000.000000e+00Mass action (irreversible)Reaction_19reaction_20{'k1': 'CISRNADelay', 'substrate': 'CISnRNA3'}
reaction_21CISnRNA4 -> CISnRNA50.0000000.000000e+00Mass action (irreversible)Reaction_20reaction_21{'k1': 'CISRNADelay', 'substrate': 'CISnRNA4'}
reaction_22CISnRNA5 -> CISRNA0.0000000.000000e+00Function for reaction_22Reaction_21reaction_22{'CISRNADelay': 'CISRNADelay', 'CISnRNA5': 'CI...
reaction_23CISRNA ->0.0000000.000000e+00Mass action (irreversible)Reaction_22reaction_23{'k1': 'CISRNATurn', 'substrate': 'CISRNA'}
reaction_24-> CIS; CISRNA0.0000000.000000e+00Function for reaction_24Reaction_23reaction_24{'CISEqc': 'CISEqc', 'CISRNA': 'CISRNA', 'CISR...
reaction_25CIS ->0.0000000.000000e+00Mass action (irreversible)Reaction_24reaction_25{'k1': 'CISTurn', 'substrate': 'CIS'}
reaction_26-> CIS0.0000000.000000e+00Function for reaction_26Reaction_25reaction_26{'CISEqc': 'CISEqc', 'CISEqcOE': 'CISEqcOE', '...
reaction_27= SOCS3nRNA1; npSTAT50.0000000.000000e+00Function for reaction_27Reaction_26reaction_27{'ActD': 'ActD', 'SOCS3RNAEqc': 'SOCS3RNAEqc',...
reaction_28SOCS3nRNA1 -> SOCS3nRNA20.0000000.000000e+00Mass action (irreversible)Reaction_27reaction_28{'k1': 'SOCS3RNADelay', 'substrate': 'SOCS3nRN...
reaction_29SOCS3nRNA2 -> SOCS3nRNA30.0000000.000000e+00Mass action (irreversible)Reaction_28reaction_29{'k1': 'SOCS3RNADelay', 'substrate': 'SOCS3nRN...
reaction_30SOCS3nRNA3 -> SOCS3nRNA40.0000000.000000e+00Mass action (irreversible)Reaction_29reaction_30{'k1': 'SOCS3RNADelay', 'substrate': 'SOCS3nRN...
reaction_31SOCS3nRNA4 -> SOCS3nRNA50.0000000.000000e+00Mass action (irreversible)Reaction_30reaction_31{'k1': 'SOCS3RNADelay', 'substrate': 'SOCS3nRN...
reaction_32SOCS3nRNA5 -> SOCS3RNA0.0000000.000000e+00Function for reaction_32Reaction_31reaction_32{'SOCS3RNADelay': 'SOCS3RNADelay', 'SOCS3nRNA5...
reaction_33SOCS3RNA ->0.0000000.000000e+00Mass action (irreversible)Reaction_32reaction_33{'k1': 'SOCS3RNATurn', 'substrate': 'SOCS3RNA'}
reaction_34-> SOCS3; SOCS3RNA0.0000000.000000e+00Function for reaction_34Reaction_33reaction_34{'SOCS3Eqc': 'SOCS3Eqc', 'SOCS3RNA': 'SOCS3RNA...
reaction_35SOCS3 ->0.0000000.000000e+00Mass action (irreversible)Reaction_34reaction_35{'k1': 'SOCS3Turn', 'substrate': 'SOCS3'}
reaction_36-> SOCS30.0000000.000000e+00Function for reaction_36Reaction_35reaction_36{'SOCS3Eqc': 'SOCS3Eqc', 'SOCS3EqcOE': 'SOCS3E...
\n
" - }, - "execution_count": 2, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "reaction_names = get_reactions(model=biomodel)\n", "\n", "reaction_names" ], "metadata": { - "collapsed": false, - "ExecuteTime": { - "end_time": "2024-03-04T15:50:41.120475Z", - "start_time": "2024-03-04T15:50:41.096733Z" - } + "collapsed": false }, "id": "c24594c6e8229e20", - "execution_count": 2 + "execution_count": null }, { "cell_type": "code", - "execution_count": 6, + "execution_count": null, "outputs": [], "source": [ "rparam = ReactionParameter(\n", @@ -344,145 +470,62 @@ "rc1 = ReactionChanges(\n", " reaction_name='reaction_1',\n", " parameter_changes=[rparam, rparam2]\n", + ")\n", + "\n", + "rc2 = ReactionChanges(\n", + " reaction_name='reaction_11',\n", + " reaction_scheme='A + B -> C'\n", ")" ], "metadata": { - "collapsed": false, - "ExecuteTime": { - "end_time": "2024-03-04T15:50:58.492141Z", - "start_time": "2024-03-04T15:50:58.486200Z" - } + "collapsed": false }, "id": "454db50d61220bc5" }, { "cell_type": "code", - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "{ 'parameter_changes': [ {'parameter_name': 'EpoRpRJAK2', 'value': 21312.2},\n", - " {'parameter_name': 'EpoRJAK2', 'value': 21312.2}],\n", - " 'reaction_name': 'reaction_1',\n", - " 'reaction_scheme': None}\n" - ] - } - ], - "source": [ - "pp(rc1.model_dump())" - ], - "metadata": { - "collapsed": false, - "ExecuteTime": { - "end_time": "2024-03-04T15:50:59.804621Z", - "start_time": "2024-03-04T15:50:59.800659Z" - } - }, - "id": "b2e9619befac07ee", - "execution_count": 7 - }, - { - "cell_type": "code", - "outputs": [ - { - "data": { - "text/plain": " type unit initial_value initial_expression expression \\\nname \nActD fixed 0.000000e+00 \nCISEqc fixed 4.328710e+02 \nCISEqcOE fixed 5.302610e-01 \nCISInh fixed 7.846530e+08 \nCISRNADelay fixed 1.447750e-01 \nCISRNAEqc fixed 1.000000e+00 \nCISRNATurn fixed 1.000000e+03 \nCISTurn fixed 8.398420e-03 \nCISoe fixed 0.000000e+00 \nEpoRActJAK2 fixed 2.673080e-01 \nEpoRCISInh fixed 1.000000e+06 \nEpoRCISRemove fixed 5.429320e+00 \nJAK2ActEpo fixed 6.332530e+05 \nJAK2EpoRDeaSHP1 fixed 1.427220e+02 \nSHP1ActEpoR fixed 1.000000e-03 \nSHP1Dea fixed 8.163910e-03 \nSOCS3Eqc fixed 1.736530e+02 \nSOCS3EqcOE fixed 6.791570e-01 \nSOCS3Inh fixed 1.040800e+01 \nSOCS3RNADelay fixed 1.064650e+00 \nSOCS3RNAEqc fixed 1.000000e+00 \nSOCS3RNATurn fixed 8.308440e-03 \nSOCS3Turn fixed 1.000000e+04 \nSOCS3oe fixed 0.000000e+00 \nSTAT5ActEpoR fixed 3.897570e+01 \nSTAT5ActJAK2 fixed 7.809650e-02 \nSTAT5Exp fixed 7.451550e-02 \nSTAT5Imp fixed 2.688890e-02 \nepo_level fixed 1.249970e-07 \ninit_EpoRJAK2 fixed 3.976220e+00 \ninit_SHP1 fixed 2.672510e+01 \ninit_STAT5 fixed 7.975350e+01 \n\n value rate key sbml_id \nname \nActD 0.000000e+00 0.0 ModelValue_0 ActD \nCISEqc 4.328710e+02 0.0 ModelValue_1 CISEqc \nCISEqcOE 5.302610e-01 0.0 ModelValue_2 CISEqcOE \nCISInh 7.846530e+08 0.0 ModelValue_3 CISInh \nCISRNADelay 1.447750e-01 0.0 ModelValue_4 CISRNADelay \nCISRNAEqc 1.000000e+00 0.0 ModelValue_5 CISRNAEqc \nCISRNATurn 1.000000e+03 0.0 ModelValue_6 CISRNATurn \nCISTurn 8.398420e-03 0.0 ModelValue_7 CISTurn \nCISoe 0.000000e+00 0.0 ModelValue_8 CISoe \nEpoRActJAK2 2.673080e-01 0.0 ModelValue_9 EpoRActJAK2 \nEpoRCISInh 1.000000e+06 0.0 ModelValue_10 EpoRCISInh \nEpoRCISRemove 5.429320e+00 0.0 ModelValue_11 EpoRCISRemove \nJAK2ActEpo 6.332530e+05 0.0 ModelValue_12 JAK2ActEpo \nJAK2EpoRDeaSHP1 1.427220e+02 0.0 ModelValue_13 JAK2EpoRDeaSHP1 \nSHP1ActEpoR 1.000000e-03 0.0 ModelValue_14 SHP1ActEpoR \nSHP1Dea 8.163910e-03 0.0 ModelValue_15 SHP1Dea \nSOCS3Eqc 1.736530e+02 0.0 ModelValue_16 SOCS3Eqc \nSOCS3EqcOE 6.791570e-01 0.0 ModelValue_17 SOCS3EqcOE \nSOCS3Inh 1.040800e+01 0.0 ModelValue_18 SOCS3Inh \nSOCS3RNADelay 1.064650e+00 0.0 ModelValue_19 SOCS3RNADelay \nSOCS3RNAEqc 1.000000e+00 0.0 ModelValue_20 SOCS3RNAEqc \nSOCS3RNATurn 8.308440e-03 0.0 ModelValue_21 SOCS3RNATurn \nSOCS3Turn 1.000000e+04 0.0 ModelValue_22 SOCS3Turn \nSOCS3oe 0.000000e+00 0.0 ModelValue_23 SOCS3oe \nSTAT5ActEpoR 3.897570e+01 0.0 ModelValue_24 STAT5ActEpoR \nSTAT5ActJAK2 7.809650e-02 0.0 ModelValue_25 STAT5ActJAK2 \nSTAT5Exp 7.451550e-02 0.0 ModelValue_26 STAT5Exp \nSTAT5Imp 2.688890e-02 0.0 ModelValue_27 STAT5Imp \nepo_level 1.249970e-07 0.0 ModelValue_28 epo_level \ninit_EpoRJAK2 3.976220e+00 0.0 ModelValue_29 init_EpoRJAK2 \ninit_SHP1 2.672510e+01 0.0 ModelValue_30 init_SHP1 \ninit_STAT5 7.975350e+01 0.0 ModelValue_31 init_STAT5 ", - "text/html": "
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
typeunitinitial_valueinitial_expressionexpressionvalueratekeysbml_id
name
ActDfixed0.000000e+000.000000e+000.0ModelValue_0ActD
CISEqcfixed4.328710e+024.328710e+020.0ModelValue_1CISEqc
CISEqcOEfixed5.302610e-015.302610e-010.0ModelValue_2CISEqcOE
CISInhfixed7.846530e+087.846530e+080.0ModelValue_3CISInh
CISRNADelayfixed1.447750e-011.447750e-010.0ModelValue_4CISRNADelay
CISRNAEqcfixed1.000000e+001.000000e+000.0ModelValue_5CISRNAEqc
CISRNATurnfixed1.000000e+031.000000e+030.0ModelValue_6CISRNATurn
CISTurnfixed8.398420e-038.398420e-030.0ModelValue_7CISTurn
CISoefixed0.000000e+000.000000e+000.0ModelValue_8CISoe
EpoRActJAK2fixed2.673080e-012.673080e-010.0ModelValue_9EpoRActJAK2
EpoRCISInhfixed1.000000e+061.000000e+060.0ModelValue_10EpoRCISInh
EpoRCISRemovefixed5.429320e+005.429320e+000.0ModelValue_11EpoRCISRemove
JAK2ActEpofixed6.332530e+056.332530e+050.0ModelValue_12JAK2ActEpo
JAK2EpoRDeaSHP1fixed1.427220e+021.427220e+020.0ModelValue_13JAK2EpoRDeaSHP1
SHP1ActEpoRfixed1.000000e-031.000000e-030.0ModelValue_14SHP1ActEpoR
SHP1Deafixed8.163910e-038.163910e-030.0ModelValue_15SHP1Dea
SOCS3Eqcfixed1.736530e+021.736530e+020.0ModelValue_16SOCS3Eqc
SOCS3EqcOEfixed6.791570e-016.791570e-010.0ModelValue_17SOCS3EqcOE
SOCS3Inhfixed1.040800e+011.040800e+010.0ModelValue_18SOCS3Inh
SOCS3RNADelayfixed1.064650e+001.064650e+000.0ModelValue_19SOCS3RNADelay
SOCS3RNAEqcfixed1.000000e+001.000000e+000.0ModelValue_20SOCS3RNAEqc
SOCS3RNATurnfixed8.308440e-038.308440e-030.0ModelValue_21SOCS3RNATurn
SOCS3Turnfixed1.000000e+041.000000e+040.0ModelValue_22SOCS3Turn
SOCS3oefixed0.000000e+000.000000e+000.0ModelValue_23SOCS3oe
STAT5ActEpoRfixed3.897570e+013.897570e+010.0ModelValue_24STAT5ActEpoR
STAT5ActJAK2fixed7.809650e-027.809650e-020.0ModelValue_25STAT5ActJAK2
STAT5Expfixed7.451550e-027.451550e-020.0ModelValue_26STAT5Exp
STAT5Impfixed2.688890e-022.688890e-020.0ModelValue_27STAT5Imp
epo_levelfixed1.249970e-071.249970e-070.0ModelValue_28epo_level
init_EpoRJAK2fixed3.976220e+003.976220e+000.0ModelValue_29init_EpoRJAK2
init_SHP1fixed2.672510e+012.672510e+010.0ModelValue_30init_SHP1
init_STAT5fixed7.975350e+017.975350e+010.0ModelValue_31init_STAT5
\n
" - }, - "execution_count": 8, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ - "get_parameters(model=biomodel)" + "biomodel_process_changes = ModelChanges(\n", + " reaction_changes=[rc1, rc2]\n", + ")" ], "metadata": { - "collapsed": false, - "ExecuteTime": { - "end_time": "2024-03-04T15:51:38.637249Z", - "start_time": "2024-03-04T15:51:38.634099Z" - } + "collapsed": false }, - "id": "88ade780226c3f36", - "execution_count": 8 + "id": "bd6781fe4a749c29", + "execution_count": null }, { "cell_type": "code", - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "{ 'expression': None,\n", - " 'initial_expression': 'ActD + CISoe -> A',\n", - " 'initial_value': 25.0,\n", - " 'name': 'ActD',\n", - " 'param_type': None,\n", - " 'status': None}\n" - ] - } - ], + "outputs": [], "source": [ - "param_changes = GlobalParameterChanges(\n", - " name='ActD',\n", - " initial_value=25.0,\n", - " initial_expression='ActD + CISoe -> A'\n", - ")\n", - "\n", - "pp(param_changes.model_dump())" + "pp(biomodel_process_changes.model_dump())" ], "metadata": { - "collapsed": false, - "ExecuteTime": { - "end_time": "2024-03-04T15:53:07.917983Z", - "start_time": "2024-03-04T15:53:07.911258Z" - } + "collapsed": false }, - "id": "7dcc4eb78cee520d", - "execution_count": 9 + "id": "e414174a2d6d331b", + "execution_count": null }, { "cell_type": "code", - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "{ 'global_parameter_changes': [ { 'expression': None,\n", - " 'initial_expression': 'ActD + CISoe -> A',\n", - " 'initial_value': 25.0,\n", - " 'name': 'ActD',\n", - " 'param_type': None,\n", - " 'status': None}],\n", - " 'reaction_changes': [ { 'parameter_changes': [ { 'parameter_name': 'EpoRpRJAK2',\n", - " 'value': 21312.2},\n", - " { 'parameter_name': 'EpoRJAK2',\n", - " 'value': 21312.2}],\n", - " 'reaction_name': 'reaction_1',\n", - " 'reaction_scheme': None}],\n", - " 'species_changes': []}\n" - ] - } - ], + "outputs": [], "source": [ - "model_changes = ModelChanges(\n", - " reaction_changes=[rc1],\n", - " global_parameter_changes=[param_changes]\n", + "biomodel_process = Model(\n", + " model_id=biomodel_id,\n", + " model_source=biomodel_id,\n", + " model_name='composite_from_biomodel',\n", + " model_changes=biomodel_process_changes\n", ")\n", "\n", - "pp(model_changes.model_dump())" + "pp(biomodel_process.model_dump())" ], "metadata": { - "collapsed": false, - "ExecuteTime": { - "end_time": "2024-03-04T15:55:40.439400Z", - "start_time": "2024-03-04T15:55:40.436687Z" - } + "collapsed": false }, - "id": "b8cb6d425f81f9ea", - "execution_count": 12 + "id": "9de88bc52fb9a164", + "execution_count": null }, { "cell_type": "code", @@ -491,7 +534,7 @@ "metadata": { "collapsed": false }, - "id": "bd6781fe4a749c29" + "id": "4c3f073b10e2dcc0" } ], "metadata": {