RBA logo   Resource Balance Analysis


Main  |  What is RBA  |  Models  |  Software  |  Contact

Overview   -   RBAtools   -   RBApy   -   Downloads

RBApy – a package for building RBA models

RBApy is a Python package for creating and simulating RBA models. It was originally developed for bacteria (Goelzer et al. 2015; Bulović et al. 2019) and has since been extended to eukaryotic cells and to complex environments such as varying temperature, light, or nutrient conditions (Bodeit et al. 2026). Examples are our plant cell model of Arabidopsis thaliana and temperature-dependent models of A. thaliana and E. coli. RBApy generates output files for visualization (Escher maps and Proteomaps). The inputs needed in order to create an RBA model are an annotated metabolic reconstruction in Systems Biology Markup Language (SBML) format and a UniProt organism ID, which is used for automatic download and integration of macromolecular composition data into the model. RBApy supports the proprietary solvers CPLEX and Gurobi as well as the free solvers GLPK and SciPy. RBA models are stored in the XML format RBAml; RBApy 3.0 and later use RBAml 2.0. For installation, see Downloads.

The package is described in these articles: Bulović et al. (2019) and Bodeit et al. (2026). Extensive documentation can be found on GitHub, with subpages on usage (including model construction, simulation, calibration, and requirements about SBML input models), installation, and documentation. Bugs and feature requests can be reported as GitHub issues.

A first example

To build an RBA model from an SBML file and a parameter file (see the usage instructions), and to compute the maximal growth rate of the resulting model, use the commands

generate-rba-model path/to/params.in
solve-rba-model path/to/rba/model

The same simulation in Python:

import rba

model = rba.RbaModel.from_xml("path/to/rba/model")
results = model.solve()
print("Maximal growth rate:", results.mu_opt)

Citing RBApy

If you use RBApy for your research, please cite our articles Bulović A. et al. (2019), Metabolic Engineering, 55, 12-22 and Bodeit O. et al. (2026), Bioinformatics Advances, 6(1): vbag276 (for eukaryotic models and complex environments).