Unverified Commit ea39152c authored by Miroslav Kratochvil's avatar Miroslav Kratochvil Committed by GitHub
Browse files

Merge pull request #116 from LCSB-BioCore/mk-stoichiometry-quickfix

quickfix: do not break stoichiometry if 2 species references are present
parents 70778a8c e6681aa3
...@@ -334,11 +334,13 @@ function extractModel(mdl::VPtr)::SBML.Model ...@@ -334,11 +334,13 @@ function extractModel(mdl::VPtr)::SBML.Model
# extract stoichiometry # extract stoichiometry
stoi = Dict{String,Float64}() stoi = Dict{String,Float64}()
add_stoi = add_stoi(sr, factor) = begin
(sr, factor) -> s = get_string(sr, :SpeciesReference_getSpecies)
stoi[get_string(sr, :SpeciesReference_getSpecies)] = stoi[s] =
ccall(sbml(:SpeciesReference_getStoichiometry), Cdouble, (VPtr,), sr) * get(stoi, s, 0) +
factor ccall(sbml(:SpeciesReference_getStoichiometry), Cdouble, (VPtr,), sr) *
factor
end
# reactants and products # reactants and products
for j = 1:ccall(sbml(:Reaction_getNumReactants), Cuint, (VPtr,), re) for j = 1:ccall(sbml(:Reaction_getNumReactants), Cuint, (VPtr,), re)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment