CellMLTools plugin

The CellMLTools plugin consists of various CellML-related tools, which can be accessed both through the CLI and the GUI.

CellML file export

A CellML file can be exported to different:

An export can be initiated by selecting the Tools | CellML File Export To menu or by entering the following command:

$ ./OpenCOR -c CellMLTools::export <file> <format>|<language>

with <file> either a local or a remote file and <format>/<language> taking one of the following values:

Thus, to export myfile.cellml to CellML 1.0, you would use:

$ ./OpenCOR -c CellMLTools::export myfile.cellml cellml_1_0

while to export https://mydomain.com/myfile.cellml to Python, you would use:

$ ./OpenCOR -c CellMLTools::export https://mydomain.com/myfile.cellml python

Note #1: the CellML 1.0 export is adapted from Jonathan Cooper’s CellML 1.1 to 1.0 converter and therefore has the same limitations.
Note #2: the export to different languages is done using the CellML API. It should be fine in most cases, but be aware that there may be issues. For instance, in a MATLAB export, if a model defines an ODE as a constant, say \(dX/dt = 0\), then the exporter will export \(0\) as a constant of value 0. Then, due to 0- vs. 1-based indexing, that constant gets computed twice if there are other constants in the model. The end result is that \(dX/dt\) is not equal to 0 but to the value of the other constant.

Validate CellML file

The validation of a CellML file can be done by entering the following command:

$ ./OpenCOR -c CellMLTools::validate myfile.cellml

Both errors and warnings, if any, get listed and an exit code value of 0 means that the CellML file is valid (i.e. no errors were found).