{"id":37774493,"url":"https://github.com/charlesrocabert/gbapy","last_synced_at":"2026-03-03T18:04:04.488Z","repository":{"id":258754498,"uuid":"819414228","full_name":"charlesrocabert/gbapy","owner":"charlesrocabert","description":"Growth Balance Analysis for Python","archived":false,"fork":false,"pushed_at":"2026-02-26T16:56:01.000Z","size":177573,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-26T22:55:10.878Z","etag":null,"topics":["constraint-based-modeling","growth-balance-analysis","metabolic-models","non-linear-optimization","systems-biology"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/gba/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/charlesrocabert.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":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-06-24T13:04:27.000Z","updated_at":"2026-02-26T16:56:06.000Z","dependencies_parsed_at":"2025-02-11T17:24:52.745Z","dependency_job_id":"396f9dfe-ef2b-4465-8f13-34ffb2861fee","html_url":"https://github.com/charlesrocabert/gbapy","commit_stats":null,"previous_names":["charlesrocabert/gbapy"],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/charlesrocabert/gbapy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charlesrocabert%2Fgbapy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charlesrocabert%2Fgbapy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charlesrocabert%2Fgbapy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charlesrocabert%2Fgbapy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/charlesrocabert","download_url":"https://codeload.github.com/charlesrocabert/gbapy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charlesrocabert%2Fgbapy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30054015,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-03T17:46:22.538Z","status":"ssl_error","status_checked_at":"2026-03-03T17:46:22.036Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["constraint-based-modeling","growth-balance-analysis","metabolic-models","non-linear-optimization","systems-biology"],"created_at":"2026-01-16T14:58:05.752Z","updated_at":"2026-03-03T18:04:04.483Z","avatar_url":"https://github.com/charlesrocabert.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/user-attachments/assets/e801eb01-4108-4fe0-a5ef-763002dd583f\" width=250 /\u003e\n\n\u003c/p\u003e\n\u003ch3 align=\"center\"\u003eGrowth Balance Analysis for Python\u003c/h3\u003e\n\n\u003cp align=\"center\"\u003e\n\u003cbr /\u003e\n\u003ca href=\"https://github.com/charlesrocabert/gbapy/releases/latest\"\u003e\u003cimg src=\"https://img.shields.io/github/release/charlesrocabert/gbapy/all.svg\" /\u003e\u003c/a\u003e\u0026nbsp;\n\u003ca href=\"https://badge.fury.io/py/gba\"\u003e\u003cimg src=\"https://badge.fury.io/py/gba.svg\" alt=\"PyPI version\"\u003e\u003c/a\u003e\u0026nbsp;\n\u003ca href=\"https://github.com/charlesrocabert/gbapy/actions\"\u003e\u003cimg src=\"https://github.com/charlesrocabert/gbapy/workflows/Upload Python Package/badge.svg\" /\u003e\u003c/a\u003e\u0026nbsp;\n\u003ca href=\"https://github.com/charlesrocabert/gbapy/LICENSE.html\"\u003e\u003cimg src=\"https://img.shields.io/badge/License-GPLv3-blue.svg\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.cs.hhu.de/en/research-groups/computational-cell-biology\" target=\"_blank\"\u003e\u003cimg src=\"https://github.com/user-attachments/assets/4e4b3b79-0d6a-4328-9c3f-3497401887e4\" width=150 /\u003e\u003c/a\u003e\n  \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\n  \u003ca href=\"https://www.hhu.de/en/\" target=\"_blank\"\u003e\u003cimg src=\"https://github.com/user-attachments/assets/7db5c8f7-e37a-415f-88c3-1b06a49e1f28\" width=150 /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n-----------------\n\n```\npip install gba\n```\n\n\u003cp align=\"justify\"\u003e\n\u003cstrong\u003egbapy\u003c/strong\u003e is a Python package that provides tools for building and analyzing \u003cstrong\u003eself-replicating cell (SRC)\u003c/strong\u003e models based on the \u003cstrong\u003egrowth balance analysis (GBA)\u003c/strong\u003e mathematical formalism (\u003ca href=\"https://doi.org/10.1371/journal.pcbi.1011156\" target=\"_blank\"\u003eDourado et al. 2023\u003c/a\u003e).\n\u003c/p\u003e\n\n### Features\n\n\u003cp align=\"justify\"\u003e\nThe module offers two core components:\n  \n- :wrench: A \u003cstrong\u003ebuilder class\u003c/strong\u003e, to construct SRC models of any size from first principles,\n- :chart_with_upwards_trend: A \u003cstrong\u003emodel class\u003c/strong\u003e, to manipulate and optimize models once they are built.\n\n\u003c/p\u003e\n\n# Typical workflow\n\n\u003cp align=\"center\"\u003e\n\u003cimg width=\"400\" alt=\"image\" src=\"https://github.com/user-attachments/assets/710fecd4-0381-41a2-ae6e-d952eb8c40ad\" /\u003e\n\u003c/p\u003e\n\n```python\nfrom gba import Builder, Model, Protein, Metabolite, Reaction\nfrom gba import SpeciesLocation, ReactionType, ReactionDirection\n\nbuilder = Builder(name=\"toy\")\n\n### Add model information (ODS sheet 'Info')\nbuilder.add_info(category=\"General\", key=\"Name\", content=\"toy\")\nbuilder.add_info(category=\"General\", key=\"Description\", content=\"Toy model\")\n\n### Create and add proteins (one protein per enzyme per reaction)\n### - Masses in Da.\np1 = Protein(id=\"p1\", mass=1000000.0)\np2 = Protein(id=\"p2\", mass=1000000.0)\nbuilder.add_proteins([p1, p2])\n\n### Create and add metabolites:\n### - External and internal glucose\n### - One generic Protein product\n### - Masses in Da.\nx_G     = Metabolite(id=\"x_G\", species_location=SpeciesLocation.EXTERNAL, mass=180.0)\nG       = Metabolite(id=\"G\", species_location=SpeciesLocation.INTERNAL, mass=180.0)\nProtein = Metabolite(id=\"Protein\", species_location=SpeciesLocation.INTERNAL,mass=180.0)\nbuilder.add_metabolites([x_G, G, Protein])\n\n### Create and add transporter to import glucose:\n### - Enzyme is composed of one protein p1\n### - Reaction is irreversible\n### - kcat values in 1/h\n### - KM values in g/L\nrxn1 = Reaction(id=\"rxn1\", lb=0.0, ub=1000.0,\n                reaction_type=ReactionType.TRANSPORT,\n                metabolites={\"x_G\":-1.0, \"G\": 1.0},\n                proteins={\"p1\": 1.0})\nrxn1.add_kcat_value(direction=ReactionDirection.FORWARD, kcat_value=45000.0)\nrxn1.add_km_value(metabolite_id=\"x_G\", km_value=0.00013)\nrxn1.complete(kcat_value=0.0, km_value=0.0)\nbuilder.add_reaction(rxn1)\n\n### Create and add ribosome reaction to produce proteins:\n### - Enzyme is composed of one protein p2\n### - Reaction is irreversible\nribosome = Reaction(id=\"Ribosome\", lb=0.0, ub=1000.0,\n                    reaction_type=ReactionType.METABOLIC,\n                    metabolites={\"G\":-1.0, \"Protein\": 1.0},\n                    proteins={\"p2\": 1.0})\nribosome.add_kcat_value(direction=ReactionDirection.FORWARD, kcat_value=45000.0)\nribosome.add_km_value(metabolite_id=\"G\", km_value=0.00013)\nribosome.complete(kcat_value=0.0, km_value=0.0)\nbuilder.add_reaction(ribosome)\n\n### Convert the model to GBA formalism (cf. Dourado et al. 2023)\nbuilder.convert(ribosome_mass_kcat=4.55, ribosome_mass_km=8.3)\nbuilder.build_GBA_model()\n\n### Set cell's total density (g/L)\nbuilder.set_rho(340.0)\n\n### Create external conditions (in g/L)\nx_G_conc = 1.0\nfor i in range(25):\n    builder.add_condition(condition_id=str(i+1), metabolites={\"x_G\": x_G_conc})\n    x_G_conc *= 2/3\n\n### Save the model to an ODS file\nbuilder.export_to_ods()\n```\n\n\u003cp align=\"center\"\u003e\n\u003cimg width=\"500\" alt=\"image\" src=\"https://github.com/user-attachments/assets/7d0ec598-2fb2-497f-8d89-f15e27e24d43\" /\u003e\n\u003c/p\u003e\n\n```python\nfrom gba import read_ods_model\n\n### Load the ODS model\nmodel = read_ods_model(name=\"toy\")\n\n### Find a valid initial solution\nmodel.find_initial_solution()\n\n### Optimize the model for all conditions\nmodel.find_optimum_by_condition()\n\n### Make a plot\nmodel.plot(x=\"x_G\", y=\"mu\", title=\"Growth rate\", logx=True)\n\n### Export optimization data in CSV\nmodel.export_optimization_data()\n```\n\n\u003cp align=\"center\"\u003e\n\u003cimg width=\"550\" alt=\"image\" src=\"https://github.com/user-attachments/assets/16b7eb56-81d8-429c-b7f8-9aa4cac48de5\" /\u003e\n\u003c/p\u003e\n\n### Reference files\n\n- 🔗 \u003ca href=\"https://github.com/charlesrocabert/gbapy/blob/main/tutorials/my_toy_model.ipynb\" target=\"_blank\"\u003eToy model tutorial\u003c/a\u003e,\n- 🔗 \u003ca href=\"https://github.com/charlesrocabert/gbapy/blob/main/tutorials/toy.ods\" target=\"_blank\"\u003eODS file\u003c/a\u003e,\n- 🔗 \u003ca href=\"https://github.com/charlesrocabert/gbapy/blob/main/tutorials/toy_optimization_data.csv\" target=\"_blank\"\u003eCSV optimization data\u003c/a\u003e.\n\n# Table of contents\n\n- [1) Installation](#installation)\n  - [1.1) Supported platforms](#supported_platforms)\n  - [1.2) Dependencies](#dependencies)\n  - [1.3) Manual installation](#manual_installation)\n- [2) Tutorials](#tutorials)\n- [3) Documentation](#documentation)\n- [4) Contributing](#contributing)\n- [5) Copyright](#copyright)\n- [6) License](#license)\n\n# 1) Installation \u003ca name=\"installation\"\u003e\u003c/a\u003e\n\nThe easiest way to install \u003cstrong\u003egbapy\u003c/strong\u003e is from \u003ca href=\"https://pypi.org/project/gba/\" target=\"_blank\"\u003ePyPI\u003c/a\u003e:\n \n```\npip install gba\n```\n\n\u003e [!IMPORTANT]\n\u003ca href=\"https://github.com/charlesrocabert/gbacpp\" target=\"_blank\"\u003egbacpp\u003c/a\u003e software is required to run optimization tasks.\n\n### 1.1) Supported platforms \u003ca name=\"supported_platforms\"\u003e\u003c/a\u003e\n\u003cstrong\u003egbapy\u003c/strong\u003e has been primilary developed for Unix/Linux and macOS systems.\n\n### 1.2) Dependencies \u003ca name=\"dependencies\"\u003e\u003c/a\u003e\n\n#### • Software\n* \u003ca href=\"https://github.com/charlesrocabert/gbacpp\" target=\"_blank\"\u003egbacpp\u003c/a\u003e is required to run optimization tasks.\n\n#### • Licensed Python modules\n* The Python API of \u003ca href=\"https://www.gurobi.com/\" target=\"_blank\"\u003eGUROBI optimizer\u003c/a\u003e must be installed and requires a user license (\u003ca href=\"https://www.gurobi.com/academia/academic-program-and-licenses/\" target=\"_blank\"\u003efree for academics\u003c/a\u003e).\n\n#### • Other Python modules\n* \u003ca href=\"https://numpy.org/\" target=\"_blank\"\u003eNumPy\u003c/a\u003e\n* \u003ca href=\"https://pandas.pydata.org/\" target=\"_blank\"\u003epandas\u003c/a\u003e\n* \u003ca href=\"https://ipython.org/\" target=\"_blank\"\u003eIPython\u003c/a\u003e\n* \u003ca href=\"https://plotly.com/\" target=\"_blank\"\u003eplotly\u003c/a\u003e\n* \u003ca href=\"https://opencobra.github.io/cobrapy/\" target=\"_blank\"\u003ecobrapy\u003c/a\u003e\n* \u003ca href=\"https://github.com/cgohlke/molmass\" target=\"_blank\"\u003emolmass\u003c/a\u003e\n* \u003ca href=\"https://biopython.org/\" target=\"_blank\"\u003eBiopython\u003c/a\u003e\n\n### 1.3) Manual installation \u003ca name=\"manual_installation\"\u003e\u003c/a\u003e\n\nIf you want to install \u003cstrong\u003egbapy\u003c/strong\u003e manually, download the \u003ca href=\"https://github.com/charlesrocabert/gbapy/releases/latest\"\u003elatest release\u003c/a\u003e, and save it to a directory of your choice. Open a terminal and use the \u003ccode\u003ecd\u003c/code\u003e command to navigate to this directory. Then follow the steps below to compile and build the executables.\n\n```\nsh install.sh\n```\n\n\u003e [!TIP]\n\u003e You can later uninstall the module using \u003ccode\u003esh uninstall.sh\u003c/code\u003e.\n\n# 2) Tutorials \u003ca name=\"tutorials\"\u003e\u003c/a\u003e\n\n\u003cp align=\"center\" style=\"font-size: 2.5em;\"\u003e\nTutorials coming soon ...\n\u003c/p\u003e\n\n# 3) Documentation \u003ca name=\"documentation\"\u003e\u003c/a\u003e\n\n\u003cp align=\"center\" style=\"font-size: 2.5em;\"\u003e\nDocumentation coming soon ...\n\u003c/p\u003e\n\n# 4) Contributing \u003ca name=\"contributing\"\u003e\u003c/a\u003e\n\nIf you wish to contribute, do not hesitate to reach \u003ca href=\"mailto:charles DOT rocabert AT hhu DOT de\"\u003ethe developer\u003c/a\u003e.\n\n# 5) Copyright \u003ca name=\"copyright\"\u003e\u003c/a\u003e\n\nCopyright © 2024-2026 Charles Rocabert, Furkan Mert.\n\n# 6) License \u003ca name=\"license\"\u003e\u003c/a\u003e\n\n\u003cp align=\"justify\"\u003e\nThis program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\n\u003c/p\u003e\n\n\u003cp align=\"justify\"\u003e\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\n\u003c/p\u003e\n\n\u003cp align=\"justify\"\u003e\nYou should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcharlesrocabert%2Fgbapy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcharlesrocabert%2Fgbapy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcharlesrocabert%2Fgbapy/lists"}