|
From: Sarah K. <ske...@ca...> - 2017-07-10 15:15:07
|
So I think what got decided was:
1. A child object inherits the dimensions of its parent implicitly. This
include listOf children that would not normally be dimensioned.
So assuming the compartment Cell and species A also have dimension '0'
of size n
the speciesReference in the reaction below inherits dimension '0' of
size n without the need to explicitly declare it.
<reaction id="r" reversible="false" fast="false" compartment="Cell">
<arrays:listOfDimensions
xmlns:arrays="http://www.sbml.org/sbml/level3/version1/arrays/version1">
<arrays:dimension arrays:id="d0" arrays:size="n"
arrays:arrayDimension="0"/>
</arrays:listOfDimensions>
<arrays:listOfIndices
xmlns:arrays="http://www.sbml.org/sbml/level3/version1/arrays/version1">
<arrays:index arrays:arrayDimension="0"
arrays:referencedAttribute="compartment">
<math xmlns="http://www.w3.org/1998/Math/MathML">
<ci> d0 </ci>
</math>
</arrays:index>
</arrays:listOfIndices>
<listOfReactants metaid="_msr">
<speciesReference constant="true" species="A"
stoichiometry="1" id="sr1">
<arrays:listOfIndices
xmlns:arrays="http://www.sbml.org/sbml/level3/version1/arrays/version1">
<arrays:index arrays:referencedAttribute="species"
arrays:arrayDimension="0">
<math xmlns="http://www.w3.org/1998/Math/MathML">
<ci> d0 </ci>
</math>
</arrays:index>
</arrays:listOfIndices>
</speciesReference>
and you would expect when flattened to get (assume n = 2)
<reaction id="r_0" reversible="false" fast="false"
compartment="Cell_0">
<listOfReactants metaid="_msr_0">
<speciesReference constant="true" species="A_0"
stoichiometry="1" id="sr1_0">
</speciesReference>
...
<reaction id="r_1" reversible="false" fast="false"
compartment="Cell_1">
<listOfReactants metaid="_msr_1">
<speciesReference constant="true" species="A_1"
stoichiometry="1" id="sr1_1">
</speciesReference>
...
2. If any child object adds dimensions of its own then it MUST also
declare the inherited dimensions from the parent.
So my species reference claims to have two dimensions in the one
dimension reaction so has to redeclare the dimension d0 that it inherits
and then add another
<reaction id="r" reversible="false" fast="false" compartment="Cell">
<arrays:listOfDimensions
xmlns:arrays="http://www.sbml.org/sbml/level3/version1/arrays/version1">
<arrays:dimension arrays:id="d0" arrays:size="n"
arrays:arrayDimension="0"/>
</arrays:listOfDimensions>
<arrays:listOfIndices
xmlns:arrays="http://www.sbml.org/sbml/level3/version1/arrays/version1">
<arrays:index arrays:arrayDimension="0"
arrays:referencedAttribute="compartment">
<math xmlns="http://www.w3.org/1998/Math/MathML">
<ci> d0 </ci>
</math>
</arrays:index>
</arrays:listOfIndices>
<listOfReactants metaid="_msr">
<speciesReference constant="true" species="A"
stoichiometry="1" id="sr1">
<arrays:listOfDimensions
xmlns:arrays="http://www.sbml.org/sbml/level3/version1/arrays/version1">
<arrays:dimension arrays:id="d0" arrays:size="n"
arrays:arrayDimension="0"/>
<arrays:dimension arrays:id="d1" arrays:size="n"
arrays:arrayDimension="1"/>
</arrays:listOfDimensions>
<arrays:listOfIndices
xmlns:arrays="http://www.sbml.org/sbml/level3/version1/arrays/version1">
<arrays:index arrays:referencedAttribute="species"
arrays:arrayDimension="0">
<math xmlns="http://www.w3.org/1998/Math/MathML">
<ci> d0 </ci>
</math>
</arrays:index>
<arrays:index arrays:referencedAttribute="id"
arrays:arrayDimension="1">
<math xmlns="http://www.w3.org/1998/Math/MathML">
<ci> d1 </ci>
</math>
</arrays:index>
</arrays:listOfIndices>
</speciesReference>
and you would expect when flattened to get (assume n = 2) I think ????
<reaction id="r_0" reversible="false" fast="false"
compartment="Cell_0">
<listOfReactants metaid="_msr_0">
<speciesReference constant="true" species="A_0"
stoichiometry="1" id="sr1_0_0">
<speciesReference constant="true" species="A_0"
stoichiometry="1" id="sr1_0_1">
</speciesReference>
...
<reaction id="r_1" reversible="false" fast="false"
compartment="Cell_1">
<listOfReactants metaid="_msr_1">
<speciesReference constant="true" species="A_1"
stoichiometry="1" id="sr1_1_0">
<speciesReference constant="true" species="A_1"
stoichiometry="1" id="sr1_1_1">
</speciesReference>
...
Before I change my flattening code any more it would be great if someone
would confirm my recollection and my interpretation :-)
Sarah
|