Open oxinabox opened 1 month ago
That error looks like it is coming from SBML_jll via SBML.jl
Most bio data is a mess after all
😭 I'm just worried that supporting incorrect models (e.g. by having a discard_units flag) accelerates their proliferation. Imo, the model should be fixed. I cannot access the link tho. Can you send it over again?
This file does load up fine with SBMLImporter.jl, so maybe it is something SBMLImporter supports but SBMLToolkit doesn't?
Hi @oxinabox sorry for the delay, swamped with work. I think you need finer handling than the ODESystemImporter does. Can you try if the following produces the right simulation results?
using SBML, SBMLToolkit, OrdinaryDiffEq
fn = "chassagnole2002.xml"
mdl = readSBML(fn, doc -> begin
set_level_and_version(3, 2, [], [])(doc)
convert_promotelocals_expandfuns(doc)
end)
rs = ReactionSystem(mdl)
odesys = convert(ODESystem, rs)
odesys = structural_simplify(odesys)
tspan = (0.0, 100.0)
prob = ODEProblem(odesys, [], tspan, [])
sol = solve(prob, Tsit5())
What this does is described here. It's kind of like the flag that you suggested, but a bit more general. If this solves your problem, I will update the README accordingly.
I had to add using ModelingToolkit
but incidence matrix looks (from memory) same as what i saw from SBMLImporter.jl
Even once i change tspan to (0.800) Plot looks pretty different to what MEWpy has (cell 29) in https://github.com/BioSystemsUM/MEWpy/blob/master/examples/03-kinetic.ipynb Where as plot from SBMLImporter.jl looked ideantical Biggest difference is there is something that starts at over 120 and then drops expodentially
Plot of that sol
Plot from MEWpy (SBMLImporter near identical but not at fixed timesteps)
Could you try plotting without cglcex
and compare the other species? Reason is that until compartments (and their volumes) are implemented in Catalyst, SBMLToolkit uses and reports only absolute amounts (not concentrations). cglcex
is the only species in a compartment with size not equal to 1. This may distort the plot.
Is your feature request related to a problem? Please describe. I am trying to import a SMBL file. In particular this one
When I do so i get an error:
Now I know that that file is internally consistent enough to be workable. because it works with MEWpy's
load_ODEModel
. Which I suspect just discards unit information.The file quiet likely is a bit messed up. Most bio data is a mess after all
Describe the solution you’d like
I would like a flag to discard units.
readSBML(file, ODESystemImporter; discard_units=true)
Describe alternatives We could instead have flag that controls if bad units gives an error, or warns and then falls back to no units, or silently falls back to no units.