def cellmlStrToSBML (CellMLStr): """Convert a cellml string into the equivalent SBML string: sbmlStr = cellMLStrToSBML('mymodel.cellml') """ if libantimony.loadCellMLFile(CellMLStr) < 0: raise Exception ('Error calling cellMLStrToSBML' + libantimony.getLastError()) return libantimony.getSBMLString (None)
def cellmlFileToSBML (CellMLFileName): """Load a cellml file and return the equivalent SBML string: sbmlStr = cellMLToSBML('mymodel.cellml') """ if libantimony.loadCellMLFile(CellMLFileName) < 0: raise Exception ('Error calling loadCellMLFile'+ libantimony.getLastError()) return libantimony.getSBMLString (None)
def antimonyTosbml (antStr): """Convert an antimony string into SBML: sbmlStr = antimonyTosbml (antimonyStr) """ err = libantimony.loadAntimonyString (antStr) if (err < 0): raise Exception('Antimony: ' + libantimony.getLastError()) Id = libantimony.getMainModuleName() return libantimony.getSBMLString(Id)
def loadAntimonyModel (antStr): """Load an Antimony string: r = loadAntModel (antimonyStr) """ err = libantimony.loadAntimonyString (antStr) if (err < 0): raise Exception('Antimony: ' + libantimony.getLastError()) Id = libantimony.getMainModuleName() sbmlStr = libantimony.getSBMLString(Id) rr = roadrunner.RoadRunner(sbmlStr) return rr