API

Main tellurium entry point.

The module tellurium provides support routines. As part of this module an ExendedRoadRunner class is defined which provides helper methods for model export, plotting or the Jarnac compatibility layer.

tellurium.tellurium.DumpJSONInfo()[source]

Tellurium dist info. Goes into COMBINE archive.

tellurium.tellurium.VersionDict()[source]

Return dict of version strings.

tellurium.tellurium.addFileToCombineArchive(archive_path, file_name, entry_location, file_format, master, out_archive_path)[source]

Add a file to an existing COMBINE archive on disk and save the result as a new archive.

Parameters:
  • archive_path – The path to the archive.
  • file_name – The name of the file to add.
  • entry_location – The location to store the entry in the archive.
  • file_format – The format of the file. Can use tecombine.KnownFormats.lookupFormat for common formats.
  • master – Whether the file should be marked master.
  • out_archive_path – The path to the output archive.
tellurium.tellurium.antimonyToCellML(ant)[source]

Convert Antimony to CellML string.

Parameters:ant (str | file) – Antimony string or file
Returns:CellML
Return type:str
tellurium.tellurium.antimonyToSBML(ant)[source]

Convert Antimony to SBML string.

Parameters:ant (str | file) – Antimony string or file
Returns:SBML
Return type:str
tellurium.tellurium.cellmlToAntimony(cellml)[source]

Convert CellML to antimony string.

Parameters:cellml (str | file) – CellML string or file
Returns:antimony
Return type:str
tellurium.tellurium.cellmlToSBML(cellml)[source]

Convert CellML to SBML string.

Parameters:cellml (str | file) – CellML string or file
Returns:SBML
Return type:str
tellurium.tellurium.colorCycle(color, polyNumber)[source]

Adjusts contents of self.color as needed for plotting methods.

tellurium.tellurium.convertAndExecuteCombineArchive(location)[source]

Read and execute a COMBINE archive.

Parameters:location – Filesystem path to the archive.
tellurium.tellurium.convertCombineArchive(location)[source]

Read a COMBINE archive and convert its contents to an inline Omex.

Parameters:location – Filesystem path to the archive.
tellurium.tellurium.executeInlineOmex(inline_omex)[source]

Execute inline phrasedml and antimony.

Parameters:inline_omex – String containing inline phrasedml and antimony.
tellurium.tellurium.executeInlineOmexFromFile(filepath)[source]

Execute inline OMEX with simulations described in phrasedml and models described in antimony.

Parameters:filepath – Path to file containing inline phrasedml and antimony.
tellurium.tellurium.exportInlineOmex(inline_omex, export_location)[source]

Export an inline OMEX string to a COMBINE archive.

Parameters:
  • inline_omex – String containing inline OMEX describing models and simulations.
  • export_location – Filepath of Combine archive to create.
tellurium.tellurium.extractFileFromCombineArchive(archive_path, entry_location)[source]

Extract a single file from a COMBINE archive and return it as a string.

tellurium.tellurium.getDefaultPlottingEngine()[source]

Get the default plotting engine. Options are ‘matplotlib’ or ‘plotly’. :return:

tellurium.tellurium.getEigenvalues(m)[source]

Eigenvalues of matrix.

Convenience method for computing the eigenvalues of a matrix m Uses numpy eig to compute the eigenvalues.

Parameters:m – numpy array
Returns:numpy array containing eigenvalues
tellurium.tellurium.getLastReport()[source]

Get the last report generated by SED-ML.

tellurium.tellurium.getTelluriumVersion()[source]

Version number of tellurium.

Returns:version
Return type:str
tellurium.tellurium.getTestModel(string)[source]

SBML of given test model as a string.

# load test model as SBML
sbml = te.getTestModel('feedback.xml')
r = te.loadSBMLModel(sbml)
# simulate
r.simulate(0, 100, 20)
Returns:SBML string of test model
tellurium.tellurium.getVersionInfo()[source]

Returns version information for tellurium included packages.

Returns:list of tuples (package, version)
tellurium.tellurium.inIPython()[source]

Checks if tellurium is used in IPython.

Returns true if tellurium is being using in an IPython environment, false otherwise. :return: boolean

