{"id":49526816,"url":"https://github.com/brsynth/rpfba","last_synced_at":"2026-05-02T03:30:44.607Z","repository":{"id":109125255,"uuid":"318533921","full_name":"brsynth/rpFBA","owner":"brsynth","description":"Perform Flux Balance Analysis on a single or collection of SBML files containing heterologous pathways.","archived":false,"fork":false,"pushed_at":"2026-04-14T12:40:58.000Z","size":1470,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-14T14:19:08.277Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brsynth.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,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-12-04T14:03:09.000Z","updated_at":"2026-04-14T12:41:02.000Z","dependencies_parsed_at":"2023-03-22T19:32:07.228Z","dependency_job_id":null,"html_url":"https://github.com/brsynth/rpFBA","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/brsynth/rpFBA","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brsynth%2FrpFBA","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brsynth%2FrpFBA/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brsynth%2FrpFBA/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brsynth%2FrpFBA/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brsynth","download_url":"https://codeload.github.com/brsynth/rpFBA/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brsynth%2FrpFBA/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32522180,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-02T01:12:54.858Z","status":"online","status_checked_at":"2026-05-02T02:00:05.923Z","response_time":132,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2026-05-02T03:30:40.350Z","updated_at":"2026-05-02T03:30:44.597Z","avatar_url":"https://github.com/brsynth.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rpFBA\n\nPerform FBA on a single or collection of SBML files containing heterologous pathways, as tar.xz archives. The package performs the following steps:\n    1) it merges a user defined GEM SBML model to a given heterologous pathway.\n    2) it performs FBA using the [cobrapy](https://opencobra.github.io/cobrapy/) package using a user defined method that includes FBA, parsimonious FBA or fraction of optimum of another reaction. For the first two, the user must know the reaction name that the model will optimise to, while the latter the user must provide the target reaction (default: 'rxn_target') but also another reaction that will be restricted (default: 'biomass'). The first step involves performing FBA using the \"source\" reaction as the objective. Then the flux of that reaction has its upper and lower bounds set to the same value, determined as a fraction of its FBA flux value. Thereafter the objective is set to the initial target reaction and FBA is performed once again. The tool uses the [FBC](https://co.mbine.org/specifications/sbml.level-3.version-1.fbc.version-2.release-1) package to manage the objective and flux bounds.\n\nNOTE: In order to FBA works correctly, some of chemical species have to be ignored. These species are selected according to the following criteria:\n* pathway species has not been found in the model (neither by its ID nor its InChIKey),\n* the species is not the target, and\n* the species is only consumed or produced with the heterologue pathway.\n\n\n## Input\n\nRequired:\n* **pathway_file**: (string) Path to the pathway file (rpSBML)\n* **model_file**: (string) Path to the GEM SBML model\n* **compartment_id**: (string, e.g. cytoplasm) ID of the compartment that contains the chemical species involved in the heterologous pathway\n* **out_file**: (string) Path to the ouput upgraded pathway file\n\nAdvanced options:\n* **--sim**: (string, default='fraction') Valid options include: 'fraction', 'fba', 'pfba'. The type of constraint based modelling method\n* **--objective_rxn_id**: (string, default=rxn_target) Reaction ID to optimise\n* **--biomass_rxn_id**: (string, default='biomass') Biomass reaction ID. Note: Only for 'fraction' simulation\n* **--fraction_of**: (float, default=0.75) Portion of the maximal flux used to set the maximal and minimal bounds for the source reaction of the 'fraction' simulation type\n* **--merge**: (boolean, default=False) Return the merged GEM+heterologous pathway SBML or only the heterologous pathway SBML files\n* **--ignore_orphan_species**: (string, default=True) Ignore metabolites that are only consumed or produced\n\n## Output\n\n* **output**: (string) Path to the output file\n\n\n# Installation Guide\n\n## Overview\n\n`rpthermo` depends on `rplibs`, which depends on `cobra`, which requires `python-libsbml`.  \nOn Apple Silicon (`arm64`) macOS, `python-libsbml` is not available as a native Conda package.\n\nTherefore, installation must be done using an **Intel (`osx-64`) Conda environment under Rosetta**.\n\n---\n\n## General case\n```bash\nconda install -c conda-forge rpthermo\n```\n\n---\n\n## Apple Silicon macOS (M1/M2/M3)\n\n### 1. Install Rosetta 2\n\n```bash\nsoftwareupdate --install-rosetta --agree-to-license\n```\n\n### 2. Install\n\n```bash\nCONDA_SUBDIR=osx-64 conda install -c conda-forge rpfba\n```\n\nOr with mamba:\n\n```bash\nCONDA_SUBDIR=osx-64 mamba install -c conda-forge rpfba\n```\n\n### 3. Persist platform setting\n\n```bash\nconda config --env --set subdir osx-64\n```\n\n### 4. Verify installation\n\n```bash\npython -c \"import rpfba; print('rpfba installed successfully')\"\n```\n\n### 5. (Optional) Dev installation\n\n```bash\nCONDA_SUBDIR=osx-64 conda env create -f environment.yaml\n```\n\n---\n\n## Troubleshooting\n\n### Solver fails on Apple Silicon\n\nMake sure you are using:\n\n```bash\nCONDA_SUBDIR=osx-64\n```\n\n### Wrong architecture environment\n\nCheck:\n\n```bash\nconda config --show subdir\n```\n\nExpected output:\n\n```bash\nsubdir: osx-64\n```\n\n### Run\n\n### rpFBA process\n**From Python code**\n```python\nfrom rptools.rplibs import rpPathway\nfrom rptools.rpfba import runFBA\n\npathway = rpPathway(infile='tests/rpfba/data/sets/measured_3/B.xml')\n\nresults = runFBA(\n    pathway=pathway,\n    gem_sbml_path='tests/rpfba/data/sets/measured_3/e_coli_iJ01366.xml',\n    compartment_id='MNXC3',\n    biomass_rxn_id='biomass',\n    objective_rxn_id='rxn_target',\n    sim_type='fraction',\n    fraction_coeff=0.75,\n    merge=False,\n    ignore_orphan_species=True\n)\n\npathway.get_fba_biomass().get('value')\n0.7638744755010194\npathway.get_fba_biomass()\n{'value': 0.7638744755010194, 'units': 'milimole / gDW / hour'}\n```\n**From CLI**\n```sh\npython -m rptools.rpfba \u003cpathway_rpsbml\u003e \u003cmodel_gem_sbml\u003e \u003ccompartment_id\u003e \u003coutfile\u003e\n```\n\n## Tests\nTest can be run with the following commands:\n\n### Natively\n```bash\ncd tests\npytest -v\n```\n\n## CI/CD\nFor further tests and development tools, a CI toolkit is provided in `ci` folder (see [ci/README.md](ci/README.md)).\n\n\n## Authors\n\n* **Joan Hérisson**\n* **Melchior du Lac**\n\n## Acknowledgments\n\n* Thomas Duigou\n\n\n## Licence\nrpFBA is released under the MIT licence. See the LICENCE file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrsynth%2Frpfba","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrsynth%2Frpfba","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrsynth%2Frpfba/lists"}