Closed matthiaskoenig closed 6 years ago
Forgot the error message:
Unable to find model 'urn:miriam:biomodels.db:BIOMD0000000012', preventing phraSED-ML from creating accurate SED-ML constructs. Try changing the working directory with 'setWorkingDirectory', or set the model directly with 'setReferencedSBML'.
Traceback (most recent call last):
File "/home/mkoenig/git/tellurium/examples/tellurium-files/phrasedml_scripts/specificationL1V2.py", line 58, in <module>
te.executeInlineOmex(inline_omex)
File "/home/mkoenig/git/tellurium/tellurium/tellurium.py", line 660, in executeInlineOmex
in_omex = teconverters.inlineOmex.fromString(inline_omex)
File "/home/mkoenig/git/tellurium/tellurium/teconverters/inline_omex.py", line 188, in fromString
return inlineOmex(sources)
File "/home/mkoenig/git/tellurium/tellurium/teconverters/inline_omex.py", line 82, in __init__
raise RuntimeError('Unable to convert PhraSEDML to SED-ML: {}'.format(phrasedml.getLastError()))
RuntimeError: Unable to convert PhraSEDML to SED-ML: Unable to find model 'urn:miriam:biomodels.db:BIOMD0000000012', preventing phraSED-ML from creating accurate SED-ML constructs. Try changing the working directory with 'setWorkingDirectory', or set the model directly with 'setReferencedSBML'.
It seems like setting uris is not working anymore with phrasedml via
def setReferencedSBML(URI, sbmlstring):
"""
setReferencedSBML(char const * URI, char const * sbmlstring) -> bool
Allows phrasedml to use the given SBML document as the filename,
instead of looking for the file on disk. If the document is invalid
SBML, 'false' is returned, but the document is still saved.
Parameter 'URI' is the string that, when used in phrasedml, should
reference the 'sbmlstring'. Parameter 'sbmlstring' is the SBML
document string to use when the 'URI' is encountered.
Returns a boolean indicating whether the document is valid SBML or
not. Either way, the document is saved as the reference document for
the given filename string.
"""
return _phrasedml.setReferencedSBML(URI, sbmlstring)
This is a phrasedml issue and opened it there with code to reproduce the issue https://sourceforge.net/p/phrasedml/tickets/24/ This is some major issue, because it does not allow to write phrasedml with external model definitions via urns or links. Unfortunately there is no workaround. Converting to antimony is no solution for me because it is not completely lossless and changes the SBML structure for more complex models (with L3 packages and annotations).
Sorry for this. When I was working on supporting inline OMEX, I made some changes to how pml handles paths which apparently broke this. Fix in phrasedml 1.0.8. Uploading to PyPI now.
The fix I made allows you to use phrasedml's convertString on this example. For executing the inlineOMEX, you need urn:miriam:biomodels.db:BIOMD0000000012
as the name of the file in the archive using the following for your inline omex string:
%model urn:miriam:biomodels.db:BIOMD0000000012
<antimony code goes here>
%tasks sedml.xml --master=True
model1 = model "urn:miriam:biomodels.db:BIOMD0000000012"
<rest of phrasedml>
If you don't actually want the SBML file to be named urn:miriam:biomodels.db:BIOMD0000000012
, we might have to look into ways to support that, because inline OMEX currently requires the file name to match the model name (except possibly for a .xml extension).
This works. Included the fix and tests for it in https://github.com/sys-bio/tellurium/pull/239
Thanks for this.
I often use phrasedml with urns. Before the attached code worked, i.e. setting the model from urn and could run this as an experiment. This does not work anymore and can also not execute the inline_omex consisting of only phrasedml with urn model.