First steps

This page takes you from an SBML file to Chaste C++ in a few commands. The generated code is designed to live in a Chaste user project.

Generate code from an SBML file

To generate Chaste C++ code from an SBML file:

chaste-sbml my_model.xml --output-dir src/

This reads my_model.xml and writes an ODE system into src/. Add --tests to also emit a placeholder test.

Selecting a model type

The --model-type option selects what kind of Chaste classes to generate:

generic

Generates a Chaste ODE system only (the default).

srn

Also generates a Chaste subcellular reaction network model that wraps the ODE system, for use inside a cell in a cell-based simulation.

cell-cycle

Also generates a Chaste cell-cycle model that wraps the ODE system, driving cell division.

chaste-sbml my_model.xml --model-type srn --output-dir src/

See also

Anatomy of generated code explains the contents of the generated files.

Getting the base classes

The generated code uses (via #include statements) a small set of extra C++ base classes that are shipped with the package, among them:

  • AbstractSbmlOdeSystem.hpp

  • AbstractSbmlCellCycleModel.hpp

  • AbstractSbmlSrnModel.hpp

  • SbmlMath.hpp

See the base classes for what each one does.

Copy these into your project with:

chaste-sbml --copy-base-classes --output-dir src/

See also