tellurium.tellurium.listTestModels()[source]

List roadrunner SBML test models.

print(te.listTestModels())
Returns:list of test model paths
tellurium.tellurium.loadAntimonyModel(ant)[source]

Load Antimony model with tellurium.

See also: loada()

r = te.loadAntimonyModel('S1 -> S2; k1*S1; k1=0.1; S1=10.0; S2 = 0.0')
Parameters:ant (str | file) – Antimony model
Returns:RoadRunner instance with model loaded
Return type:roadrunner.ExtendedRoadRunner
tellurium.tellurium.loadCellMLModel(cellml)[source]

Load CellML model with tellurium.

Parameters:cellml (str | file) – CellML model
Returns:RoadRunner instance with model loaded
Return type:roadrunner.ExtendedRoadRunner
tellurium.tellurium.loadSBMLModel(sbml)[source]

Load SBML model from a string or file.

Parameters:sbml (str | file) – SBML model
Returns:RoadRunner instance with model loaded
Return type:roadrunner.ExtendedRoadRunner
tellurium.tellurium.loadTestModel(string)[source]

Loads particular test model into roadrunner.

rr = te.loadTestModel('feedback.xml')
Returns:RoadRunner instance with test model loaded
tellurium.tellurium.loada(ant)[source]

Load model from Antimony string.

See also: loadAntimonyModel()

r = te.loada('S1 -> S2; k1*S1; k1=0.1; S1=10.0; S2 = 0.0')
Parameters:ant (str | file) – Antimony model
Returns:RoadRunner instance with model loaded
Return type:roadrunner.ExtendedRoadRunner
tellurium.tellurium.loads(ant)[source]

Load SBML model with tellurium

See also: loadSBMLModel()

Parameters:ant (str | file) – SBML model
Returns:RoadRunner instance with model loaded
Return type:roadrunner.ExtendedRoadRunner
tellurium.tellurium.model(model_name)[source]

Retrieve a model which has already been loaded.

Parameters:model_name (str) – the name of the model
tellurium.tellurium.noticesOff()[source]

Switch off the generation of notices to the user. Call this to stop roadrunner from printing warning message to the console.

See also noticesOn()

tellurium.tellurium.noticesOn()[source]

Switch on notice generation to the user.

See also noticesOff()

tellurium.tellurium.plotArray(result, loc='upper right', show=True, resetColorCycle=True, xlabel=None, ylabel=None, title=None, xlim=None, ylim=None, xscale='linear', yscale='linear', grid=False, labels=None, **kwargs)[source]

Plot an array.

The first column of the array must be the x-axis and remaining columns the y-axis. Returns a handle to the plotting object. Note that you can add plotting options as named key values after the array. To add a legend, include the label legend values:

te.plotArray (m, labels=[‘Label 1, ‘Label 2’, etc])

Make sure you include as many labels as there are curves to plot!

Use show=False to add multiple curves. Use color=’red’ to use the same color for every curve.

import numpy as np
result = np.array([[1,2,3], [7.2,6.5,8.8], [9.8, 6.5, 4.3]])
te.plotArray(result, title="My graph', xlim=((0, 5)))
tellurium.tellurium.printVersionInfo()[source]

Prints version information for tellurium included packages.

see also: getVersionInfo()

tellurium.tellurium.sbmlToAntimony(sbml)[source]

Convert SBML to antimony string.

Parameters:sbml (str | file) – SBML string or file
Returns:Antimony
Return type:str
tellurium.tellurium.sbmlToCellML(sbml)[source]

Convert SBML to CellML string.

Parameters:sbml (str | file) – SBML string or file
Returns:CellML
Return type:str
tellurium.tellurium.setDefaultPlottingEngine(engine)[source]

Set the default plotting engine. Overrides current value.

Parameters:engine – A string describing which plotting engine to use. Valid values are ‘matplotlib’ and ‘pyplot’.
tellurium.tellurium.setLastReport(report)[source]

Used by SED-ML to save the last report created (for validation).

tellurium.tellurium.setSavePlotsToPDF(value)[source]

Sets whether plots should be saved to PDF.