Skip to content

Release notes for sbml2cellml 0.4.0

The conversion of SBML to CellML keeps the amount of a species when its compartment changes, handles formulas as the MathML trees of the model instead of text and sets initial assignments which are NaN. 34 more cases of the SBML test suite and 15 more models of BioModels simulate in libopencor as in roadrunner, and the documentation has a roundtrip example.

Features

  • roundtrip example with the repressilator (BIOMD0000000012) in the documentation: the scripts, the SBML model, its CellML conversion and the SBML model of the roundtrip, and the simulations with roadrunner, libopencor and roadrunner side by side; examples/repressilator_example.py
  • a species in concentration whose compartment changes in time gets a second variable <species>_amount, which the reactions change, and the equation species = amount / compartment: SBML keeps the amount when the size changes, also of a species without reactions and of a constant or boundary species. A compartment which an assignment rule of constants sets (a volume from a body weight) does not change, such models convert as before
  • rateOf of a species in a changing compartment is converted when a rate rule changes the compartment
  • the initial size of a compartment which an assignment rule sets is the value of the rule and not the size attribute
  • an initial assignment which is NaN (NaN, 0 / 0, a formula with a variable which is NaN) sets its variable to NaN; libsbml leaves such assignments, the converter tells them apart from the ones libsbml cannot evaluate, which stay unconverted with a warning
  • new module sbml2cellml.astnodes, the construction of formulas as libsbml ASTs

Changes

  • the formulas of a model stay the ASTs libsbml reads, the reaction terms are built from nodes. The MathML of the converted models keeps the numbers and the nesting of the SBML model, so the CellML of a model may differ from the one of 0.3.5 in equivalent ways (-(2 * r) instead of (-2) * r)
  • the helpers of sbml2cellml.mathml take an AST or, as before, a formula as text
  • an initial assignment without math has no effect and is dropped without the warning that it was not converted
  • python-libsbml>=5.21.2

Fixes

  • the dilution of a concentration by a growing compartment was missing, the concentration was the state and only the reaction terms were divided by the size (28 cases of the SBML test suite)
  • an id which is a symbol of the formula syntax of libsbml (avogadro, pi, NaN, true) was converted as that symbol and not as the variable (cases 01761, 01763)
  • operators with one argument in function definitions did not convert (cases 01490, 01491)
  • a negative number and the negation of a product which starts with a negation are written such that the code libcellml generates compiles: libcellml 0.7.1 generates --2.0*a for -((-2) * a), a decrement in C

Limitations

  • rateOf of a species in a compartment which an assignment or algebraic rule changes is not converted
  • libsbml does not take a number other than 1 as true when it evaluates an initial assignment (piecewise(0, 5, 1), case 01282)
  • names, notes and annotations are not converted yet (#44)
  • the unit check of the libcellml 0.7.1 analyser warns about consistent equations with units which have a multiplier and an exponent, e.g., per minute (cellml/libcellml#1463); the warnings do not make a model invalid
  • libsbml evaluates the rate rule of a variable as its value (sbmlteam/libsbml#491); the converter works around it since 0.3.3
  • events, the delay symbol and coupled algebraic rules are not converted
  • Windows is not supported, the Windows wheels of libcellml 0.7.1 contain ARM64 binaries
  • see the conversion issues in the documentation

Your sbml2cellml team