-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Saving StandardModel makes a model in wrong format #62
Comments
Hi! You seem to expect that the "canonical" model format is going to convert itself automatically to JSON, unfortunately that's not the case. You can "fix" this in two ways, first the julia> save_model(model1,"ecoli_core_saved.xxx")
julia> load_model(CM.Model, "ecoli_core_saved.xxx")
AbstractFBCModels.CanonicalModel.Model(
reactions = Dict{String, AbstractFBCModels.CanonicalModel.Reaction}("ACALD" =…
metabolites = Dict{String, AbstractFBCModels.CanonicalModel.Metabolite}("glu_…
genes = Dict{String, AbstractFBCModels.CanonicalModel.Gene}("b4301" => Abstra…
couplings = Dict{String, AbstractFBCModels.CanonicalModel.Coupling}(),
) As the second option, you probably want to do the conversion before saving so that you actually have an interoperable JSON model in the end: julia> save_model(convert(JSONFBCModels.JSONFBCModel, model1), "test.json")
julia> load_model("test.json")
JSONFBCModels.JSONFBCModel(#= 95 reactions, 72 metabolites =#) I think we could add some type argument to do the conversion more easily... perhaps @stelmo opinion welcome |
Converting first works, thanks! |
I'd say so yeah, especially as v1 could save a |
Loading and converting an SBML or JSON model to a
StandardModel
and then saving the model as either SBML or JSON doesn't produce a proper SBML or JSON file.The saved model cannot be opened again.
The text was updated successfully, but these errors were encountered: