ModelPolisher icon indicating copy to clipboard operation
ModelPolisher copied to clipboard

MP introduces (or: reveals) cobrapy validation errors on kinetic laws

Open Schmoho opened this issue 1 year ago • 0 comments

The issue can be observed on this model: https://www.ebi.ac.uk/biomodels/MODEL1604280030

After application of the polisher the cobrapy validator gives this SBML_ERROR:

"E0 (Error): MathML consistency (core, L40425); A ci element in this context must refer to a model component; Outside of a functionDefinition, if a ci element is not the first element within a MathML apply, then the ci's value can only be chosen from the set of identifiers of (in L2V1) species, compartment, or parameter objects; (in L2V2-L2V5), species, compartment, parameter or reaction objects; (in L3V1) species, compartment, parameter, reaction or speciesReference objects and (in L3V2) species, compartment, parameter, reaction, speciesReference objects or L3 package objects with defined mathematical meaning. Reference: L3V1 Section 3.4.3 The formula 'FLUX_VALUE' in the math element of the kineticLaw uses 'FLUX_VALUE' that is not the id of a species/compartment/parameter/reaction/speciesReference."

In the following are the unpolished and polished versions. As far as I can tell, the only difference is that the whitespace on the element in the kinetic law has been removed by the polisher (most likely by JSBML, since I don't think we actually touch kinetic laws at all).

The question is whether we should consider this a bug (@draeger):

This is the unpolished original version:

<reaction metaid="meta_r498-AORYZAE-R09748" sboTerm="SBO:0000176" id="r498AORYZAER09748" reversible="true" fast="false" compartment="cytosol">
    <annotation>
     [...]
    </annotation>
    <listOfReactants>
      <speciesReference species="C00004" stoichiometry="1" constant="true"/>
      <speciesReference species="C00016" stoichiometry="1" constant="true"/>
    </listOfReactants>
    <listOfProducts>
      <speciesReference species="C01352" stoichiometry="1" constant="true"/>
      <speciesReference species="C00003" stoichiometry="1" constant="true"/>
    </listOfProducts>
    <kineticLaw>
      <math xmlns="http://www.w3.org/1998/Math/MathML">
        <ci> FLUX_VALUE </ci>
      </math>
      <listOfLocalParameters>
        <localParameter id="LOWER_BOUND" value="0"/>
        <localParameter id="UPPER_BOUND" value="0"/>
        <localParameter id="OBJECTIVE_COEFFICIENT" value="0"/>
      </listOfLocalParameters>
    </kineticLaw>
  </reaction>

this is the polished version:

<reaction compartment="cytosol" fast="false" id="r498AORYZAER09748" metaid="meta_r498-AORYZAE-R09748" reversible="true" sboTerm="SBO:0000176">
        <annotation>
          [...]
        </annotation>
        <listOfReactants>
          <speciesReference constant="true" sboTerm="SBO:0000010" species="C00004" stoichiometry="1" />
          <speciesReference constant="true" sboTerm="SBO:0000010" species="C00016" stoichiometry="1" />
        </listOfReactants>
        <listOfProducts>
          <speciesReference constant="true" sboTerm="SBO:0000011" species="C01352" stoichiometry="1" />
          <speciesReference constant="true" sboTerm="SBO:0000011" species="C00003" stoichiometry="1" />
        </listOfProducts>
        <kineticLaw>
          <math xmlns="http://www.w3.org/1998/Math/MathML">
            <ci>FLUX_VALUE</ci>
          </math>
          <listOfLocalParameters>
            <localParameter id="LOWER_BOUND" value="0" />
            <localParameter id="UPPER_BOUND" value="0" />
            <localParameter id="OBJECTIVE_COEFFICIENT" value="0" />
          </listOfLocalParameters>
        </kineticLaw>
      </reaction>

Schmoho avatar Dec 01 '24 13:12 Schmoho