Skip to content
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

Update to SBML 5.16 #1054

Merged
merged 13 commits into from
Dec 12, 2017
Prev Previous commit
Next Next commit
📝 Updated SBML info Note
  • Loading branch information
tpfau committed Nov 30, 2017
commit 1a533f9939a036c53e6d3e31d393efa212183efa
18 changes: 9 additions & 9 deletions docs/source/notes/notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
SBML-FBCv2 update note
----------------------

`The COBRA toolbox` supports reading SBML with FBC-v2 files and writing COBRA-Matlab structures to SBML-FBCv2 files. Two COBRA functions, `io/readCbModel.m` and `io/writeCbModel.m`, were updated in 04/2016 to support the input and output of COBRA models in the SBML-FBCv2 files.
`The COBRA toolbox` fully supports reading SBML level 3 version 1 using the `fbc` package version 2 and the `group` package. The output SBML files are also generated in this format.
Older SBML versions can be imported and COBRA Style `Notes` annotations will be interpreted.

The `io/readCbModel.m` function is dependent on another function `io/utilities/readSBML.m` to use [`libSBML` library](http://sbml.org/Software/libSBML), to parse a SBML-FBCv2 file into a COBRA-Matlab structure. The `io/readCbModel.m` function is backward compatible with older SBML versions. A list of fields of a COBRA structure is described in a Excel spreadsheet `io/COBRA_structure_fields.xlsx`. While some fields are necessary for a COBRA model, others are not.
The function to read a model in sbml format is the same as any other model: `readCbModel`. If the sbml file does not have an `.xml` ending, the format switch needs to be provided. If it is an `xml` file `readCbModel` will automatically detect the format.

The `io/writeCbModel` function relies on another function `io/utilities/writeSBML.m` to convert a COBRA-Matlab structure into a libSBML-Matlab structure and then call `libSBML` to export a FBCv2 file. The current version of the `io/writeSBML.m` does **NOT** require the SBML [toolbox](http://sbml.org/Software/SBMLToolbox).
To write a model in sbml use the `writeCbModel` function.

1. When reading some old COBRA SBML files, there could be some warning messages in the command window, which are probably caused by the lack of some reconstruction information (e.g., metabolite charges) in the SBML files. It is safe to ignore the messages.
2. When exporting a COBRA Matlab structure to an FBC file, it is usually required that the objective coefficient vector (the c field) of the COBRA model structure is not all zeros (i.e., at least one objective function is specified), which is demanded by the FBC extension.
The SBML IO depends on the binaries provided by the [SBML project](http://sbml.org/). As such, new OS versions and new Matlab versions might not be immediately supported.

If an SBML-FBCv2 file is exported from a COBRA Matlab structure without an objective function defined, validation of the SBML-FBCv2 file on [BiGG validator](http://bigg.ucsd.edu/validator/app) may give a warning.
If an SBML-FBCv2 file is exported from a COBRA Matlab structure without an objective function defined (i.e. an all 0 `model.c` vector), validation of the SBML-FBCv2 file on [BiGG validator](http://bigg.ucsd.edu/validator/app) may give a warning.

Solutions to some potential issues with reading/writing FBC files.

1. Ensure there are NO multiple versions of COBRA toolbox on the Matlab path.
2. Currently the latest libSBML 5.13.0 supports FBCv2 extension. Ensure the old versions of libSBML Matlab bindings are NOT on the Matlab path.
3. Validate the problematic FBC file using the [online SBML validator](http://sbml.org/validator/) and [BiGG validator](http://bigg.ucsd.edu/validator/app).
2. Ensure that `which('OutputSBML')` and `which('TranslateSBML')` point to the binaries in the binary folder.
3. Validate the problematic SBML file using the [online SBML validator](http://sbml.org/validator/) and [BiGG validator](http://bigg.ucsd.edu/validator/app).

If none of these troubleshooting steps can help identify the issues with your FBC file, please contact Dr. Ronan Fleming (ronan.mt.fleming@gmail.com)
If none of these troubleshooting steps can help identify the issues with your FBC file, please file your query on the [COBRA group](https://groups.google.com/forum/#!forum/cobra-toolbox).