|
From: Chris M. <my...@ec...> - 2017-07-10 17:56:53
|
Yes, I also confirm that is my understanding. I also would like the library to make this invisible to users of arrays. Namely, having getDimensions follow parents when no dimensions are found on a child.
To be absolute sure we are on the same page, I wanted to check my understanding with a slightly different example:
<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">
</speciesReference>
and I 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" 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" stoichiometry="1" id="sr1_1">
</speciesReference>
…
Namely, the SpecieReference id still gets expanded. So, the rule is basically that child Ids get expanded to match parent ID expansions, then if they also have additional dimensions then they get expanded after that. Does this make sense?
Chris
> On Jul 10, 2017, at 10:50 AM, Leandro Watanabe <lea...@gm...> wrote:
>
> I believe that is the case. If we have an agreement, then I can make modifications in JSBML too.
>
> Leandro
>
> On Mon, Jul 10, 2017 at 10:40 AM, Lucian Smith <luc...@gm... <mailto:luc...@gm...>> wrote:
> That is indeed the idea as I understand it, too.
>
> The only additional thing is that it would be nice if a function existed in libsbml and jsbml like 'GetDimensions' that returned the dimensions that applied to that object, whether direct or inherited (or null).
>
> -Lucian
>
>
> On Jul 10, 2017 8:16 AM, "Sarah Keating" <ske...@ca... <mailto:ske...@ca...>> wrote:
> 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 <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 <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 <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 <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 <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 <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 <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 <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 <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 <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 <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 <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
>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot <http://sdm.link/slashdot>
> _______________________________________________
> sbml-arrays mailing list
> sbm...@li... <mailto:sbm...@li...>
> https://lists.sourceforge.net/lists/listinfo/sbml-arrays <https://lists.sourceforge.net/lists/listinfo/sbml-arrays>
>
|