COBRA doesn't write testing SBML model 2

2011-09-29
2013-05-30
  • Mikko Arvas
    Mikko Arvas
    2011-09-29

    Like http://sourceforge.net/projects/opencobra/forums/forum/1228467/topic/4587855 I have aa SBML writing problem. However, as I am novice the problem might be completely trivial.
    I recently installed on Ubuntu 10.04.1 LTS:
    Matlab R2011b
    cobra_2.0.3 (and included SBMLToolbox-4.0.1)

    cobra testAll passes except for testSBML:
    >> testSBML
    Test for readCbModel succeeded
    Error using OutputSBML
    First input must be a valid MATLAB_SBML Structure
    USAGE: OutputSBML(SBMLModel, (filename))

    Error in writeCbModel (line 257)
                OutputSBML(sbmlModel,fileName);

    Error in testSBML (line 92)
    writeCbModel( testModel, 'sbml', 'test_model.sbml');

    TranslateSBML and OutputSBML seem to work:
    >> ec01 = TranslateSBML('Ec_iJR904.xml');
    >> OutputSBML(ec01,'ec01')
    Document written
    >> ec02 = TranslateSBML('ec01.xml');
    >> ec01c = convertSBMLToCobra(ec01)
    >> ec02c = convertSBMLToCobra(ec02)
    >>  = isSameCobraModel(ec01c,ec02c)
    isSame =
         1
    nDiff =
         0
         0
         0
         0
         0
         0
         0
         0
         0
         0
         0
         0
         0
         0
         0
         0
         0
         0
         0
         0
         0
         0
         0
         0

    commonFields =
        'S'
        'c'
        'confidenceScores'
        'genes'
        'grRules'
        'lb'
        'metChEBIID'
        'metCharge'
        'metFormulas'
        'metInChIString'
        'metKEGGID'
        'metNames'
        'metPubChemID'
        'mets'
        'rev'
        'rules'
        'rxnECNumbers'
        'rxnGeneMat'
        'rxnNames'
        'rxnNotes'
        'rxnReferences'
        'rxns'
        'subSystems'
        'ub'

    >>  writeCbModel(ec01c, 'sbml', 'ec03');
    Error using OutputSBML
    First input must be a valid MATLAB_SBML Structure
    USAGE: OutputSBML(SBMLModel, (filename))

    Error in writeCbModel (line 257)
                OutputSBML(sbmlModel,fileName);

    Separate installation of the same SBMLtoolbox works fine and passes its own test.

    Where should I look into?

    Best,
    Mikko

     
  • Daniel Hyduke
    Daniel Hyduke
    2011-10-01

    This was a bug that appeared with libSBML-5.0.x series and SBML Toolbox 4.0.x series.  If you install libSBML-5.1.0-b0 or newer then this problem should disappear.  http://sourceforge.net/projects/sbml/files/libsbml/5.1.0-b0/

    Make sure to remove your old libsbml and OutputSBML.mex* and TranslateSBML.mex*.  I think you might have to compile libsbml on ubuntu to get the matlab bindings with the 5.x series.