Repository navigation
Conversation
exportModel writes each character of the model id outside [0-9_a-zA-Z] as __<code>__ and importModel decodes it. cobra passes the id to libSBML unchanged, and libSBML writes no id attribute for an id that is not a valid SId, such as ecoliGEM_v1.0.7. exportModel also writes the protein as fbc:name, the gene short name or else the gene id as fbc:label, and SBO:0000243 on each gene product without a term of its own. importModel reads proteins from fbc:name, so RAVEN read the short name of each gene as its protein.
cobra lists the compartments in the order in which the metabolites first mention them, so export_for_git wrote c, p, e where RAVEN's sortIdentifiers gives c, e, p. export_to_excel sorted them only with sort_ids=True and write_matlab_model never did. The SBML file is sorted after cobra writes it. The yml file was already sorted by cobra.
exportForGit writes MATLAB, libSBML and RAVEN, and the fields of model.modelVersion, which nothing else in RAVEN sets. export_for_git added model_version and model_date, so every release changed the file. model_version_in_dependencies=True writes the two lines.
exportModel writes no model version and no date, and the two notes changed the SBML file of every release. model_version_in_sbml=True writes them.
exportModel writes the model note as a bare paragraph in a body element, and importModel reads a model note only from that shape. cobra wraps its notes in an html element, so importModel found no note in the SBML file of export_for_git. The note is now the first paragraph of a body element, and the other notes follow as key: value paragraphs, which cobra reads. cobra also writes notes without escaping them, so a model note that held &, < or > was dropped from the file and only logged as an error. The notes are written with escaping.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Files of
export_for_gitwere compared with those of RAVEN'sexportForGiton five models and eight differences were found. RAVEN'simportModelnow reads the SBML of yeast-GEM like the file that RAVEN wrote, except for the model creator._for_sbml: cobra passes the model id to libSBML unchanged, and libSBML writes noidattribute for an id that is not a valid SId, such asecoliGEM_v1.0.7, soimportModelread an empty model id._write_sbml: the gene name was written as bothfbc:nameandfbc:labeland the protein as a note, soimportModelread the short name of each gene as its protein, and an unnamed gene gotG_<id>as name and label._for_sbml: gene products had no SBO term, whereexportModelgives eachSBO:0000243.export_to_excel,write_matlab_model,_write_sbml: the compartments came in the order in which the metabolites first mention them (c, p, e), wheresortIdentifiersgives c, e, p.dependencies.txt: it listedmodel_versionandmodel_date, whichexportForGitdoes not write, so every release changed the file.exportModeldoes not write, so every release changed the file.importModelreads a model note only from a body element, so the note was lost on import.&,<or>was dropped from the file and only logged as an error.Each change has a regression test. The keywords
model_version_in_dependenciesandmodel_version_in_sbmlrestore the old output, and the CHANGELOG lists the four changes of behaviour under Breaking changes.