def sbml_to_model(filename):
assert os.path.isfile(filename)
doc = libsbml.readSBMLFromFile(filename)
if doc.getNumErrors(libsbml.LIBSBML_SEV_ERROR) > 0:
print("There were errors while reading, better to fix those first")
doc.printErrors()
sys.exit(1)
model = doc.getModel()
if model is None:
raise ValueError("document has no model, bailing")
return model>>> model = sbml_to_model(filename)
>>> model.getListOfReactions()
<ListOfReactions[0]>>>> doc = libsbml.readSBMLFromFile(filename)
>>> model = doc.getModel()
>>> model.getListOfReactions()
<ListOfReactions[116]>--
You received this message because you are subscribed to the Google Groups "sbml-interoperability" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sbml-interoperab...@googlegroups.com.
To post to this group, send email to sbml-inter...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sbml-interoperability/98d78293-261c-4c75-9d51-f5a1433bd1e0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.