opencobra/cobratoolbox — pull request #13 by bheavner (2013-08-06 21:33:32+00:00)
Title: Convert sbml to cobra

I have rewritten the convertSBMLToCobra function, while retaining backwards compatibility with the legacyFlag option (which I have also added to the readCbModel function). This rewrite incorporates the vectorized functions parseSBMLAnnotation, parseSBMLNotesField, and parseBoolean.

It rearranges the COBRA model structure by grouping metabolite and reaction information, and adds the following fields: metCompartment, unparsedMetAnnotations, rxnNotes, compartments, compartmentNames

This rewrite is an incremental step away from the legacy approach of parsing metabolite and reaction names for information that is now encoded in other fields in SBML.

Unlike the older code, this new code successfully imports the following fields:
metCharge, metChEBIID, metKEGGID,, rxnConfidenceScores

I have tested that this code works with the following models: iND750, iAF1260, recon2, and Yeast 6.

This code also modularizes the parsing of notes and annotations in a way that should facilitate future support for the SBML fbc and annotation packages.