{"id":19221672,"url":"https://github.com/matthiaskoenig/parameter-variability","last_synced_at":"2025-02-23T09:40:40.496Z","repository":{"id":197964282,"uuid":"698171199","full_name":"matthiaskoenig/parameter-variability","owner":"matthiaskoenig","description":"Bayesian models for ODE models in the Systems Biology Markup Language (SBML)","archived":false,"fork":false,"pushed_at":"2024-04-02T09:53:00.000Z","size":2597,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-04-02T11:01:34.691Z","etag":null,"topics":["bayesian","ode","ode-model","pymc","sbml"],"latest_commit_sha":null,"homepage":"https://livermetabolism.com","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/matthiaskoenig.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-09-29T10:12:59.000Z","updated_at":"2024-04-23T12:41:36.519Z","dependencies_parsed_at":"2023-12-20T12:04:45.616Z","dependency_job_id":"c278653e-1cc6-4b94-ae8e-01c60110ad94","html_url":"https://github.com/matthiaskoenig/parameter-variability","commit_stats":null,"previous_names":["matthiaskoenig/parameter-variability"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthiaskoenig%2Fparameter-variability","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthiaskoenig%2Fparameter-variability/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthiaskoenig%2Fparameter-variability/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthiaskoenig%2Fparameter-variability/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matthiaskoenig","download_url":"https://codeload.github.com/matthiaskoenig/parameter-variability/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240298393,"owners_count":19779280,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bayesian","ode","ode-model","pymc","sbml"],"created_at":"2024-11-09T14:43:50.752Z","updated_at":"2025-02-23T09:40:40.444Z","avatar_url":"https://github.com/matthiaskoenig.png","language":"Python","readme":"# Bayesian models for ODE models in SBML \n\nThis project implements Bayesian models using [PyMC](https://www.pymc.io) on top of ODE-based models encoded in the [Systems Biology Markup Language](https://sbml.org/) (SBML).\n\n## Motivation\n\n[Systems Biology Markup Language](https://sbml.org/) (SBML) provides an intuitive and reproducible way to define ordinary differential equation (ODE) models in systems biology and systems medicine. Here we outline an attempt to build a Bayesian framework to quantify the uncertainty of estimates associated with physiologically based pharmacokinetic (PBPK) models encoded in SBML.\n\n\n## Installation\n\n### libraries\nInstall graphviz library\n\n```bash\nsudo apt-get -y install graphviz graphviz-dev\n```\n\n### virtual environment\nCreate a virtual environment and install the dependencies defined in the `requirements.txt`\n\n```bash\nmkvirtualenv parameter-variability --python=python3.12\n```\n\n```bash\npip install -r requirements.txt --upgrade\n```\n\n# Example\n## ODE model\nAs an example PBPK model (see figure below), a simple PK model is implemented consisting of three compartments, `gut`, `central` and `peripheral`. The substance `y` can be transferred from the gut to the central compartment via `absorption`. The substance `y` can be distributed in the peripheral compartment via `R1` or return from the peripheral to the central compartment via `R2`. Substance 'y' is removed from the central compartment by `clearance`.\n\n\u003cimg src=\"./src/parameter_variability/models/sbml/simple_pk.png\" alt=\"simple_pk model simulation\" width=\"200\"/\u003e\n\nThe SBML of the model is available from \n[simple_pk.xml](./src/parameter_variability/models/sbml/simple_pk.xml).\n\nThe resulting ODEs of the model are\n```bash\ntime: [min]\nsubstance: [mmol]\nextent: [mmol]\nvolume: [l]\narea: [m^2]\nlength: [m]\n\n# Parameters `p`\nCL = 1.0  # [l/min] \nQ = 1.0  # [l/min] \nVcent = 1.0  # [l] \nVgut = 1.0  # [l] \nVperi = 1.0  # [l] \nk = 1.0  # [l/min] \n\n# Initial conditions `x0`\ny_cent = 0.0  # [mmol/l] Vcent\ny_gut = 1.0  # [mmol/l] Vgut\ny_peri = 0.0  # [mmol/l] Vperi\n\n# ODE system\n# y\nABSORPTION = k * y_gut  # [mmol/min]\nCLEARANCE = CL * y_cent  # [mmol/min]\nR1 = Q * y_cent  # [mmol/min]\nR2 = Q * y_peri  # [mmol/min]\n\n# odes\nd y_cent/dt = (ABSORPTION / Vcent - CLEARANCE / Vcent - R1 / Vcent) + R2 / Vcent  # [mmol/l/min]\nd y_gut/dt = -ABSORPTION / Vgut  # [mmol/l/min]\nd y_peri/dt = R1 / Vperi - R2 / Vperi  # [mmol/l/min]\n```\n\nAn example output of the model is provided here\n\n\u003cimg src=\"./src/parameter_variability/models/sbml/simple_pk_simulation.png\" alt=\"simple_pk simulation\" width=\"250\"/\u003e\n\n\n## Bayesian model\nTo generate the toy example, the two-compartment model is fed draws from an idealized random distribution for each parameter. These are called `true_thetas'. \nA forward simulation is then run to generate a run simulation for each theta. \n\nAfter adding noise to the simulation(s), a Bayesian model fits the data and draws samples from a posterior distribution. \nThe empirical distribution of these samples should contain the `true_thetas'.\n\nCurrent modelled parameters:\n- `k`: Absorption constant\n- `CL` Clearance constant\n\nTo run the example Bayesian model execute the `bayes_example.py` script\n\n```bash\n(parameter-variability) python src/parameter_variability/bayes/bayes_example.py\n```\n\n### Outputs\n\nPlots of results for the analysis on the Gut compartment\n\n*Figure 1*: Sampling random parameters from \"true\" distribution\n\n\u003cimg src=\"img/01-parameter_sampling.png\" alt=\"01-parameter_sampling\" width=\"200\"/\u003e\n\n*Figure 2*: Toy Data simulated using values from the true distribution\n\n\u003cimg src=\"img/02-simulation_plotting.png\" alt=\"02-simulation_plotting\" width=\"200\"/\u003e\n\n*Figure 3*: Graph representing the Bayesian Model\n\n\u003cimg src=\"img/03-bayesian_model.png\" alt=\"03-bayesian_model\" width=\"200\"/\u003e\n\n*Figure 4*: Trace Plot of the parameters sampled from the Bayesian model\n\n\u003cimg src=\"img/04-trace_plot.png\" alt=\"04-trace_plot\" width=\"200\"/\u003e\n\n*Figure 5*: Proposed simulations sampled from the Bayesian Model\n\n\u003cimg src=\"img/05-bayesian_sample.png\" alt=\"05-bayesian_sample\" width=\"200\"/\u003e\n\n\n# License\n\n* Source Code: [LGPLv3](http://opensource.org/licenses/LGPL-3.0)\n* Documentation: [CC BY-SA 4.0](http://creativecommons.org/licenses/by-sa/4.0/)\n\nThe parameter-variability source is released under both the GPL and LGPL licenses version 2 or later. You may choose which license you choose to use the software under.\n\nThis program is free software: you can redistribute it and/or modify it under\nthe terms of the GNU General Public License or the GNU Lesser General Public\nLicense as published by the Free Software Foundation, either version 2 of the\nLicense, or (at your option) any later version.\n\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY\nWARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A\nPARTICULAR PURPOSE. See the GNU General Public License for more details.\n\n\n# Funding\n\nMatthias König is supported by the Federal Ministry of Education and Research (BMBF, Germany) within the research network Systems Medicine of the Liver (**LiSyM**, grant number 031L0054) and by the German Research Foundation (DFG) within the Research Unit Programme FOR 5151 [QuaLiPerF](https://qualiperf.de) (Quantifying Liver Perfusion-Function Relationship in Complex Resection - A Systems Medicine Approach)\" by grant number 436883643 and by grant number 465194077 (Priority Programme SPP 2311, Subproject SimLivA).\n\n© 2023-2024 Antonio Alvarez and [Matthias König](https://livermetabolism.com)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatthiaskoenig%2Fparameter-variability","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatthiaskoenig%2Fparameter-variability","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatthiaskoenig%2Fparameter-variability/lists"}