Parse and Generate

ParseAndGenerate.ParseAndCreateModel(inputFilePath, jsonFilePath=None, outputFilePath=None, className='SBMLmodel')

This function parses an SBML model file and generates a Python file implementing the model.

Parameters:
  • inputFilePath (str) – Location of the SBML model to be parsed
  • jsonFilePath (str, optional) – If provided, a json file containing the data for each of the model components will be created. If a file exists at the provided location, the file will be overwritten. Otherwise, this functionality is skipped and just a Python file will be generated.
  • outputFilePath (str, optional) – Location where the Python file will be created. If a file exists at the provided location, the file will be overwritten. If a location is not provided, the file path of the generated python file will be based on the inputFilePath
  • className (str, optional) – Name of the class that implements the SBML model.
Returns:

Return type:

None

Warning

This function will overwrite files located at jsonFilePath and outputFilePath

Notes

ParseAndCreateModel is intended to combine most of the functionality provided by this package. The intent is for this function to be suitable for most applications.

SBMLparser.ParseSBMLFile(filePath)
Parameters:filePath (string) – File path of the SBML model to be parsed
Returns:An object containing the model’s components and their properties.
Return type:ModelData
python3ClassGenerator.GenerateModel(modelData, outputFilePath, objectName='SBMLmodel')

This function takes model data, either from ParseSBMLFIle() or imported from a .json file, and generates a Python file containing a class that implements the SBML model.

Parameters:
  • modelData (ModelData) – An object containing all of the model components and values.
  • outputFilePath (str) – The desired file path of the resulting python file.
  • objectName (str) – The name of the class defined in the resulting python file.
Returns:

Return type:

None