-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Meaning of Xref
in case 974
#87
Comments
The mathematical meaning of a SpeciesReference is its stoichiometry, so it's the 'stoichiometry' attribute. It's analogous to the 'size' attribute of a compartment, or the 'value' attribute of a Parameter. Like compartments/parameters/etc., any initial assignment or assignment rule will override that 'stoichiometry' attribute (if present). There aren't any in 974, but there should be in other tests. If there's anything in the documentation or the SBML specs that led you astray in your thinking about this, let us know! The concept of giving a species reference an id with the mathematical meaning of 'the stoichiometry' was introduced in SBML L3, so it's possible that some of the language about it still needs to be updated. |
OK. Perhaps I can best express my confusion by asking the following questions. So the stoichiometry of Similarly I could ask: The value of parameter |
I think I see your confusion! You wrote:
This isn't true! The stoichiometry of X in reaction J0 is 1, and given the ID 'Xref'. So, essentially, your subsequent attempt to answer your own question is correct: 'Xref' is a handle to the stoichiometry; nothing is overridden.
The 'speciesReference' itself has a stoichiometry of 1, and an id of 'Xref'. A speciesReference is, in SBML L3, one of five fundamental elements with mathematical meaning, all of which have different default ways of setting their initial values:
Does that help? |
Here's another way to explain it. In once place in the model, we define a parameter Z with a value of 0:
And in another part of the model we define the speciesReference Xref with a value of 1:
And elsewhere, we have an assignment rule that overrides the value of Z with the value of Xref:
However, we could have done the reverse: override the value of Xref with the value of Z:
In the latter case, Xref would now be 0, meaning that the stoichiometry of the reaction was zero, and the reaction would effectively be dropped from the model. |
OK, I understand now. Probably I found using a stoichiometry in an assignmentRule so counterintuitive that I did not get it at first. Perhaps worth considering to put your explanation and examples somewhere in the documentation (ideally using Also, I assume there is no way that libSBML does these substitutions for us/flattens the model, right? (If not: @giordano and @exaexa, then we should think about integrating that in SBML.jl.) |
Great! I'll watch for ways to put this in the docs; perhaps in the .m files in the test suite itself. I'm not sure what you mean by 'does these substitutions'. Do you mean a system where any use of Xref is replaced by a new parameter Xrefref, so only parameters are referenced in math, not speciesReferences? |
@paulflang re SBML.jl -- I see we don't really import the IDs (nor constness) of the SpeciesReferences so this can't work very easily. That can be fixed I'd say. |
@luciansmith : I mean there are ConversionProperties options like "promoteLocalParameters", "expandFunctionDefinitions", "expandInitialAssignments" in libSBML. So I was wondering if there is something like "promoteStoichiometryIds", such that there is a global parameter
to this
when calling SBMLDocument.Convert() (not necessarily in the SBMLDocument itself, but in the Objects that represent it in libSBML). |
I meant just fixing the import of the IDs and constatnesses of the species references. The semantics is completely out of SBML.jl. :] |
@paulflang : OK, I can imagine such a converter, that would convert any initial assignments to a double and just assign that to the 'stoichiometry' attribute, and (as you note) convert any use of Xref into use of it's stoichiometry value instead. However, that wouldn't cover all the use cases; you'd still be left with Xref's being assigned a value in an assignment rule (or algebraic rule), or assigned a rate of change with a rate rule. But it could allow access to a greater variety of models for simulators that otherwise couldn't deal with speciesReference IDs. |
Just filed sbmlteam/libsbml#249 as a translation request; feel free to comment there if you have further requests or just more input. Thanks! |
I have a question on case 974:
Xref
is assigned to multiple variables. But what determines the value ofXref
?The text was updated successfully, but these errors were encountered: