When will sbmlimport support sbml level 3?

Would be useful to know. I believe 2020b only supports level 2, correct?
Has anyone else run into having to use an sblm level 3 model? How do you handle this?
Thanks.

 Réponse acceptée

Arthur Goldsipe
Arthur Goldsipe le 26 Jan 2021

0 votes

SimBiology already supports SBML level 3 version 1. That was introduced in R2016a. You can read more about what is supported here.

11 commentaires

Jim Bosley
Jim Bosley le 1 Fév 2021
Modifié(e) : Jim Bosley le 1 Fév 2021
Arthur,
Thanks. I'm still a little confused. I was prompted to ask the question by the following exchange:
> mc = sbmlimport('SBMLModel.xml')
Error using SimBiology.internal.sbml.read
This version of SBML cannot be read. SimBiology supports the reading of SBML file versions up to Level 2 Version 1.
Error in privatesbmlio
Error in sbmlimport (line 89)
ret = privatesbmlio('read',nargout,{tempFileName})
It could be that my sbml is not conformal. Frank Bergmann and his friends have an online sbml tester that shows some errors. But in any case the error message is confusing.
Best,
Jim
PS: This is in R2020b running on Ubuntu.
Ah, thanks for pointing that out. The error message did not get updated when support was added for SBML level 3. I will put this in our bug tracking system so that we can fix it in an upcoming release.
FWIW, SimBiology reports this error when libSBML returns the error code InvalidSBMLLevelVersion when parsing an SBML file.
Jim Bosley
Jim Bosley le 1 Fév 2021
I thought that must be the issue. So perhaps my sbml file is version 2. I'll go back to the source.
Any idea when version 2 will be implemented?
As always, thanks for the fast, understandable answers Arthur.
Yes, if your file is level 3 version 2, that would explain the issue. I don't think a whole lot changed between version 1 and 2, so you might just try hand-modifying the version to 1 and see what happens (ideally running through the SBML validator to see if that flags anything else). I think another users have managed to do that with some success.
I'll pass along your request to upgrade our support to include level 3 version 2. We haven't hard much about customers needing this, so we've focused our work on things we consider higher priority. But now that we know it would be useful, we can consider this for a future release. Unfortunately, I can't comment here on any specific release data.
Nicolas
Nicolas le 17 Sep 2024
Hello, I would also need to be able to use sbml L3V2 (mainly, in simbiology). One of the main new features of L3V2 is the possibility to use the functions max, min, rem (modulo). Some others functions are also available, but I think that the three mentions previously are quite critical. The reference can be found here https://sbml.org/specifications/sbml-level-3/version-2/core/release-1/sbml-level-3-version-2-core.pdf, section 3.4.1
Thanks !
Arthur Goldsipe
Arthur Goldsipe le 17 Sep 2024
Modifié(e) : Arthur Goldsipe le 20 Sep 2024
[Edit: I was wrong about when max, min, and rem were introduced.]
Nicolas: max, min, and rem were introduced in L3V1, not L3V2. The main change I see in L3V2 is with respect to XML namespaces. So you may still be able to convert your L3V2 files to L3V1 without loss of functionality, so that you can import them into SimBiology.
That said, SimBiology currently preserves MathML operator names when importing SBML models. So you may need to make some manual update to expressions if the MATLAB function has a different name or has a different syntax than the corresponding MathML operator. For example, MathML's arcsin needs to be changed to MATLAB's asin. And MathML's max takes an arbitrary number of scalar inputs, whereas MATLAB's max operates on vectors.
If you run into problems importing a specific SBML file, feel free to post your own question on MATLAB Answers or to reach out to Technical Support.
Nicolas
Nicolas le 20 Sep 2024
Arthur, thanks for your answer.
According to the specifications (see References) min, max and rem are supported by L3V2 but not L3V1.
Manually changing L3V2 to L3V1 in the xml header of the SBML document will produce a document that fails sbml validation. There exist programmatic tools to convert L3V2 documents to L3V1 such as libsbml for instance. Unfortunately, said tool fails the conversion, precisely because of the L3V2 math elements.
This means that in order to import an L3V2 model (that has L3V2 math) in Simbiology, one has to manually modify the math formulas such that they no longer use L3V2 math. This is potentially complex and error-prone. For example, by replacing "max x y" by "if x >= y then x else y".
Thanks for your time !
References:
Oops. My mistake. I was accidentaly looking at L3V2 release 1 instead of L3V1.
I'll make sure your request is noted in SimBiology's enhancement database.
In the interim, you could still probably just change the version number in the file and see if SimBiology imports it correctly. Although it's not strictly valid SBML, I think our importer (which relies on libsbml) is fairly forgiving.
Jim Bosley
Jim Bosley le 20 Sep 2024
Arthur,
Thanks for your answer to my colleague Nicolas' question. In our (or at least my) experience, there was no simple way to translate. The sbml output is not entirely well-formed (for example, last time I checked, about a year ago, it did not list modifiers) so it crashes the translators.
I needed an updated version so (in one weekend) I taught myself Python and wrote an app that did a lot of the checking and correcting. Worked ok, but a modern level of sbml output would not be looked at disparagingly. Plus in my app I wasn't able to encode changing non-complex-differentiable functions into differentiable ones using Complex State Differentiation!
Jim
Good to hear from you, Jim. And sorry we still haven't updated our SBML support.
Regarding complex differentiable functions, are there specific functions that I could add support for? In R2022b, I updated SimBiology to automatically replace min, max, and abs with complex differential equivalents during local sensitivity analysis. I could potentially do this for other MATLAB functions.
Hi Arthur,
Thanks for your note. I went back and looked. I had CSD versions of the modulo and the erf functions.
Not sure why I had the erf function, except to say that there's more than one way to skin a sigmoid. I used the modulo function to get time of day.
clock_time = mod( time, hours_per_day);

Connectez-vous pour commenter.

Plus de réponses (0)

Communautés

Plus de réponses dans  SimBiology Community

Catégories

En savoir plus sur Extend Modeling Environment dans Centre d'aide et File Exchange

Produits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by