-
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
Support StoichiometryMath #258
Comments
Hi! Just a quick question, I see that SBML actually has 2 different datafields for this: In order not to complicate&break our existing Note to self: Looking at the libsbml sources, we should probably also have the |
(Not sure if relevant, but in the early days I think we decided to only focus on supporting SBML L3V2 and use set_level_and_versions for everything else. Would that not work here?) |
@paulflang yeah good point. Kinda wondering what would the conversion do in this case though, is there any place where the math would get offloaded? |
A check from my part, would set_level_and_versions be able to transform level 2 SBML model with StoichiometryMath to a level 3 model (with the StoichiometryMath correctly handled?) |
Maybe it will be offloaded in an assignmentRule? But I have not tried. |
looks from here https://github.com/sbmlteam/libsbml/blob/1e15d62146d96686f9a321a305b292aa8195cc49/src/sbml/SBMLConvert.cpp#L1120-L1149 like it actually converts stuff to assignmentRules. @sebapersson can you check if this would be OK for you? it should convert the rules as follows:
If there is any problem with the conversion, we could actually implement this quite easily -- there's support for math parsing already, and you can add it to the SpeciesReference parsing as a new field with a bit of copypaste, just as with the 2 fields in the other issue.... |
Thanks a lot, this works well for the case above! I still have to go through the SBML test-suite to see that no problem pops up with the conversion, and if that happens I will reopen the issue. |
OK, thanks for the info! Please feel free to reopen with a testsuite ID in case you find any problems |
Target functionality
In SBML level 2 StoichiometryMath is allowed (should be noted it is not supported for SBML level 3). The code I would like to work is;
Desired output
Here as this reaction has a StoichiometryMath element the return would be (in the form of MathApply):
Optional: Suggestions for implementation
The relevant documentation can be found here https://sbml.org/software/libsbml/5.18.0/docs/formatted/c-api/class_stoichiometry_math__t.html. I am not entirely sure how to add it, but I figure that the best approach would be to allow for
SBML.SpeciesReference.stoichiometry
to be a more advanced math expression in casestoichiometryMath
is present in the model.This is maybe most relevant feature as stoichiometryMath only is supported for level2. However, as our PEtab.jl SBML importer currently supports majority of features for ODE models (except primarily events with delay, events with priority, and species conversion factor see #257), for completness it would be awesome to have this features!
The text was updated successfully, but these errors were encountered: