From 41ff0d3712d69074e1f5e8eca4caa6047696eb65 Mon Sep 17 00:00:00 2001 From: alex patrie Date: Wed, 26 Apr 2023 15:50:44 -0400 Subject: [PATCH 1/2] adjusted Dockerfile for wheel build crash and added notebook(to be a Google Colab notebook) --- Biosimulators_Playground.ipynb | 1889 ++++++++++++++++++++++++++++++++ Dockerfile | 1 + 2 files changed, 1890 insertions(+) create mode 100644 Biosimulators_Playground.ipynb diff --git a/Biosimulators_Playground.ipynb b/Biosimulators_Playground.ipynb new file mode 100644 index 0000000..37464d9 --- /dev/null +++ b/Biosimulators_Playground.ipynb @@ -0,0 +1,1889 @@ +{ + "nbformat": 4, + "nbformat_minor": 0, + "metadata": { + "colab": { + "provenance": [] + }, + "kernelspec": { + "name": "python3", + "display_name": "Python 3" + }, + "language_info": { + "name": "python" + } + }, + "cells": [ + { + "cell_type": "markdown", + "source": [ + "#**Exploring *Biosimulators with biosimulators-copasi***: \n", + "#Python tool for harnessing the abilities of COPASI through a Biosimulators interface.\n", + "\n" + ], + "metadata": { + "id": "2QSWA3_mLsTa" + } + }, + { + "cell_type": "markdown", + "source": [ + "👁: note the default version of python that is used by Google Colab. Note that the current stable release of python is 3.9, and thus is the version used by Colab. Please keep in mind that forcing colab to point to a newer version of Python will reflect correctly in the command line (!), but colab's sys module will STILL be looking in the default version." + ], + "metadata": { + "id": "TzO8xFuBLwgV" + } + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "_ktAdE_XLn6L", + "outputId": "474dff79-449e-4b4e-f198-8d1cfe2b404c" + }, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Python 3.9.16\n" + ] + } + ], + "source": [ + "# verify python version\n", + "\n", + "!python3 --version" + ] + }, + { + "cell_type": "markdown", + "source": [ + "##***Step 0***: Install biosimulators-copasi from PyPl.\n", + "\n", + "Note that this will also install the backbone of the Biosimulators framework: biosimulators-utils. " + ], + "metadata": { + "id": "O0dcVGJ7Ae6F" + } + }, + { + "cell_type": "code", + "source": [ + "# install biosimulators-copasi and verify installation\n", + "\n", + "!pip install biosimulators-copasi" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "illYes2SL4wg", + "outputId": "e3633eb7-d9f8-4e54-a549-16a291304331" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/\n", + "Collecting biosimulators-copasi\n", + " Downloading biosimulators_copasi-0.1.35-py2.py3-none-any.whl (16 kB)\n", + "Collecting python-copasi>=4.33.246\n", + " Downloading python_copasi-4.39.272-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.4 MB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m11.4/11.4 MB\u001b[0m \u001b[31m15.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hCollecting kisao\n", + " Downloading kisao-2.30-py2.py3-none-any.whl (109 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m109.3/109.3 kB\u001b[0m \u001b[31m8.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hRequirement already satisfied: lxml in /usr/local/lib/python3.9/dist-packages (from biosimulators-copasi) (4.9.2)\n", + "Collecting biosimulators-utils[logging,sbml]>=0.1.128\n", + " Downloading biosimulators_utils-0.1.175-py2.py3-none-any.whl (468 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m468.7/468.7 kB\u001b[0m \u001b[31m28.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hRequirement already satisfied: numpy in /usr/local/lib/python3.9/dist-packages (from biosimulators-copasi) (1.22.4)\n", + "Collecting uritools\n", + " Downloading uritools-4.0.1-py3-none-any.whl (10 kB)\n", + "Collecting pyomexmeta>=1.2.13\n", + " Downloading pyomexmeta-1.2.14-cp39-cp39-manylinux2014_x86_64.whl (5.5 MB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m5.5/5.5 MB\u001b[0m \u001b[31m28.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hRequirement already satisfied: h5py in /usr/local/lib/python3.9/dist-packages (from biosimulators-utils[logging,sbml]>=0.1.128->biosimulators-copasi) (3.8.0)\n", + "Collecting python-libcombine>=0.2.11\n", + " Downloading python_libcombine-0.2.19-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.6 MB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m2.6/2.6 MB\u001b[0m \u001b[31m44.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hRequirement already satisfied: setuptools in /usr/local/lib/python3.9/dist-packages (from biosimulators-utils[logging,sbml]>=0.1.128->biosimulators-copasi) (67.6.1)\n", + "Requirement already satisfied: matplotlib in /usr/local/lib/python3.9/dist-packages (from biosimulators-utils[logging,sbml]>=0.1.128->biosimulators-copasi) (3.7.1)\n", + "Collecting yamldown\n", + " Downloading yamldown-0.1.8-py3-none-any.whl (4.1 kB)\n", + "Requirement already satisfied: termcolor in /usr/local/lib/python3.9/dist-packages (from biosimulators-utils[logging,sbml]>=0.1.128->biosimulators-copasi) (2.2.0)\n", + "Requirement already satisfied: requests in /usr/local/lib/python3.9/dist-packages (from biosimulators-utils[logging,sbml]>=0.1.128->biosimulators-copasi) (2.27.1)\n", + "Requirement already satisfied: python-dateutil in /usr/local/lib/python3.9/dist-packages (from biosimulators-utils[logging,sbml]>=0.1.128->biosimulators-copasi) (2.8.2)\n", + "Requirement already satisfied: appdirs in /usr/local/lib/python3.9/dist-packages (from biosimulators-utils[logging,sbml]>=0.1.128->biosimulators-copasi) (1.4.4)\n", + "Requirement already satisfied: mpmath in /usr/local/lib/python3.9/dist-packages (from biosimulators-utils[logging,sbml]>=0.1.128->biosimulators-copasi) (1.3.0)\n", + "Collecting rdflib\n", + " Downloading rdflib-6.3.2-py3-none-any.whl (528 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m528.1/528.1 kB\u001b[0m \u001b[31m25.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hCollecting python-libsedml>=2.0.16\n", + " Downloading python_libsedml-2.0.32-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.3 MB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m3.3/3.3 MB\u001b[0m \u001b[31m35.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hRequirement already satisfied: pyyaml in /usr/local/lib/python3.9/dist-packages (from biosimulators-utils[logging,sbml]>=0.1.128->biosimulators-copasi) (6.0)\n", + "Collecting simplejson\n", + " Downloading simplejson-3.19.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (137 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m137.4/137.4 kB\u001b[0m \u001b[31m8.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hRequirement already satisfied: openpyxl in /usr/local/lib/python3.9/dist-packages (from biosimulators-utils[logging,sbml]>=0.1.128->biosimulators-copasi) (3.0.10)\n", + "Collecting pronto>=2.4\n", + " Downloading pronto-2.5.4-py2.py3-none-any.whl (61 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m61.1/61.1 kB\u001b[0m \u001b[31m3.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hCollecting cement\n", + " Downloading cement-3.0.8-py3-none-any.whl (306 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m306.7/306.7 kB\u001b[0m \u001b[31m22.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hRequirement already satisfied: pandas in /usr/local/lib/python3.9/dist-packages (from biosimulators-utils[logging,sbml]>=0.1.128->biosimulators-copasi) (1.5.3)\n", + "Requirement already satisfied: networkx>=2.6 in /usr/local/lib/python3.9/dist-packages (from biosimulators-utils[logging,sbml]>=0.1.128->biosimulators-copasi) (3.1)\n", + "Requirement already satisfied: regex in /usr/local/lib/python3.9/dist-packages (from biosimulators-utils[logging,sbml]>=0.1.128->biosimulators-copasi) (2022.10.31)\n", + "Collecting biopython\n", + " Downloading biopython-1.81-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.1 MB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m3.1/3.1 MB\u001b[0m \u001b[31m26.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hRequirement already satisfied: natsort in /usr/local/lib/python3.9/dist-packages (from biosimulators-utils[logging,sbml]>=0.1.128->biosimulators-copasi) (8.3.1)\n", + "Collecting evalidate\n", + " Downloading evalidate-1.0.2-py3-none-any.whl (9.2 kB)\n", + "Collecting python-libsbml\n", + " Downloading python_libsbml-5.20.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.0 MB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m8.0/8.0 MB\u001b[0m \u001b[31m63.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hCollecting capturer\n", + " Downloading capturer-3.0-py2.py3-none-any.whl (15 kB)\n", + "Collecting chardet~=5.0\n", + " Downloading chardet-5.1.0-py3-none-any.whl (199 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m199.1/199.1 kB\u001b[0m \u001b[31m12.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hCollecting fastobo~=0.12.2\n", + " Downloading fastobo-0.12.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.1 MB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m2.1/2.1 MB\u001b[0m \u001b[31m48.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hRequirement already satisfied: pydot>=1.4.1 in /usr/local/lib/python3.9/dist-packages (from pyomexmeta>=1.2.13->biosimulators-utils[logging,sbml]>=0.1.128->biosimulators-copasi) (1.4.2)\n", + "Requirement already satisfied: graphviz>=0.15 in /usr/local/lib/python3.9/dist-packages (from pyomexmeta>=1.2.13->biosimulators-utils[logging,sbml]>=0.1.128->biosimulators-copasi) (0.20.1)\n", + "Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.9/dist-packages (from python-dateutil->biosimulators-utils[logging,sbml]>=0.1.128->biosimulators-copasi) (1.16.0)\n", + "Collecting humanfriendly>=8.0\n", + " Downloading humanfriendly-10.0-py2.py3-none-any.whl (86 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m86.8/86.8 kB\u001b[0m \u001b[31m7.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hRequirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.9/dist-packages (from matplotlib->biosimulators-utils[logging,sbml]>=0.1.128->biosimulators-copasi) (1.4.4)\n", + "Requirement already satisfied: fonttools>=4.22.0 in /usr/local/lib/python3.9/dist-packages (from matplotlib->biosimulators-utils[logging,sbml]>=0.1.128->biosimulators-copasi) (4.39.3)\n", + "Requirement already satisfied: importlib-resources>=3.2.0 in /usr/local/lib/python3.9/dist-packages (from matplotlib->biosimulators-utils[logging,sbml]>=0.1.128->biosimulators-copasi) (5.12.0)\n", + "Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.9/dist-packages (from matplotlib->biosimulators-utils[logging,sbml]>=0.1.128->biosimulators-copasi) (23.1)\n", + "Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.9/dist-packages (from matplotlib->biosimulators-utils[logging,sbml]>=0.1.128->biosimulators-copasi) (0.11.0)\n", + "Requirement already satisfied: contourpy>=1.0.1 in /usr/local/lib/python3.9/dist-packages (from matplotlib->biosimulators-utils[logging,sbml]>=0.1.128->biosimulators-copasi) (1.0.7)\n", + "Requirement already satisfied: pyparsing>=2.3.1 in /usr/local/lib/python3.9/dist-packages (from matplotlib->biosimulators-utils[logging,sbml]>=0.1.128->biosimulators-copasi) (3.0.9)\n", + "Requirement already satisfied: pillow>=6.2.0 in /usr/local/lib/python3.9/dist-packages (from matplotlib->biosimulators-utils[logging,sbml]>=0.1.128->biosimulators-copasi) (8.4.0)\n", + "Requirement already satisfied: et-xmlfile in /usr/local/lib/python3.9/dist-packages (from openpyxl->biosimulators-utils[logging,sbml]>=0.1.128->biosimulators-copasi) (1.1.0)\n", + "Requirement already satisfied: pytz>=2020.1 in /usr/local/lib/python3.9/dist-packages (from pandas->biosimulators-utils[logging,sbml]>=0.1.128->biosimulators-copasi) (2022.7.1)\n", + "Collecting isodate<0.7.0,>=0.6.0\n", + " Downloading isodate-0.6.1-py2.py3-none-any.whl (41 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m41.7/41.7 kB\u001b[0m \u001b[31m2.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hRequirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.9/dist-packages (from requests->biosimulators-utils[logging,sbml]>=0.1.128->biosimulators-copasi) (2022.12.7)\n", + "Requirement already satisfied: charset-normalizer~=2.0.0 in /usr/local/lib/python3.9/dist-packages (from requests->biosimulators-utils[logging,sbml]>=0.1.128->biosimulators-copasi) (2.0.12)\n", + "Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.9/dist-packages (from requests->biosimulators-utils[logging,sbml]>=0.1.128->biosimulators-copasi) (1.26.15)\n", + "Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.9/dist-packages (from requests->biosimulators-utils[logging,sbml]>=0.1.128->biosimulators-copasi) (3.4)\n", + "Requirement already satisfied: zipp>=3.1.0 in /usr/local/lib/python3.9/dist-packages (from importlib-resources>=3.2.0->matplotlib->biosimulators-utils[logging,sbml]>=0.1.128->biosimulators-copasi) (3.15.0)\n", + "Installing collected packages: python-libsedml, python-libsbml, python-libcombine, python-copasi, evalidate, yamldown, uritools, simplejson, isodate, humanfriendly, fastobo, chardet, cement, biopython, rdflib, pyomexmeta, pronto, capturer, kisao, biosimulators-utils, biosimulators-copasi\n", + " Attempting uninstall: chardet\n", + " Found existing installation: chardet 4.0.0\n", + " Uninstalling chardet-4.0.0:\n", + " Successfully uninstalled chardet-4.0.0\n", + "Successfully installed biopython-1.81 biosimulators-copasi-0.1.35 biosimulators-utils-0.1.175 capturer-3.0 cement-3.0.8 chardet-5.1.0 evalidate-1.0.2 fastobo-0.12.2 humanfriendly-10.0 isodate-0.6.1 kisao-2.30 pronto-2.5.4 pyomexmeta-1.2.14 python-copasi-4.39.272 python-libcombine-0.2.19 python-libsbml-5.20.0 python-libsedml-2.0.32 rdflib-6.3.2 simplejson-3.19.1 uritools-4.0.1 yamldown-0.1.8\n" + ] + } + ] + }, + { + "cell_type": "markdown", + "source": [ + "If you are ever prompted to restart runtime, run the following cell:\n", + "\n", + "(Note that you will manually have to keep running the cell). I find this to be a very helpful common practice for keeping the kernel fresh with the most recently desired settings, env variables, dependencies, and more." + ], + "metadata": { + "id": "ZcmhC-BmA18j" + } + }, + { + "cell_type": "code", + "source": [ + "# OPTIONAL: restart runtime as per the prompt. Python proc will be killed and runtime automatically restarted by the manager.\n", + "\n", + "import os\n", + "\n", + "os.kill(os.getpid(), 9)\n", + "\n", + "#insert here a run call as well (no extra cell submit)" + ], + "metadata": { + "id": "2897mRHUL6cY" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "# verify newest bioCopasi version as well as backend utils package!\n", + "\n", + "\n", + "import biosimulators_copasi \n", + "import biosimulators_utils\n", + "\n", + "print(f'\\nBIOSIMULATORS_COPASI VERSION: {biosimulators_copasi.__version__}')\n", + "print(f'BIOSIMULATORS_UTILS VERSION: {biosimulators_utils.__version__}\\n')" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "NSgTbIi1MFmB", + "outputId": "2bc2a205-6df6-4f49-a69a-a3699a8f957b" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stderr", + "text": [ + "/usr/local/lib/python3.9/dist-packages/requests/__init__.py:102: RequestsDependencyWarning: urllib3 (1.26.15) or chardet (5.1.0)/charset_normalizer (2.0.12) doesn't match a supported version!\n", + " warnings.warn(\"urllib3 ({}) or chardet ({})/charset_normalizer ({}) doesn't match a supported \"\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + "BIOSIMULATORS_COPASI VERSION: 0.1.35\n", + "BIOSIMULATORS_UTILS VERSION: 0.1.175\n", + "\n" + ] + } + ] + }, + { + "cell_type": "markdown", + "source": [ + "#****TO DO: RESOLVE URLLIB3 REQUESTS PYTHON3.9 ISSUE****" + ], + "metadata": { + "id": "oD4YtlFuBdqS" + } + }, + { + "cell_type": "markdown", + "source": [ + "###NOTE: When interacting with Biosimulators for Python, it is best practice to make your entrypoint into this framework to be the xml file which specifies simulation parameters. We then shift our perspective to biosimulators utils and feed that xml file into objects therein. We then use those objects as interperative material for whichever model we choose (in this tutorial, we will use biosimulators_copasi.\n", + "\n", + "###***So, the workflow shall be***: \n", + "\n", + "###.xml file-->\n", + "###-->biosimulators_utils.sedml.data_model objects-->\n", + "###-->exec_sed_task from respective biosimulators model package.\n", + "\n", + "\n", + "\n", + "\n", + "---\n", + "\n", + "\n", + "---\n", + "\n", + "\n", + "\n", + "---\n", + "\n", + "\n", + "\n", + "---\n", + "\n", + "\n", + "\n", + "---\n", + "\n", + "\n" + ], + "metadata": { + "id": "FejJwrnfMzxL" + } + }, + { + "cell_type": "markdown", + "source": [ + "#***Situation A***: *Executing time course simulations (e.g., continuous and discrete kinetic simulations)*\n", + "###Use BioSimulators-utils to describe the desired simulation. BioSimulators-utils provides several classes for describing simulations which parallel the Simulation Experiment Description Markup Language (SED-ML).\n", + "\n", + "###**These classes utilize three ontologies**:\n", + "\n", + "* Modeling formats: SED-ML model language URNs\n", + "* Outputs of implicit simulation variables: SED-ML symbol URNs\n", + "* Simulation algorithms and their parameters: Kinetic Simulation Algorithm Ontology (KiSAO)\n", + "\n", + "\n" + ], + "metadata": { + "id": "RyIabBvWMxvc" + } + }, + { + "cell_type": "markdown", + "source": [ + "##***Step 1***: Upload relevant .xml simulation file which defines task and model:" + ], + "metadata": { + "id": "JwRgwNzBOexc" + } + }, + { + "cell_type": "markdown", + "source": [ + "👁 Define the path to the relevant XML file for your variable/task output. Use the next cell to upload a file of your own into the working directory, otherwise skip the next cell and use the following one to clone our test suite, which contains a multitude of example COMBINE archives, sedml, xml, and h5 files. Here we provide two methods:" + ], + "metadata": { + "id": "gNK7NcbDOeoW" + } + }, + { + "cell_type": "code", + "source": [ + "# METHOD A: to upload your own xml file\n", + "\n", + "from google.colab import files \n", + "\n", + "files.upload()" + ], + "metadata": { + "id": "wmIYXaWGMFVf" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "# METHOD B: to use an example file from our test suite repo. \n", + " #Keep in mind that biosimulators-copasi and COPASI in general uses SBML, so we will reference SBML-core from the repo.\n", + "\n", + "!git clone https://github.com/biosimulators/Biosimulators_test_suite.git" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "X3yUijJEOpmR", + "outputId": "dc435f44-5c92-4e3e-8dab-e807833541ac" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Cloning into 'Biosimulators_test_suite'...\n", + "remote: Enumerating objects: 6834, done.\u001b[K\n", + "remote: Counting objects: 100% (173/173), done.\u001b[K\n", + "remote: Compressing objects: 100% (132/132), done.\u001b[K\n", + "remote: Total 6834 (delta 65), reused 113 (delta 32), pack-reused 6661\u001b[K\n", + "Receiving objects: 100% (6834/6834), 55.46 MiB | 29.52 MiB/s, done.\n", + "Resolving deltas: 100% (4780/4780), done.\n" + ] + } + ] + }, + { + "cell_type": "markdown", + "source": [ + "👁 Define a path for the xml source regardless of which method you choose. Note that our test suite repo comes complete with all tools available to test specific model methods." + ], + "metadata": { + "id": "exiI5rO7OvLe" + } + }, + { + "cell_type": "markdown", + "source": [ + "##***Step 2***: Import required data model objects from biosimulators-utils sedml submodule:" + ], + "metadata": { + "id": "Q8EbEH31O1qW" + } + }, + { + "cell_type": "code", + "source": [ + "from typing import Dict, List, Tuple\n", + "import pandas as pd \n", + "from biosimulators_utils.sedml.data_model import Task, Model, ModelLanguage, \\\n", + " UniformTimeCourseSimulation, Algorithm, \\\n", + " Variable, Symbol" + ], + "metadata": { + "id": "yWNSpu1ZOpeS" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "For example, use these classes to describe a 10-time unit simulation of the continuous kinetic (SBO_0000293) Ciliberto et al. morphogenesis checkpoint model using the Systems Biology Markup Language (SBML) format (EDAM:format_2585, SED-ML model language URN: sbml) and the CVODE algorithm (KISAO_0000019) with the predicted variables recorded at the initial time point and at 10 additionally uniformly spaced steps from the initial time (0) to the final time (10)." + ], + "metadata": { + "id": "8THEZGQCO4Rc" + } + }, + { + "cell_type": "markdown", + "source": [ + "##***Step 3***: Define an instance of a biosimulator_utils Task():" + ], + "metadata": { + "id": "GqB7bQ-lO9J3" + } + }, + { + "cell_type": "markdown", + "source": [ + "We can define a number of parameters for this Task object. \n", + "\n", + "***First***, there are required working keywork arguments that we define such as:*\n", + "\n", + "\n", + "* define the path to the xml (here, we will pick a 'random' xml)\n", + "* the working language that we desire of the model\n", + "* and the id of the algorithm involved\n", + "\n", + "\n", + "***Second***, since we desire a time-course simulation with 10 time units, we will define:*\n", + "\n", + "\n", + "\n", + "* the initial start time,\n", + "* output startime for event listener,\n", + "* ouput endtime\n", + "* and the number of time steps, in this case 10\n", + "\n", + "\n" + ], + "metadata": { + "id": "ZyF0kCAzTe24" + } + }, + { + "cell_type": "markdown", + "source": [ + "These can all be delightfully stored in a python dictionary or hash-table like object. Here I propose a number of methods to do so:" + ], + "metadata": { + "id": "UWUk1XnEmIlx" + } + }, + { + "cell_type": "code", + "source": [ + "#...or we can create a setup_params dict (preferred)\n", + "\n", + "\n", + "setup_params = {\n", + " 'xml': \"/content/Biosimulators_test_suite/examples/sbml-core/Ciliberto-J-Cell-Biol-2003-morphogenesis-checkpoint-continuous/BIOMD0000000297_url.xml\",\n", + " 'working_lang': ModelLanguage.SBML.value,\n", + " 'init_time': 0.,\n", + " 'output_start': 0.,\n", + " 'output_end': 10.,\n", + " 'num_steps': 10,\n", + " 'alg_id': 'KISAO_0000019'\n", + "}" + ], + "metadata": { + "id": "fnZbZFwOand5" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "###You might be wondering, \"but the documentation says that task takes two other objects as arguments, and none of them are what you just defined! That is correct! To truly instantiate a biosimulators-utils task, you must define the following objects with the following parameters as input:\n", + "\n", + "\n", + "\n", + "###1. **model**:\n", + "* xml_path\n", + "* working_language\n", + "\n", + "###2. **simulation**:\n", + "\n", + "\n", + "* temporal objects: init time, start time, end time etc\n", + "* alg_id (KISAO id)\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n" + ], + "metadata": { + "id": "1VJoXduni4ok" + } + }, + { + "cell_type": "markdown", + "source": [ + "Keep in mind that K.I.S.A.O stands for [Kinetic Simulation Algorithm Ontology](https://www.ebi.ac.uk/ols/ontologies/kisao), which is a classification of algorithms for simulating biology, their parameters, and their outputs." + ], + "metadata": { + "id": "CKShOsjSkIAf" + } + }, + { + "cell_type": "markdown", + "source": [ + "##***Step 3a***: Define the Model" + ], + "metadata": { + "id": "u_VwF0-ymfmZ" + } + }, + { + "cell_type": "code", + "source": [ + "#at very least, define source for model file and model language\n", + "\n", + "sim_model = Model(\n", + " source=setup_params['xml'],\n", + " language=setup_params['working_lang']\n", + ")" + ], + "metadata": { + "id": "7g3uw_mEaOXY" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "##***Step 3b***: Define the Simulation. We can first describe the used algorithm with an Alogrithm object" + ], + "metadata": { + "id": "fyBTNjdmoaUJ" + } + }, + { + "cell_type": "code", + "source": [ + "#Here we will define what time of simulation we desire. In this example, we are dealing with temporal \n", + " #space, so we will define this simulation as a UniformTimeCourseSimulation which has its own properties\n", + "\n", + "\n", + "simulation_algorithm = Algorithm(kisao_id=setup_params['alg_id'])\n", + "\n", + "\n", + "simulation_schema = UniformTimeCourseSimulation(\n", + " initial_time=setup_params['init_time'], \n", + " output_start_time=setup_params['output_start'],\n", + " output_end_time=setup_params['output_end'],\n", + " number_of_steps=setup_params['num_steps'],\n", + " algorithm=simulation_algorithm\n", + ")" + ], + "metadata": { + "id": "xEAk8jCpogtG" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "View the overall mapping proxy of the Abstract class to understand the properties of the object you just instantiated. " + ], + "metadata": { + "id": "MborzItm1OnN" + } + }, + { + "cell_type": "code", + "source": [ + "# generate internal object mapping\n", + "\n", + "vars(UniformTimeCourseSimulation)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "u22kKYCC0z3g", + "outputId": "025127c5-0dba-4982-9e4b-29e43a55a4e3" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "mappingproxy({'__module__': 'biosimulators_utils.sedml.data_model',\n", + " '__doc__': ' A uniform time course simulation\\n\\n Attributes:\\n id (:obj:`str`): id\\n name (:obj:`str`): name\\n algorithm (:obj:`Algorithm`): algorithm\\n initial_time (:obj:`float`): initial time\\n output_start_time (:obj:`float`): output start time\\n output_end_time (:obj:`float`): output end time\\n number_of_steps (:obj:`int`): number of time steps\\n ',\n", + " '__init__': ,\n", + " 'number_of_points': ,\n", + " 'to_tuple': ,\n", + " 'is_equal': ,\n", + " '__abstractmethods__': frozenset(),\n", + " '_abc_impl': <_abc._abc_data at 0x7fc76f3b3640>})" + ] + }, + "metadata": {}, + "execution_count": 7 + } + ] + }, + { + "cell_type": "code", + "source": [ + "# view some of the properties from your object\n", + "\n", + "vars(simulation_schema)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "UOIiuhAg1rDy", + "outputId": "65498634-76e5-4371-8485-639632ae8526" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "{'id': None,\n", + " 'name': None,\n", + " 'algorithm': ,\n", + " 'initial_time': 0.0,\n", + " 'output_start_time': 0.0,\n", + " 'output_end_time': 10.0,\n", + " 'number_of_steps': 10}" + ] + }, + "metadata": {}, + "execution_count": 8 + } + ] + }, + { + "cell_type": "markdown", + "source": [ + "##***Step 3c***: Instantiate the task with the model and simulation objects " + ], + "metadata": { + "id": "LLDbykERylvE" + } + }, + { + "cell_type": "code", + "source": [ + "simulation_task = Task(model=sim_model, simulation=simulation_schema)" + ], + "metadata": { + "id": "GXZ1PzDOO6uw" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "#confirm the \"loaded\" task\n", + "\n", + "vars(simulation_task)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "tkzt75-y5uZ_", + "outputId": "cafac0a2-021b-4b6d-f311-708c576bf231" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "{'id': None,\n", + " 'name': None,\n", + " 'model': ,\n", + " 'simulation': }" + ] + }, + "metadata": {}, + "execution_count": 10 + } + ] + }, + { + "cell_type": "markdown", + "source": [ + "##***Step 4***: define biosimulator_utils class instances to describe the outputs (e.g., time, concentrations of species, fluxes/rates/velocities of reactions, sizes of compartments) as variables in the form of a list of variables that should be recorded for the simulation. \n", + "\n", + "👁 Outputs for variables explicitly defined in SBML files must be described using their XML XPaths \n", + "(e.g., /sbml:sbml/sbml:model/sbml:listOfSpecies/sbml:species[@id=\"Clb\"] for the species with id Clb). Outputs for variables not explicitly defined in SBML files (e.g., time) must be described using SED-ML symbol URNs (e.g., urn:sedml:symbol:time for time).\n", + "\n", + "For ease of use, I have implemented the instantiation of this list of variables through a function such we do not possess the need to repeat values as input. Note that these python classes are merely interfaces: the actual data upon which each of these variables is based on is fetched from the sbml_url argument. This essentially scientifically annotates the python object. note that you may give any str id to these variables...their source of truth comes from the uri. it is assumed that the best practice would be to keep their id's as their namesakes for simulation's sake.\n", + "\n", + "In this case, we couple together an output Variable which has its own unique properties with the Task instance that we just created. Again, this list of variables serves as an output listener. For example, if the simulation was the effects of someone spitting gasoline into an exposed flame, the list of ouput variables that we could expect would include: [flames spitting out, burnt lips, etc]. Consider the other elements in this analogy." + ], + "metadata": { + "id": "nCMzGohO6QVc" + } + }, + { + "cell_type": "markdown", + "source": [ + "###Define a helper function that returns a list of instantiated variables" + ], + "metadata": { + "id": "zsySmpcJ-kWl" + } + }, + { + "cell_type": "code", + "source": [ + "def generate_time_course_variables(\n", + " task: Task, \n", + " sbml_uri: str = 'http://www.sbml.org/sbml/level2/version4'\n", + " ) -> List:\n", + " return [\n", + " Variable(\n", + " id='time',\n", + " symbol=Symbol.time.value,\n", + " task=task,\n", + " ), \n", + " Variable(\n", + " id='clb',\n", + " target='/sbml:sbml/sbml:model/sbml:listOfSpecies/sbml:species[@id=\"Clb\"]',\n", + " target_namespaces={'sbml': sbml_uri},\n", + " task=task,\n", + " ),\n", + " Variable(\n", + " id='cln',\n", + " target='/sbml:sbml/sbml:model/sbml:listOfSpecies/sbml:species[@id=\"Cln\"]',\n", + " target_namespaces={'sbml': sbml_uri},\n", + " task=task,\n", + " ),\n", + " Variable(\n", + " id='sbf',\n", + " target='/sbml:sbml/sbml:model/sbml:listOfSpecies/sbml:species[@id=\"SBF\"]',\n", + " target_namespaces={'sbml': sbml_uri},\n", + " task=task,\n", + " ),\n", + " Variable(\n", + " id='sic1',\n", + " target='/sbml:sbml/sbml:model/sbml:listOfSpecies/sbml:species[@id=\"Sic\"]',\n", + " target_namespaces={'sbml': sbml_uri},\n", + " task=task,\n", + " ),\n", + " ]" + ], + "metadata": { + "id": "laVcS_N56D02" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "###Instantiate the list of variables with the Task object and investigate" + ], + "metadata": { + "id": "Ls4PEIbB-ziG" + } + }, + { + "cell_type": "code", + "source": [ + "#generate list \n", + "output_variables = generate_time_course_variables(task=simulation_task)" + ], + "metadata": { + "id": "uzu2Qt9X-Mi5" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "#view some of the object's properties \n", + "for obj in output_variables:\n", + " varz = vars(obj)\n", + " print(f\"{varz['id']} ==> {varz}\\n\")" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "p8SsjPlw_MK8", + "outputId": "c038caf2-117d-4aab-95b3-f67c47a8ab41" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "time ==> {'id': 'time', 'name': None, 'target': None, 'target_namespaces': {}, 'symbol': 'urn:sedml:symbol:time', 'task': , 'model': None}\n", + "\n", + "clb ==> {'id': 'clb', 'name': None, 'target': '/sbml:sbml/sbml:model/sbml:listOfSpecies/sbml:species[@id=\"Clb\"]', 'target_namespaces': {'sbml': 'http://www.sbml.org/sbml/level2/version4'}, 'symbol': None, 'task': , 'model': None}\n", + "\n", + "cln ==> {'id': 'cln', 'name': None, 'target': '/sbml:sbml/sbml:model/sbml:listOfSpecies/sbml:species[@id=\"Cln\"]', 'target_namespaces': {'sbml': 'http://www.sbml.org/sbml/level2/version4'}, 'symbol': None, 'task': , 'model': None}\n", + "\n", + "sbf ==> {'id': 'sbf', 'name': None, 'target': '/sbml:sbml/sbml:model/sbml:listOfSpecies/sbml:species[@id=\"SBF\"]', 'target_namespaces': {'sbml': 'http://www.sbml.org/sbml/level2/version4'}, 'symbol': None, 'task': , 'model': None}\n", + "\n", + "sic1 ==> {'id': 'sic1', 'name': None, 'target': '/sbml:sbml/sbml:model/sbml:listOfSpecies/sbml:species[@id=\"Sic\"]', 'target_namespaces': {'sbml': 'http://www.sbml.org/sbml/level2/version4'}, 'symbol': None, 'task': , 'model': None}\n", + "\n" + ] + } + ] + }, + { + "cell_type": "markdown", + "source": [ + "##***Step 6***: Define a function that executes the simulation task with the defined output variables as measure. \n", + "\n", + "Import a simulation tool which can execute time course simulations of models defined in SBML with CVODE such as tellurium or COPASI. BioSimulators provides extensive information about the capabilities of each simulation tool which can be used to identify an appopriate tool for a specific simulation. In addition, runBioSimulations provides wizards that can recommend specific simulation tools for specific projects. \n", + "\n", + "Remember when we installed and imported biosimulators-copasi: Here is where we will use biosimulators-copasi!" + ], + "metadata": { + "id": "qsQ5JfVfAJ-m" + } + }, + { + "cell_type": "markdown", + "source": [ + "###The primary function at the heart of each respective model package is from biosimulators-utils and is entitled exec_sed_task. Biosimulators copasi has its own version" + ], + "metadata": { + "id": "S3xXA8KcE-Nb" + } + }, + { + "cell_type": "code", + "source": [ + "#Define a simple function that returns the output. Keep in mind that task execution returns a tuple of (results, log).\n", + "\n", + "def execute_task(task: Task, variables: List) -> tuple:\n", + " task_results, task_log = biosimulators_copasi.exec_sed_task(task, variables)\n", + " return task_results, task_log" + ], + "metadata": { + "id": "MMpfqKxw_Y3c" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "#generate the tuple of outputs for the task and simulation we just defined and investigate\n", + "\n", + "task_results, task_log = execute_task(simulation_task, output_variables)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "qo7rVEiQEKYV", + "outputId": "70f75046-be09-4f81-e3ed-8c0dfaad60a7" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stderr", + "text": [ + "/usr/local/lib/python3.9/dist-packages/biosimulators_utils/warnings.py:31: BioSimulatorsWarning: - Variable `clb` has warnings.\n", + " - XPath could not be validated.\n", + "- Variable `cln` has warnings.\n", + " - XPath could not be validated.\n", + "- Variable `sbf` has warnings.\n", + " - XPath could not be validated.\n", + "- Variable `sic1` has warnings.\n", + " - XPath could not be validated.\n", + " warnings.warn(termcolor.colored(message, Colors.warning.value), category)\n", + "/usr/local/lib/python3.9/dist-packages/biosimulators_utils/warnings.py:31: BioSimulatorsWarning: Model `None` may be invalid.\n", + " - The model file `/content/Biosimulators_test_suite/examples/sbml-core/Ciliberto-J-Cell-Biol-2003-morphogenesis-checkpoint-continuous/BIOMD0000000297_url.xml` has warnings.\n", + " - 3 warnings of type SBO term consistency (10713). The following is the first warning at line 211, column 6:\n", + " - The value of the 'sboTerm' attribute on a is expected to be an SBO identifier (http://www.biomodels.net/SBO/). In SBML Level 2 prior to Version 4 it is expected to refer to a participant physical type (i.e., terms derived from SBO:0000236, \"participant physical type\"); in Versions 4 and above it is expected to refer to a material entity (i.e., terms derived from SBO:0000240, \"material entity\").\n", + " Reference: L2V4 Section 5\n", + " SBO term 'SBO:0000014' on the is not in the appropriate branch.\n", + " - 9 warnings of type SBO term consistency (10703). The following is the first warning at line 405, column 6:\n", + " - The value of the 'sboTerm' attribute on a is expected to be an SBO identifier (http://www.biomodels.net/SBO/) referring to a quantitative parameter defined in SBO (i.e., terms derived from SBO:0000002, \"quantitative systems description parameter\"). \n", + " Reference: L2V4 Sections 4.9.5 and 5\n", + " SBO term 'SBO:0000336' on the is not in the appropriate branch.\n", + " - 67 warnings of type SBML unit consistency (99505). The following is the first warning at line 440, column 6:\n", + " - In situations where a mathematical expression contains literal numbers or parameters whose units have not been declared, it is not possible to verify accurately the consistency of the units in the expression. \n", + " The units of the expression 'kswe_prime * Swe1 + kswe_doubleprime * Swe1M + kswe_tripleprime * PSwe1' cannot be fully checked. Unit consistency reported as either no errors or further unit errors related to this object may not be accurate.\n", + " - 81 warnings of type Modeling practice (80701). The following is the first warning at line 357, column 6:\n", + " - As a principle of best modeling practice, the units of a should be declared rather than be left undefined. Doing so improves the ability of software to check the consistency of units and helps make it easier to detect potential errors in models.\n", + " The with the id 'kswe' does not have a 'units' attribute.\n", + " warnings.warn(termcolor.colored(message, Colors.warning.value), category)\n", + "/usr/local/lib/python3.9/dist-packages/kisao/utils.py:477: AlgorithmSubstitutedWarning: 'LSODA/LSODAR hybrid method' (KISAO_0000560) will be substituted for 'CVODE'' (KISAO_0000019) at substitution policy 'SIMILAR_VARIABLES'.\n", + " warnings.warn(termcolor.colored(msg, 'yellow'), AlgorithmSubstitutedWarning)\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "#results can easily be parsed into a pandas dataframe\n", + "\n", + "import pandas as pd \n", + "\n", + "results_df = pd.DataFrame(task_results)\n", + "results_df" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 401 + }, + "id": "KkAEuihwG46e", + "outputId": "5ceab787-0f80-41ac-a950-ee18a97b4763" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + " time clb cln sbf sic1\n", + "0 0.0 0.184537 0.053601 0.124055 0.003549\n", + "1 1.0 0.001858 0.052388 0.035566 0.068948\n", + "2 2.0 0.000306 0.051087 0.040022 0.210531\n", + "3 3.0 0.000160 0.050092 0.041182 0.310953\n", + "4 4.0 0.000106 0.049297 0.042278 0.395175\n", + "5 5.0 0.000077 0.048683 0.043410 0.471543\n", + "6 6.0 0.000058 0.048238 0.044590 0.542787\n", + "7 7.0 0.000045 0.047950 0.045825 0.609840\n", + "8 8.0 0.000036 0.047810 0.047120 0.673041\n", + "9 9.0 0.000031 0.047810 0.048480 0.732510\n", + "10 10.0 0.000028 0.047942 0.049910 0.788341" + ], + "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", + "
timeclbclnsbfsic1
00.00.1845370.0536010.1240550.003549
11.00.0018580.0523880.0355660.068948
22.00.0003060.0510870.0400220.210531
33.00.0001600.0500920.0411820.310953
44.00.0001060.0492970.0422780.395175
55.00.0000770.0486830.0434100.471543
66.00.0000580.0482380.0445900.542787
77.00.0000450.0479500.0458250.609840
88.00.0000360.0478100.0471200.673041
99.00.0000310.0478100.0484800.732510
1010.00.0000280.0479420.0499100.788341
\n", + "
\n", + " \n", + " \n", + " \n", + "\n", + " \n", + "
\n", + "
\n", + " " + ] + }, + "metadata": {}, + "execution_count": 16 + } + ] + }, + { + "cell_type": "markdown", + "source": [ + "In general, I propose that the logic for this entire Situation A be housed in a function or method. My reasoning for this is simulation tweakability within the same runtime. If you wanted to specify different temporal parameters using the same model without having to refresh the kernel, you would could just recall that function. I have propose a simple functional approach below:" + ], + "metadata": { + "id": "Ty1hwFpCHhPW" + } + }, + { + "cell_type": "code", + "source": [ + "#or by housing it in a function\n", + "\n", + "def my_task_simulation(\n", + " xml: str = \"/content/Biosimulators_test_suite/examples/sbml-core/Ciliberto-J-Cell-Biol-2003-morphogenesis-checkpoint-continuous/BIOMD0000000297_url.xml\", \n", + " working_lang=ModelLanguage.SBML.value, \n", + " init_time: float = 0., \n", + " output_start: float = 0., \n", + " output_end: float = 10., \n", + " num_steps: int = 10,\n", + " alg_id: str = 'KISAO_0000019',\n", + " ) -> tuple:\n", + "\n", + " sim_model = Model(source=xml,\n", + " language=working_lang)\n", + " \n", + " simulation_algorithm = Algorithm(kisao_id=alg_id)\n", + "\n", + " simulation_schema = UniformTimeCourseSimulation(initial_time=init_time, \n", + " output_start_time=output_start,\n", + " output_end_time=output_end,\n", + " number_of_steps=num_steps,\n", + " algorithm=simulation_algorithm)\n", + " \n", + " simulation_task = Task(model=sim_model, simulation=simulation_schema)\n", + "\n", + " sbml_uri = 'http://www.sbml.org/sbml/level2/version4'\n", + "\n", + " variables = [\n", + " Variable(\n", + " id='time',\n", + " symbol=Symbol.time.value,\n", + " task=simulation_task,\n", + " ), \n", + " Variable(\n", + " id='clb',\n", + " target='/sbml:sbml/sbml:model/sbml:listOfSpecies/sbml:species[@id=\"Clb\"]',\n", + " target_namespaces={'sbml': sbml_uri},\n", + " task=simulation_task,\n", + " ),\n", + " Variable(\n", + " id='cln',\n", + " target='/sbml:sbml/sbml:model/sbml:listOfSpecies/sbml:species[@id=\"Cln\"]',\n", + " target_namespaces={'sbml': sbml_uri},\n", + " task=simulation_task,\n", + " ),\n", + " Variable(\n", + " id='sbf',\n", + " target='/sbml:sbml/sbml:model/sbml:listOfSpecies/sbml:species[@id=\"SBF\"]',\n", + " target_namespaces={'sbml': sbml_uri},\n", + " task=simulation_task,\n", + " ),\n", + " Variable(\n", + " id='sic1',\n", + " target='/sbml:sbml/sbml:model/sbml:listOfSpecies/sbml:species[@id=\"Sic\"]',\n", + " target_namespaces={'sbml': sbml_uri},\n", + " task=simulation_task,\n", + " ),\n", + " ]\n", + "\n", + " return biosimulators_copasi.exec_sed_task(simulation_task, variables)" + ], + "metadata": { + "id": "yNe6p1FfKDlt" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "# now run with your specified defaults\n", + "\n", + "mysim_results1, mysim_log1 = my_task_simulation()" + ], + "metadata": { + "id": "UR3wXajzOYhm" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "mysim_results1 " + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "CsFBo7nhRrB5", + "outputId": "3d11c0b4-f87f-4107-87e4-cf3decfb72cc" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "{'time': array([ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10.]),\n", + " 'clb': array([1.84536730e-01, 1.85826671e-03, 3.05503133e-04, 1.60009187e-04,\n", + " 1.05913246e-04, 7.66030789e-05, 5.77467557e-05, 4.48760088e-05,\n", + " 3.63406777e-05, 3.12486679e-05, 2.83722142e-05]),\n", + " 'cln': array([0.05360096, 0.05238797, 0.05108677, 0.05009187, 0.04929685,\n", + " 0.04868333, 0.04823817, 0.0479503 , 0.04781022, 0.0478098 ,\n", + " 0.04794216]),\n", + " 'sbf': array([0.12405464, 0.03556645, 0.04002236, 0.04118227, 0.04227827,\n", + " 0.04340982, 0.04459006, 0.04582522, 0.04712022, 0.04847993,\n", + " 0.04990973]),\n", + " 'sic1': array([0.00354918, 0.06894847, 0.21053137, 0.31095349, 0.39517472,\n", + " 0.47154301, 0.54278729, 0.60983964, 0.6730412 , 0.73251009,\n", + " 0.78834146])}" + ] + }, + "metadata": {}, + "execution_count": 24 + } + ] + }, + { + "cell_type": "code", + "source": [ + "# you can adjust the parameters from there, say the number of steps:\n", + "\n", + "mysim_results2, mysim_log2 = my_task_simulation(output_end=20., \n", + " num_steps=30)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "0z1CVYxuOn05", + "outputId": "7d7a2291-2f4c-4134-8f1b-8b519a0a52f3" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stderr", + "text": [ + "/usr/local/lib/python3.9/dist-packages/biosimulators_utils/warnings.py:31: BioSimulatorsWarning: - Variable `clb` has warnings.\n", + " - XPath could not be validated.\n", + "- Variable `cln` has warnings.\n", + " - XPath could not be validated.\n", + "- Variable `sbf` has warnings.\n", + " - XPath could not be validated.\n", + "- Variable `sic1` has warnings.\n", + " - XPath could not be validated.\n", + " warnings.warn(termcolor.colored(message, Colors.warning.value), category)\n", + "/usr/local/lib/python3.9/dist-packages/biosimulators_utils/warnings.py:31: BioSimulatorsWarning: Model `None` may be invalid.\n", + " - The model file `/content/Biosimulators_test_suite/examples/sbml-core/Ciliberto-J-Cell-Biol-2003-morphogenesis-checkpoint-continuous/BIOMD0000000297_url.xml` has warnings.\n", + " - 3 warnings of type SBO term consistency (10713). The following is the first warning at line 211, column 6:\n", + " - The value of the 'sboTerm' attribute on a is expected to be an SBO identifier (http://www.biomodels.net/SBO/). In SBML Level 2 prior to Version 4 it is expected to refer to a participant physical type (i.e., terms derived from SBO:0000236, \"participant physical type\"); in Versions 4 and above it is expected to refer to a material entity (i.e., terms derived from SBO:0000240, \"material entity\").\n", + " Reference: L2V4 Section 5\n", + " SBO term 'SBO:0000014' on the is not in the appropriate branch.\n", + " - 9 warnings of type SBO term consistency (10703). The following is the first warning at line 405, column 6:\n", + " - The value of the 'sboTerm' attribute on a is expected to be an SBO identifier (http://www.biomodels.net/SBO/) referring to a quantitative parameter defined in SBO (i.e., terms derived from SBO:0000002, \"quantitative systems description parameter\"). \n", + " Reference: L2V4 Sections 4.9.5 and 5\n", + " SBO term 'SBO:0000336' on the is not in the appropriate branch.\n", + " - 67 warnings of type SBML unit consistency (99505). The following is the first warning at line 440, column 6:\n", + " - In situations where a mathematical expression contains literal numbers or parameters whose units have not been declared, it is not possible to verify accurately the consistency of the units in the expression. \n", + " The units of the expression 'kswe_prime * Swe1 + kswe_doubleprime * Swe1M + kswe_tripleprime * PSwe1' cannot be fully checked. Unit consistency reported as either no errors or further unit errors related to this object may not be accurate.\n", + " - 81 warnings of type Modeling practice (80701). The following is the first warning at line 357, column 6:\n", + " - As a principle of best modeling practice, the units of a should be declared rather than be left undefined. Doing so improves the ability of software to check the consistency of units and helps make it easier to detect potential errors in models.\n", + " The with the id 'kswe' does not have a 'units' attribute.\n", + " warnings.warn(termcolor.colored(message, Colors.warning.value), category)\n", + "/usr/local/lib/python3.9/dist-packages/kisao/utils.py:477: AlgorithmSubstitutedWarning: 'LSODA/LSODAR hybrid method' (KISAO_0000560) will be substituted for 'CVODE'' (KISAO_0000019) at substitution policy 'SIMILAR_VARIABLES'.\n", + " warnings.warn(termcolor.colored(msg, 'yellow'), AlgorithmSubstitutedWarning)\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "mysim_results2" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "Zr9XYkfuSHUQ", + "outputId": "f71611f8-d412-4362-b1af-16b8a82ebab3" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "{'time': array([ 0. , 0.66666667, 1.33333333, 2. , 2.66666667,\n", + " 3.33333333, 4. , 4.66666667, 5.33333333, 6. ,\n", + " 6.66666667, 7.33333333, 8. , 8.66666667, 9.33333333,\n", + " 10. , 10.66666667, 11.33333333, 12. , 12.66666667,\n", + " 13.33333333, 14. , 14.66666667, 15.33333333, 16. ,\n", + " 16.66666667, 17.33333333, 18. , 18.66666667, 19.33333333,\n", + " 20. ]),\n", + " 'clb': array([1.84536730e-01, 2.25395167e-02, 6.94193940e-04, 3.05503135e-04,\n", + " 1.90909179e-04, 1.37314425e-04, 1.05913176e-04, 8.48347082e-05,\n", + " 6.94711740e-05, 5.77467548e-05, 4.86329394e-05, 4.15945375e-05,\n", + " 3.63406744e-05, 3.26297871e-05, 3.01129785e-05, 2.83722125e-05,\n", + " 2.70809552e-05, 2.60527286e-05, 2.51938315e-05, 2.44568972e-05,\n", + " 2.38157970e-05, 2.32523087e-05, 2.27371109e-05, 2.22678198e-05,\n", + " 2.18448761e-05, 2.14663455e-05, 2.11294599e-05, 2.08313187e-05,\n", + " 2.05691909e-05, 2.03406287e-05, 2.01434964e-05]),\n", + " 'cln': array([0.05360096, 0.05307054, 0.05189247, 0.05108676, 0.05039999,\n", + " 0.04980575, 0.04929684, 0.04886852, 0.04851681, 0.04823816,\n", + " 0.04802939, 0.04788761, 0.04781021, 0.04779487, 0.04783947,\n", + " 0.04794215, 0.04810131, 0.04831553, 0.04858364, 0.04890467,\n", + " 0.04927783, 0.04970255, 0.05017844, 0.05070531, 0.05128315,\n", + " 0.05191216, 0.05259271, 0.05332538, 0.05411096, 0.05495042,\n", + " 0.05584497]),\n", + " 'sbf': array([0.12405464, 0.02823724, 0.03842875, 0.04002236, 0.04081707,\n", + " 0.04154541, 0.04227827, 0.04302762, 0.04379747, 0.04459006,\n", + " 0.04540708, 0.04625 , 0.04712022, 0.04801919, 0.04894845,\n", + " 0.04990973, 0.05090486, 0.05193575, 0.05300436, 0.05411277,\n", + " 0.05526315, 0.05645786, 0.05769938, 0.05899041, 0.0603338 ,\n", + " 0.06173263, 0.0631902 , 0.06471006, 0.06629603, 0.06795224,\n", + " 0.06968312]),\n", + " 'sic1': array([0.00354918, 0.02233882, 0.12338621, 0.21053137, 0.28000588,\n", + " 0.3402238 , 0.39517472, 0.44673456, 0.49579467, 0.5427873 ,\n", + " 0.58792701, 0.63132628, 0.67304121, 0.7130974 , 0.75151786,\n", + " 0.78834148, 0.82361913, 0.85739876, 0.88971747, 0.92060138,\n", + " 0.95006827, 0.97813327, 1.00483762, 1.03018014, 1.05415294,\n", + " 1.0767524 , 1.09797666, 1.11782444, 1.13629447, 1.15338528,\n", + " 1.16909515])}" + ] + }, + "metadata": {}, + "execution_count": 27 + } + ] + }, + { + "cell_type": "markdown", + "source": [ + "You can do a number of things with this data, including plotting...where the time is the x axis and the values are on the y axis" + ], + "metadata": { + "id": "capg9Gw0SQuk" + } + }, + { + "cell_type": "code", + "source": [ + "import matplotlib.pyplot as plt\n", + "import numpy as np\n", + "import seaborn as sns\n", + "\n", + "\n", + "plot = sns.lineplot(data=mysim_results2,\n", + " x=\"time\",\n", + " y=)\n", + "\n", + "plot" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 471 + }, + "id": "urCTa8eaSleM", + "outputId": "337d10d1-7dbd-451b-bbe8-469f12ab7232" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "" + ] + }, + "metadata": {}, + "execution_count": 45 + }, + { + "output_type": "display_data", + "data": { + "text/plain": [ + "
" + ], + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAkAAAAGwCAYAAABB4NqyAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/bCgiHAAAACXBIWXMAAA9hAAAPYQGoP6dpAABCnklEQVR4nO3deXxUVZ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XX1/vdj4EDB6pnz57N3o+2/O62BQGoHZWWlsrtdislJcXveEpKilwuV5OvcblcrWpvFR6PR/PmzdNVV12loUOHNttuwIABevXVV/XOO+/oz3/+szwejyZMmKAjR44EsLctk52drddee00rV67Uyy+/rAMHDuiaa65RZWVlk+2D9d55rVixQmVlZbrnnnuabRNM9++7vPehNfeoLb/DVnLmzBn94he/0J133nnRIpOt/Vk305QpU/THP/5ReXl5evrpp7V27VrddNNNcrvdTbYP5nv4hz/8QfHx8ZecHrLq/WvqfcHlcikqKuqCQH6p90Vvm5a+pi2oBo82mTNnjrZt23bJeeecnBzl5OT4Pp8wYYIGDRqk3//+9/r1r3/d0d1slZtuusn35+HDhys7O1u9evXSX//61xb9iyzY/M///I9uuukmpaWlNdsmmO5fqKuvr9ePfvQjGYahl19++aJtg+ln/Y477vD9ediwYRo+fLiuuOIKrVmzRjfccIOJPWt/r776qu66665LPmhg1fvX0vcFq2AEqB0lJSUpPDz8gtXtxcXFSk1NbfI1qamprWpvBXPnztV7772n1atXKyMjo1WvjYyM1KhRo7Rv374O6l37SUxMVP/+/ZvtazDeO69Dhw7p448/1r/+67+26nXBdP+896E196gtv8NW4A0/hw4d0qpVqy46+tOUS/2sW0mfPn2UlJTUbF+D9R5+9tln2r17d6t/JyVr3L/m3hdSU1NVV1ensrIyv/aXel/0tmnpa9qCANSOoqKiNGbMGOXl5fmOeTwe5eXl+f0r+nw5OTl+7SVp1apVzbY3k2EYmjt3rt5++2198skn6t27d6vP4Xa7tXXrVvXo0aMDeti+Tp8+rW+//bbZvgbTvfuupUuXKjk5WVOnTm3V64Lp/vXu3Vupqal+96iiokJffvlls/eoLb/DZvOGn7179+rjjz9Wt27dWn2OS/2sW8mRI0d04sSJZvsajPdQahyRHTNmjEaMGNHq15p5/y71vjBmzBhFRkb63Y/du3ersLCw2fvRlt/dtnYe7WjZsmWG3W43XnvtNWPHjh3Gj3/8YyMxMdFwuVyGYRjG3XffbTz66KO+9l988YURERFhPPvss8bOnTuNh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8AdlZWWpS5cuevDBB+V2u33nrq2t1cMPP6z09HTFxsYqOztba9asMedCAXQIRoAABKUXXnhBe/bs0dChQ/Uf//EfkqTt27df0K66ulq/+93vtGzZMlVWVmr69Om67bbblJiYqA8++ED79+/XjBkzdNVVV2nmzJmSpLlz52rHjh1atmyZ0tLS9Pbbb2vKlCnaunWr+vXrF9DrBNAxCEAAgpLT6VRUVJQcDodv2mvXrl0XtKuvr9fLL7+sK664QpJ0++23609/+pOKi4sVFxenwYMH6/rrr9fq1as1c+ZMFRYWaunSpSosLFRaWpok6eGHH9bKlSu1dOlS/dd//VfgLhJAhyEAAejUHA6HL/xIUkpKirKyshQXF+d3rKSkRJK0detWud1u9e/f3+88tbW16tatW2A6DaDDEYAAdGqRkZF+n9tstiaPeTweSdLp06cVHh6ugoIChYeH+7U7PzQBCG4EIABBKyoqym/xcnsYNWqU3G63SkpKdM0117TruQFYB0+BAQhaWVlZ+vLLL3Xw4EGVlpb6RnEuR//+/XXXXXdp1qxZeuutt3TgwAFt2LBBubm5ev/999uh1wCsgAAEIGg9/PDDCg8P1+DBg9W9e3cVFha2y3mXLl2qWbNm6ec//7kGDBigadOm6auvvlLPnj3b5fwAzMdO0AAAIOQwAgQAAEIOAQgAAIQcAhAAAAg5BCAAABByCEAAACDkEIAAAEDIIQABAICQQwACAAAhhwAEAABCDgEIAACEHAIQAAAIOf8/gsFzQYxYVKEAAAAASUVORK5CYII=\n" + }, + "metadata": {} + } + ] + }, + { + "cell_type": "markdown", + "source": [ + "\n", + "\n", + "---\n", + "\n", + "\n", + "\n", + "---\n", + "\n", + "\n", + "\n", + "---\n", + "\n", + "\n", + "\n", + "---\n", + "\n" + ], + "metadata": { + "id": "83LPeCYrHd1S" + } + }, + { + "cell_type": "markdown", + "source": [ + "#***Situation B***: *Executing time course simulations (e.g., continuous and discrete kinetic simulations)*\n", + "\n", + "Similarly, first use BioSimulators' classes to describe the simulation that you would like to execute such as a flux balance analysis ([KISAO_0000437](https://www.ebi.ac.uk/ols/ontologies/kisao/terms?iri=http%3A%2F%2Fwww.biomodels.net%2Fkisao%2FKISAO%23KISAO_0000437)) simulation of a constraint-based ([SBO_0000624](https://www.ebi.ac.uk/ols/ontologies/sbo/terms?iri=http%3A%2F%2Fbiomodels.net%2FSBO%2FSBO_0000624)) [model of the central metabolism of *Escherichia coli*](../_data/Escherichia-coli-core-metabolism.xml) encoded in SBML ([EDAM:format_2585](https://www.ebi.ac.uk/ols/ontologies/edam/terms?iri=http%3A%2F%2Fedamontology.org%2Fformat_2585), SED-ML model language URN: `sbml`).\n", + "\n", + "Note that we will also be manually defining an instance of Config() and TaskLog()" + ], + "metadata": { + "id": "OccKB72yHdCa" + } + }, + { + "cell_type": "markdown", + "source": [ + "We will use the same workflow" + ], + "metadata": { + "id": "qMDlZk0zXtWg" + } + }, + { + "cell_type": "code", + "source": [ + "from biosimulators_utils.sedml.data_model import SteadyStateSimulation" + ], + "metadata": { + "id": "AXGbIi-jHdXJ" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "sim_model = Model(\n", + " source='/content/Biosimulators_test_suite/examples/sbml-fbc/Escherichia-coli-core-metabolism/model.xml',\n", + " language=ModelLanguage.SBML.value, \n", + ")" + ], + "metadata": { + "id": "x5LHXJNoXwWO" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "algorithm_type = Algorithm(\n", + " kisao_id='KISAO_0000437',\n", + ")" + ], + "metadata": { + "id": "3pnpN3_DYmec" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "simulation_schema = SteadyStateSimulation(\n", + " algorithm=algorithm_type\n", + ")" + ], + "metadata": { + "id": "Mw6e-CjgYS5w" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "sim_task = Task(\n", + " model=sim_model,\n", + " simulation=simulation_schema,\n", + ")" + ], + "metadata": { + "id": "a44PaSPeXn53" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "Notice that this model is constraint-based and thus will be required to have Variable outputs listed slightly differently" + ], + "metadata": { + "id": "xBb9StYzZA--" + } + }, + { + "cell_type": "code", + "source": [ + "sbml_uri = 'http://www.sbml.org/sbml/level3/version1/core'\n", + "\n", + "sbml_fbc_uri = 'http://www.sbml.org/sbml/level3/version1/fbc/version2'\n", + "\n", + "variables = [\n", + " Variable(\n", + " id='obj',\n", + " target='/sbml:sbml/sbml:model/fbc:listOfObjectives/fbc:objective[@fbc:id=\"obj\"]',\n", + " target_namespaces={'sbml': sbml_uri, 'fbc': sbml_fbc_uri},\n", + " task=sim_task,\n", + " ),\n", + " Variable(\n", + " id='ex_glc',\n", + " target='/sbml:sbml/sbml:model/sbml:listOfReactions/sbml:reaction[@id=\"R_EX_glc__D_e\"]',\n", + " target_namespaces={'sbml': sbml_uri, 'fbc': sbml_fbc_uri},\n", + " task=sim_task,\n", + " ), \n", + "]" + ], + "metadata": { + "id": "nPvK9Ry8Yvb8" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "Can biosimulators_COPASI handle this?" + ], + "metadata": { + "id": "o1wmKjC5ZuCC" + } + }, + { + "cell_type": "code", + "source": [ + "steady_state_sim_results, stead_state_sim_log = biosimulators_copasi.core.exec_sed_task(sim_task, variables)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 440 + }, + "id": "nnCtuNZFZnbX", + "outputId": "4f565361-5477-43c1-a631-0661c6a025b2" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "error", + "ename": "ValueError", + "evalue": "ignored", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0msteady_state_sim_results\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mstead_state_sim_log\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mbiosimulators_copasi\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcore\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mexec_sed_task\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0msim_task\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mvariables\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", + "\u001b[0;32m/usr/local/lib/python3.9/dist-packages/biosimulators_copasi/core.py\u001b[0m in \u001b[0;36mexec_sed_task\u001b[0;34m(task, variables, preprocessed_task, log, config)\u001b[0m\n\u001b[1;32m 147\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 148\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mpreprocessed_task\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 149\u001b[0;31m \u001b[0mpreprocessed_task\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mpreprocess_sed_task\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtask\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mvariables\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mconfig\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mconfig\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 150\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 151\u001b[0m \u001b[0mmodel\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtask\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmodel\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m/usr/local/lib/python3.9/dist-packages/biosimulators_copasi/core.py\u001b[0m in \u001b[0;36mpreprocess_sed_task\u001b[0;34m(task, variables, config)\u001b[0m\n\u001b[1;32m 307\u001b[0m raise_errors_warnings(*validation.validate_model_changes(model),\n\u001b[1;32m 308\u001b[0m error_summary='Changes for model `{}` are invalid.'.format(model.id))\n\u001b[0;32m--> 309\u001b[0;31m raise_errors_warnings(validation.validate_simulation_type(sim, (UniformTimeCourseSimulation, )),\n\u001b[0m\u001b[1;32m 310\u001b[0m error_summary='{} `{}` is not supported.'.format(sim.__class__.__name__, sim.id))\n\u001b[1;32m 311\u001b[0m raise_errors_warnings(*validation.validate_simulation(sim),\n", + "\u001b[0;32m/usr/local/lib/python3.9/dist-packages/biosimulators_utils/utils/core.py\u001b[0m in \u001b[0;36mraise_errors_warnings\u001b[0;34m(errors, warnings, error_summary, warning_summary)\u001b[0m\n\u001b[1;32m 385\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0merror_summary\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 386\u001b[0m \u001b[0mmsg\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0merror_summary\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0;34m'\\n '\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0mmsg\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mreplace\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'\\n'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'\\n '\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 387\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0mValueError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmsg\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 388\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 389\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;31mValueError\u001b[0m: SteadyStateSimulation `None` is not supported.\n - Simulation None of type `SteadyStateSimulation` is not supported. Simulation must be an instance of one of the following:\n - UniformTimeCourseSimulation" + ] + } + ] + }, + { + "cell_type": "markdown", + "source": [ + "As you can see, COPASI does not support SteadyState simulation, but rather time course. Let's pick a model that does support steady state, such as COBRApy:" + ], + "metadata": { + "id": "LSbOXEDfav5u" + } + }, + { + "cell_type": "code", + "source": [ + "!pip install biosimulators_cobrapy" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "zgko4bUxatSO", + "outputId": "b406d84a-90d8-4370-a653-87ee436ced8f" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/\n", + "Collecting biosimulators_cobrapy\n", + " Downloading biosimulators_cobrapy-0.1.23-py2.py3-none-any.whl (14 kB)\n", + "Requirement already satisfied: python-libsbml in /usr/local/lib/python3.9/dist-packages (from biosimulators_cobrapy) (5.20.0)\n", + "Requirement already satisfied: numpy in /usr/local/lib/python3.9/dist-packages (from biosimulators_cobrapy) (1.22.4)\n", + "Requirement already satisfied: kisao in /usr/local/lib/python3.9/dist-packages (from biosimulators_cobrapy) (2.30)\n", + "Requirement already satisfied: lxml in /usr/local/lib/python3.9/dist-packages (from biosimulators_cobrapy) (4.9.2)\n", + "Collecting cobra\n", + " Downloading cobra-0.26.3-py2.py3-none-any.whl (1.2 MB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.2/1.2 MB\u001b[0m \u001b[31m16.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hRequirement already satisfied: biosimulators-utils[logging]>=0.1.162 in /usr/local/lib/python3.9/dist-packages (from biosimulators_cobrapy) (0.1.175)\n", + "Requirement already satisfied: pandas in /usr/local/lib/python3.9/dist-packages (from biosimulators-utils[logging]>=0.1.162->biosimulators_cobrapy) (1.5.3)\n", + "Requirement already satisfied: setuptools in /usr/local/lib/python3.9/dist-packages (from biosimulators-utils[logging]>=0.1.162->biosimulators_cobrapy) (67.6.1)\n", + "Requirement already satisfied: pyomexmeta>=1.2.13 in /usr/local/lib/python3.9/dist-packages (from biosimulators-utils[logging]>=0.1.162->biosimulators_cobrapy) (1.2.14)\n", + "Requirement already satisfied: yamldown in /usr/local/lib/python3.9/dist-packages (from biosimulators-utils[logging]>=0.1.162->biosimulators_cobrapy) (0.1.8)\n", + "Requirement already satisfied: termcolor in /usr/local/lib/python3.9/dist-packages (from biosimulators-utils[logging]>=0.1.162->biosimulators_cobrapy) (2.2.0)\n", + "Requirement already satisfied: simplejson in /usr/local/lib/python3.9/dist-packages (from biosimulators-utils[logging]>=0.1.162->biosimulators_cobrapy) (3.19.1)\n", + "Requirement already satisfied: uritools in /usr/local/lib/python3.9/dist-packages (from biosimulators-utils[logging]>=0.1.162->biosimulators_cobrapy) (4.0.1)\n", + "Requirement already satisfied: cement in /usr/local/lib/python3.9/dist-packages (from biosimulators-utils[logging]>=0.1.162->biosimulators_cobrapy) (3.0.8)\n", + "Requirement already satisfied: regex in /usr/local/lib/python3.9/dist-packages (from biosimulators-utils[logging]>=0.1.162->biosimulators_cobrapy) (2022.10.31)\n", + "Requirement already satisfied: pyyaml in /usr/local/lib/python3.9/dist-packages (from biosimulators-utils[logging]>=0.1.162->biosimulators_cobrapy) (6.0)\n", + "Requirement already satisfied: natsort in /usr/local/lib/python3.9/dist-packages (from biosimulators-utils[logging]>=0.1.162->biosimulators_cobrapy) (8.3.1)\n", + "Requirement already satisfied: h5py in /usr/local/lib/python3.9/dist-packages (from biosimulators-utils[logging]>=0.1.162->biosimulators_cobrapy) (3.8.0)\n", + "Requirement already satisfied: biopython in /usr/local/lib/python3.9/dist-packages (from biosimulators-utils[logging]>=0.1.162->biosimulators_cobrapy) (1.81)\n", + "Requirement already satisfied: python-dateutil in /usr/local/lib/python3.9/dist-packages (from biosimulators-utils[logging]>=0.1.162->biosimulators_cobrapy) (2.8.2)\n", + "Requirement already satisfied: python-libsedml>=2.0.16 in /usr/local/lib/python3.9/dist-packages (from biosimulators-utils[logging]>=0.1.162->biosimulators_cobrapy) (2.0.32)\n", + "Requirement already satisfied: pronto>=2.4 in /usr/local/lib/python3.9/dist-packages (from biosimulators-utils[logging]>=0.1.162->biosimulators_cobrapy) (2.5.4)\n", + "Requirement already satisfied: evalidate in /usr/local/lib/python3.9/dist-packages (from biosimulators-utils[logging]>=0.1.162->biosimulators_cobrapy) (1.0.2)\n", + "Requirement already satisfied: openpyxl in /usr/local/lib/python3.9/dist-packages (from biosimulators-utils[logging]>=0.1.162->biosimulators_cobrapy) (3.0.10)\n", + "Requirement already satisfied: rdflib in /usr/local/lib/python3.9/dist-packages (from biosimulators-utils[logging]>=0.1.162->biosimulators_cobrapy) (6.3.2)\n", + "Requirement already satisfied: mpmath in /usr/local/lib/python3.9/dist-packages (from biosimulators-utils[logging]>=0.1.162->biosimulators_cobrapy) (1.3.0)\n", + "Requirement already satisfied: matplotlib in /usr/local/lib/python3.9/dist-packages (from biosimulators-utils[logging]>=0.1.162->biosimulators_cobrapy) (3.7.1)\n", + "Requirement already satisfied: networkx>=2.6 in /usr/local/lib/python3.9/dist-packages (from biosimulators-utils[logging]>=0.1.162->biosimulators_cobrapy) (3.1)\n", + "Requirement already satisfied: appdirs in /usr/local/lib/python3.9/dist-packages (from biosimulators-utils[logging]>=0.1.162->biosimulators_cobrapy) (1.4.4)\n", + "Requirement already satisfied: requests in /usr/local/lib/python3.9/dist-packages (from biosimulators-utils[logging]>=0.1.162->biosimulators_cobrapy) (2.27.1)\n", + "Requirement already satisfied: python-libcombine>=0.2.11 in /usr/local/lib/python3.9/dist-packages (from biosimulators-utils[logging]>=0.1.162->biosimulators_cobrapy) (0.2.19)\n", + "Requirement already satisfied: capturer in /usr/local/lib/python3.9/dist-packages (from biosimulators-utils[logging]>=0.1.162->biosimulators_cobrapy) (3.0)\n", + "Collecting depinfo~=1.7\n", + " Downloading depinfo-1.7.0-py2.py3-none-any.whl (8.6 kB)\n", + "Collecting swiglpk\n", + " Downloading swiglpk-5.0.8-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.3 MB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m2.3/2.3 MB\u001b[0m \u001b[31m55.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hRequirement already satisfied: importlib-resources in /usr/local/lib/python3.9/dist-packages (from cobra->biosimulators_cobrapy) (5.12.0)\n", + "Collecting httpx~=0.24\n", + " Downloading httpx-0.24.0-py3-none-any.whl (75 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m75.3/75.3 kB\u001b[0m \u001b[31m8.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hRequirement already satisfied: future in /usr/local/lib/python3.9/dist-packages (from cobra->biosimulators_cobrapy) (0.18.3)\n", + "Requirement already satisfied: pydantic~=1.6 in /usr/local/lib/python3.9/dist-packages (from cobra->biosimulators_cobrapy) (1.10.7)\n", + "Collecting optlang~=1.5\n", + " Downloading optlang-1.6.1-py2.py3-none-any.whl (138 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m138.4/138.4 kB\u001b[0m \u001b[31m14.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hCollecting ruamel.yaml~=0.16\n", + " Downloading ruamel.yaml-0.17.21-py3-none-any.whl (109 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m109.5/109.5 kB\u001b[0m \u001b[31m10.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hRequirement already satisfied: rich>=8.0 in /usr/local/lib/python3.9/dist-packages (from cobra->biosimulators_cobrapy) (13.3.4)\n", + "Collecting diskcache~=5.0\n", + " Downloading diskcache-5.6.1-py3-none-any.whl (45 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m45.6/45.6 kB\u001b[0m \u001b[31m4.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hCollecting httpcore<0.18.0,>=0.15.0\n", + " Downloading httpcore-0.17.0-py3-none-any.whl (70 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m70.6/70.6 kB\u001b[0m \u001b[31m7.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hRequirement already satisfied: sniffio in /usr/local/lib/python3.9/dist-packages (from httpx~=0.24->cobra->biosimulators_cobrapy) (1.3.0)\n", + "Requirement already satisfied: idna in /usr/local/lib/python3.9/dist-packages (from httpx~=0.24->cobra->biosimulators_cobrapy) (3.4)\n", + "Requirement already satisfied: certifi in /usr/local/lib/python3.9/dist-packages (from httpx~=0.24->cobra->biosimulators_cobrapy) (2022.12.7)\n", + "Requirement already satisfied: six>=1.9 in /usr/local/lib/python3.9/dist-packages (from optlang~=1.5->cobra->biosimulators_cobrapy) (1.16.0)\n", + "Requirement already satisfied: sympy>=1.0 in /usr/local/lib/python3.9/dist-packages (from optlang~=1.5->cobra->biosimulators_cobrapy) (1.11.1)\n", + "Requirement already satisfied: pytz>=2020.1 in /usr/local/lib/python3.9/dist-packages (from pandas->biosimulators-utils[logging]>=0.1.162->biosimulators_cobrapy) (2022.7.1)\n", + "Requirement already satisfied: chardet~=5.0 in /usr/local/lib/python3.9/dist-packages (from pronto>=2.4->biosimulators-utils[logging]>=0.1.162->biosimulators_cobrapy) (5.1.0)\n", + "Requirement already satisfied: fastobo~=0.12.2 in /usr/local/lib/python3.9/dist-packages (from pronto>=2.4->biosimulators-utils[logging]>=0.1.162->biosimulators_cobrapy) (0.12.2)\n", + "Requirement already satisfied: typing-extensions>=4.2.0 in /usr/local/lib/python3.9/dist-packages (from pydantic~=1.6->cobra->biosimulators_cobrapy) (4.5.0)\n", + "Requirement already satisfied: graphviz>=0.15 in /usr/local/lib/python3.9/dist-packages (from pyomexmeta>=1.2.13->biosimulators-utils[logging]>=0.1.162->biosimulators_cobrapy) (0.20.1)\n", + "Requirement already satisfied: pydot>=1.4.1 in /usr/local/lib/python3.9/dist-packages (from pyomexmeta>=1.2.13->biosimulators-utils[logging]>=0.1.162->biosimulators_cobrapy) (1.4.2)\n", + "Requirement already satisfied: pygments<3.0.0,>=2.13.0 in /usr/local/lib/python3.9/dist-packages (from rich>=8.0->cobra->biosimulators_cobrapy) (2.14.0)\n", + "Requirement already satisfied: markdown-it-py<3.0.0,>=2.2.0 in /usr/local/lib/python3.9/dist-packages (from rich>=8.0->cobra->biosimulators_cobrapy) (2.2.0)\n", + "Collecting ruamel.yaml.clib>=0.2.6\n", + " Downloading ruamel.yaml.clib-0.2.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (519 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m519.4/519.4 kB\u001b[0m \u001b[31m34.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hRequirement already satisfied: humanfriendly>=8.0 in /usr/local/lib/python3.9/dist-packages (from capturer->biosimulators-utils[logging]>=0.1.162->biosimulators_cobrapy) (10.0)\n", + "Requirement already satisfied: zipp>=3.1.0 in /usr/local/lib/python3.9/dist-packages (from importlib-resources->cobra->biosimulators_cobrapy) (3.15.0)\n", + "Requirement already satisfied: pyparsing>=2.3.1 in /usr/local/lib/python3.9/dist-packages (from matplotlib->biosimulators-utils[logging]>=0.1.162->biosimulators_cobrapy) (3.0.9)\n", + "Requirement already satisfied: fonttools>=4.22.0 in /usr/local/lib/python3.9/dist-packages (from matplotlib->biosimulators-utils[logging]>=0.1.162->biosimulators_cobrapy) (4.39.3)\n", + "Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.9/dist-packages (from matplotlib->biosimulators-utils[logging]>=0.1.162->biosimulators_cobrapy) (23.1)\n", + "Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.9/dist-packages (from matplotlib->biosimulators-utils[logging]>=0.1.162->biosimulators_cobrapy) (0.11.0)\n", + "Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.9/dist-packages (from matplotlib->biosimulators-utils[logging]>=0.1.162->biosimulators_cobrapy) (1.4.4)\n", + "Requirement already satisfied: contourpy>=1.0.1 in /usr/local/lib/python3.9/dist-packages (from matplotlib->biosimulators-utils[logging]>=0.1.162->biosimulators_cobrapy) (1.0.7)\n", + "Requirement already satisfied: pillow>=6.2.0 in /usr/local/lib/python3.9/dist-packages (from matplotlib->biosimulators-utils[logging]>=0.1.162->biosimulators_cobrapy) (8.4.0)\n", + "Requirement already satisfied: et-xmlfile in /usr/local/lib/python3.9/dist-packages (from openpyxl->biosimulators-utils[logging]>=0.1.162->biosimulators_cobrapy) (1.1.0)\n", + "Requirement already satisfied: isodate<0.7.0,>=0.6.0 in /usr/local/lib/python3.9/dist-packages (from rdflib->biosimulators-utils[logging]>=0.1.162->biosimulators_cobrapy) (0.6.1)\n", + "Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.9/dist-packages (from requests->biosimulators-utils[logging]>=0.1.162->biosimulators_cobrapy) (1.26.15)\n", + "Requirement already satisfied: charset-normalizer~=2.0.0 in /usr/local/lib/python3.9/dist-packages (from requests->biosimulators-utils[logging]>=0.1.162->biosimulators_cobrapy) (2.0.12)\n", + "Collecting h11<0.15,>=0.13\n", + " Downloading h11-0.14.0-py3-none-any.whl (58 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m58.3/58.3 kB\u001b[0m \u001b[31m6.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hRequirement already satisfied: anyio<5.0,>=3.0 in /usr/local/lib/python3.9/dist-packages (from httpcore<0.18.0,>=0.15.0->httpx~=0.24->cobra->biosimulators_cobrapy) (3.6.2)\n", + "Requirement already satisfied: mdurl~=0.1 in /usr/local/lib/python3.9/dist-packages (from markdown-it-py<3.0.0,>=2.2.0->rich>=8.0->cobra->biosimulators_cobrapy) (0.1.2)\n", + "Installing collected packages: swiglpk, ruamel.yaml.clib, h11, diskcache, depinfo, ruamel.yaml, optlang, httpcore, httpx, cobra, biosimulators_cobrapy\n", + "Successfully installed biosimulators_cobrapy-0.1.23 cobra-0.26.3 depinfo-1.7.0 diskcache-5.6.1 h11-0.14.0 httpcore-0.17.0 httpx-0.24.0 optlang-1.6.1 ruamel.yaml-0.17.21 ruamel.yaml.clib-0.2.7 swiglpk-5.0.8\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "import biosimulators_cobrapy\n", + "\n", + "outputs, log = biosimulators_cobrapy.exec_sed_task(sim_task, variables)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 700 + }, + "id": "1yqUtdPjbEm4", + "outputId": "e2b90a56-c56e-4577-9666-02fe51250e22" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "error", + "ename": "ValueError", + "evalue": "ignored", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0mbiosimulators_cobrapy\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 3\u001b[0;31m \u001b[0moutputs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlog\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mbiosimulators_cobrapy\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mexec_sed_task\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0msim_task\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mvariables\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", + "\u001b[0;32m/usr/local/lib/python3.9/dist-packages/biosimulators_cobrapy/core.py\u001b[0m in \u001b[0;36mexec_sed_task\u001b[0;34m(task, variables, preprocessed_task, log, config)\u001b[0m\n\u001b[1;32m 140\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 141\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mpreprocessed_task\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 142\u001b[0;31m \u001b[0mpreprocessed_task\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mpreprocess_sed_task\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtask\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mvariables\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mconfig\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mconfig\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 143\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 144\u001b[0m \u001b[0;31m# get model\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m/usr/local/lib/python3.9/dist-packages/biosimulators_cobrapy/core.py\u001b[0m in \u001b[0;36mpreprocess_sed_task\u001b[0;34m(task, variables, config)\u001b[0m\n\u001b[1;32m 223\u001b[0m \u001b[0mmodel_etree\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0metree\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mparse\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmodel\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msource\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 224\u001b[0m \u001b[0mnamespaces\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mget_namespaces_for_xml_doc\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmodel_etree\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 225\u001b[0;31m \u001b[0msbml_fbc_prefix\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0msbml_fbc_uri\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mget_sbml_package_namespace\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'fbc'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mnamespaces\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 226\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 227\u001b[0m \u001b[0;31m# Read the model\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m/usr/local/lib/python3.9/dist-packages/biosimulators_utils/model_lang/sbml/utils.py\u001b[0m in \u001b[0;36mget_package_namespace\u001b[0;34m(package, namespaces)\u001b[0m\n\u001b[1;32m 577\u001b[0m \u001b[0msbml_fbc_uris\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0madd\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0muri\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 578\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mlen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0msbml_fbc_uris\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m!=\u001b[0m \u001b[0;36m1\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 579\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0mValueError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'Namespaces must include 1 SBML {} namespace.'\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mformat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mpackage\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 580\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mlist\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0msbml_fbc_prefixes\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlist\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0msbml_fbc_uris\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;31mValueError\u001b[0m: Namespaces must include 1 SBML fbc namespace." + ] + } + ] + }, + { + "cell_type": "markdown", + "source": [ + "As you can see, sbml files are not supported as pointing material for task object. **It must be xml**." + ], + "metadata": { + "id": "hNTPX9Uyb0_5" + } + }, + { + "cell_type": "code", + "source": [ + "outputs, log = biosimulators_cobrapy.exec_sed_task(sim_task, variables)" + ], + "metadata": { + "id": "yKAlnwmvcLw5" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "for variable_id, value in outputs.items():\n", + " print('{0:}: {1:7.3f}'.format(variable_id.ljust(6, ' '), value))" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "Kg5KqnZ0bPcl", + "outputId": "8c94e613-1f62-4349-9c93-b6321338eef7" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "obj : 0.874\n", + "ex_glc: -10.000\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [], + "metadata": { + "id": "_X0J_TojcOGB" + }, + "execution_count": null, + "outputs": [] + } + ] +} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index a78f379..2a1a540 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,6 +9,7 @@ LABEL \ org.opencontainers.image.authors="BioSimulators Team " \ org.opencontainers.image.vendor="BioSimulators Team" +RUN sudo apt-get install libglpk-dev COPY requirements.txt /tmp/requirements.txt RUN pip install -r /tmp/requirements.txt \ && rm /tmp/requirements.txt \ From febb8d9a8366dd8aa07a45236f4342700e32bd6b Mon Sep 17 00:00:00 2001 From: alex patrie Date: Thu, 27 Apr 2023 18:35:28 -0400 Subject: [PATCH 2/2] updated utils version --- Dockerfile | 1 - requirements.txt | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2a1a540..a78f379 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,6 @@ LABEL \ org.opencontainers.image.authors="BioSimulators Team " \ org.opencontainers.image.vendor="BioSimulators Team" -RUN sudo apt-get install libglpk-dev COPY requirements.txt /tmp/requirements.txt RUN pip install -r /tmp/requirements.txt \ && rm /tmp/requirements.txt \ diff --git a/requirements.txt b/requirements.txt index 36dde0c..9c439d1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,7 +9,7 @@ biosimulators-cbmpy biosimulators-copasi biosimulators-cobrapy biosimulators-tellurium -biosimulators-utils[sbml,logging,containers]>=0.1.152 +biosimulators-utils[sbml,logging,containers]>=0.1.175 ipython kisao numpy