diff --git a/Project.toml b/Project.toml index 890d16cbc98602e5bf7d51bd80e8651e11997383..21335505c450a156a8f264297dbe4109664d4f60 100644 --- a/Project.toml +++ b/Project.toml @@ -30,7 +30,7 @@ MAT = "0.10" MacroTools = "0.5.6" OSQP = "0.6" OrderedCollections = "1.4" -SBML = "0.5" +SBML = "0.6" Tulip = "0.7" julia = "1" diff --git a/src/base/types/SBMLModel.jl b/src/base/types/SBMLModel.jl index f59923bfd225df8cc5b93de90a6ca493161ae8bd..21af29dd56837ab3e3d51c39e74918027d34dc98 100644 --- a/src/base/types/SBMLModel.jl +++ b/src/base/types/SBMLModel.jl @@ -42,7 +42,7 @@ n_metabolites(model::SBMLModel)::Int = length(model.sbml.species) Recreate the stoichiometry matrix from the [`SBMLModel`](@ref). """ function stoichiometry(model::SBMLModel)::SparseMat - _, _, S = SBML.getS(model.sbml) + _, _, S = SBML.stoichiometry_matrix(model.sbml) return S end @@ -53,8 +53,7 @@ Get the lower and upper flux bounds of model [`SBMLModel`](@ref). Throws `Domain case if the SBML contains mismatching units. """ function bounds(model::SBMLModel)::Tuple{SparseVec,SparseVec} - lbu = SBML.getLBs(model.sbml) - ubu = SBML.getUBs(model.sbml) + lbu, ubu = SBML.flux_bounds(model.sbml) unit = lbu[1][2] getvalue = (val, _)::Tuple -> val @@ -83,7 +82,7 @@ balance(model::SBMLModel)::SparseVec = spzeros(n_metabolites(model)) Objective of the [`SBMLModel`](@ref). """ -objective(model::SBMLModel)::SparseVec = SBML.getOCs(model.sbml) +objective(model::SBMLModel)::SparseVec = SBML.flux_objective(model.sbml) """ genes(model::SBMLModel)::Vector{String} @@ -165,13 +164,13 @@ function Base.convert(::Type{SBMLModel}, mm::MetabolicModel) return SBMLModel( SBML.Model( Dict(), # parameters - Dict("" => []), # units - Dict([ + Dict("" => 1), # units + Dict( comp => SBML.Compartment(nothing, nothing, nothing, nothing, nothing, nothing) for comp in compss - ],), - Dict([ + ), + Dict( mid => SBML.Species( nothing, # name _default("", comps[mi]), # compartment @@ -184,8 +183,8 @@ function Base.convert(::Type{SBMLModel}, mm::MetabolicModel) _sbml_export_notes(metabolite_notes(mm, mid)), _sbml_export_annotation(metabolite_annotations(mm, mid)), ) for (mi, mid) in enumerate(mets) - ],), - Dict([ + ), + Dict( rid => SBML.Reaction( Dict([ mets[i] => stoi[i, ri] for @@ -203,15 +202,15 @@ function Base.convert(::Type{SBMLModel}, mm::MetabolicModel) _sbml_export_notes(reaction_notes(mm, rid)), _sbml_export_annotation(reaction_annotations(mm, rid)), ) for (ri, rid) in enumerate(rxns) - ],), - Dict([ + ), + Dict( gid => SBML.GeneProduct( nothing, nothing, _sbml_export_notes(gene_notes(mm, gid)), _sbml_export_annotation(gene_annotations(mm, gid)), ) for gid in genes(mm) - ],), + ), Dict(), # function definitions ), )