This project is a Python code generator that reads an SBML model and emits C++ classes compatible with Chaste, so you can run SBML-defined biology models inside Chaste simulations.
pipx install git+https://github.com/Chaste/chaste-codegen-sbml@developCreate and activate a virtual environment (optional)
python3 -m venv .venv
source .venv/bin/activateInstall the package
python3 -m pip install git+https://github.com/Chaste/chaste-codegen-sbml@developClone the repository
git clone https://github.com/Chaste/chaste-codegen-sbml
cd chaste-codegen-sbmlCreate and activate a virtual environment
python3 -m venv .venv
source .venv/bin/activateInstall in editable mode with development dependencies
python3 -m pip install -e ."[dev]"Run tests
python3 -m pytestchaste-sbml has two subcommands:
usage: chaste-sbml [-h] [--version] command ...
positional arguments:
command
generate Generate Chaste C++ code from an SBML file
copy-base-classes Copy the C++ base classes the generated code depends on
options:
-h, --help show this help message and exit
--version show program's version number and exit
Generate Chaste C++ code from an SBML file:
chaste-sbml generate my_model.xml --model-type srn --output-dir src/usage: chaste-sbml generate [-h] [--output-dir OUTPUT_DIR]
[--model-type [{generic,srn,cell-cycle}]]
sbml_file
positional arguments:
sbml_file The SBML file to convert
options:
--output-dir OUTPUT_DIR
The directory to place output files in
--model-type [{generic,srn,cell-cycle}]
The type of model to generate
The generated code #includes and subclasses a set of C++ base classes (for example
AbstractSbmlOdeSystem). These are shipped with the package; copy them into your project so
they match the installed version of chaste-sbml:
chaste-sbml copy-base-classes --output-dir src/usage: chaste-sbml copy-base-classes [-h] [--output-dir OUTPUT_DIR]
options:
--output-dir OUTPUT_DIR
The directory to place the base classes in