gillespy2.sbml.SBMLimport.__get_math does not translate rate law expressions correctly. The method needs to only replace the word ln with log rather than replacing ln with log everywhere. Even this will fail in cases where species and parameters have ids that are equal to the names of mathematical functions, whereas SBML can distinguish between these cases.
import gillespy2
# original model which cannot be simulated due to incorrect parsing of the SBML
# `Reason Given: name 'Clog' is not defined`
model = gillespy2.import_SBML('BIOMD0000000297.xml')[0]
results = model.run(solver=gillespy2.ODESolver)
# edited model with different specices names can be simulated (e.g, replaced `ln` in names with `lg`)
# - `Cln` --> `Clg`
# - `kdcln` --> `kdclg`
# - `kscln` --> `ksclg`
model = gillespy2.import_SBML('BIOMD0000000297-edited.xml')[0]
results = model.run(solver=gillespy2.ODESolver)
gillespy2.sbml.SBMLimport.__get_math
does not translate rate law expressions correctly. The method needs to only replace the wordln
withlog
rather than replacingln
withlog
everywhere. Even this will fail in cases where species and parameters have ids that are equal to the names of mathematical functions, whereas SBML can distinguish between these cases.Example using the files in this archive