biosimulators_tellurium package#

class biosimulators_tellurium.PlottingEngine(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: str, Enum

Engine that tellurium uses for plottting

matplotlib = 'matplotlib'[source]#
plotly = 'plotly'[source]#
class biosimulators_tellurium.PreprocesssedTask(road_runners: dict, solvers: dict, model_change_target_tellurium_id_maps: dict, algorithm_kisao_ids: dict, variable_target_tellurium_observable_maps: dict)[source]#

Bases: object

Processed information about a SED task

road_runners[source]#

Road Runner instances with model, per task

Type:

roadrunner.RoadRunner

solver[source]#

solver, per task

Type:

roadrunner.Integrator or roadrunner.SteadyStateSolver

model_change_target_tellurium_id_map[source]#

dictionaries that map the targets of changes to their corresponding tellurium identifiers (tuples of their type and index within their type), per task

Type:

dict

algorithm_kisao_id[source]#

dictionaries of KiSAO id of algorithm to execute, per task

Type:

str

variable_target_tellurium_observable_maps[source]#

dictionary of dictionaries that map tuples of variable targets and symbols to their corresponding tellurium observable identifiers, per task

Type:

dict

algorithm_kisao_ids: dict[source]#
model_change_target_tellurium_id_maps: dict[source]#
road_runners: dict[source]#
solvers: dict[source]#
variable_target_tellurium_observable_maps: dict[source]#
class biosimulators_tellurium.SedmlInterpreter(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: str, Enum

Code that interprets SED-ML

biosimulators = 'biosimulators'[source]#
tellurium = 'tellurium'[source]#
biosimulators_tellurium.exec_sed_doc(doc, working_dir, base_out_path, rel_out_path=None, apply_xml_model_changes=False, log=None, indent=0, pretty_print_modified_xml_models=False, log_level=StandardOutputErrorCapturerLevel.c, config=None, simulator_config=None)[source]#

Execute the tasks specified in a SED document and generate the specified outputs

Parameters:
  • doc (SedDocument or str) – SED document or a path to SED-ML file which defines a SED document

  • working_dir (str) – working directory of the SED document (path relative to which models are located)

  • base_out_path (str) –

    path to store the outputs

    • CSV: directory in which to save outputs to files {base_out_path}/{rel_out_path}/{report.id}.csv

    • HDF5: directory in which to save a single HDF5 file ({base_out_path}/reports.h5), with reports at keys {rel_out_path}/{report.id} within the HDF5 file

  • rel_out_path (str, optional) – path relative to base_out_path to store the outputs

  • apply_xml_model_changes (bool, optional) – if True, apply any model changes specified in the SED-ML file before calling task_executer.

  • log (SedDocumentLog, optional) – log of the document

  • indent (int, optional) – degree to indent status messages

  • pretty_print_modified_xml_models (bool, optional) – if True, pretty print modified XML models

  • log_level (StandardOutputErrorCapturerLevel, optional) – level at which to log output

  • config (Config, optional) – BioSimulators common configuration

  • simulator_config (SimulatorConfig, optional) – tellurium configuration

Returns:

  • ReportResults: results of each report

  • SedDocumentLog: log of the document

Return type:

tuple

biosimulators_tellurium.exec_sed_task(task, variables, preprocessed_task=None, log=None, config=None, simulator_config=None)[source]#

Execute a task and save its results

Parameters:
  • task (Task) – task

  • variables (list of Variable) – variables that should be recorded

  • preprocessed_task (PreprocessedTask, optional) – preprocessed information about the task, including possible model changes and variables. This can be used to avoid repeatedly executing the same initialization for repeated calls to this method.

  • log (TaskLog, optional) – log for the task

  • config (Config, optional) – BioSimulators common configuration

  • simulator_config (SimulatorConfig, optional) – tellurium configuration

Returns:

VariableResults: results of variables TaskLog: log

Return type:

tuple

Raises:
  • ValueError – if the task or an aspect of the task is not valid, or the requested output variables could not be recorded

  • NotImplementedError – if the task is not of a supported type or involves an unsuported feature

biosimulators_tellurium.exec_sedml_docs_in_combine_archive(archive_filename, out_dir, config=None, simulator_config=None)[source]#

Execute the SED tasks defined in a COMBINE/OMEX archive and save the outputs

Parameters:
  • archive_filename (str) – path to COMBINE/OMEX archive

  • out_dir (str) –

    path to store the outputs of the archive

    • CSV: directory in which to save outputs to files { out_dir }/{ relative-path-to-SED-ML-file-within-archive }/{ report.id }.csv

    • HDF5: directory in which to save a single HDF5 file ({ out_dir }/reports.h5), with reports at keys { relative-path-to-SED-ML-file-within-archive }/{ report.id } within the HDF5 file

  • config (Config, optional) – BioSimulators common configuration

  • simulator_config (SimulatorConfig, optional) – tellurium configuration

Returns:

  • SedDocumentResults: results

  • CombineArchiveLog: log

Return type:

tuple

biosimulators_tellurium.get_simulator_version()[source]#

Get the version of tellurium

Returns:

version

Return type:

str

biosimulators_tellurium.preprocess_sed_task(task, variables, config=None, simulator_config=None)[source]#

Preprocess a SED task, including its possible model changes and variables. This is useful for avoiding repeatedly initializing tasks on repeated calls of exec_sed_task.

Parameters:
  • task (Task) – task

  • variables (list of Variable) – variables that should be recorded

  • config (Config, optional) – BioSimulators common configuration

  • simulator_config (SimulatorConfig, optional) – tellurium configuration

Returns:

preprocessed information about the task

Return type:

PreprocessedTask

Submodules#

biosimulators_tellurium.config module#

Configuration

Author:

Jonathan Karr <karr@mssm.edu>

Date:

2021-01-04

Copyright:

2021, Center for Reproducible Biomedical Modeling

License:

MIT

class biosimulators_tellurium.config.Config[source]#

Bases: object

Configuration

sedml_interpreter[source]#

SED-ML interpreter

Type:

SedmlInterpreter

plotting_engine[source]#

plotting engine

Type:

PlottingEngine

biosimulators_tellurium.core module#

Methods for using tellurium to execute SED tasks in COMBINE/OMEX archives and save their outputs

Author:

Jonathan Karr <karr@mssm.edu>

Date:

2021-01-04

Copyright:

2020-2021, Center for Reproducible Biomedical Modeling

License:

MIT

biosimulators_tellurium.core.exec_sed_doc(doc, working_dir, base_out_path, rel_out_path=None, apply_xml_model_changes=False, log=None, indent=0, pretty_print_modified_xml_models=False, log_level=StandardOutputErrorCapturerLevel.c, config=None, simulator_config=None)[source]#

Execute the tasks specified in a SED document and generate the specified outputs

Parameters:
  • doc (SedDocument or str) – SED document or a path to SED-ML file which defines a SED document

  • working_dir (str) – working directory of the SED document (path relative to which models are located)

  • base_out_path (str) –

    path to store the outputs

    • CSV: directory in which to save outputs to files {base_out_path}/{rel_out_path}/{report.id}.csv

    • HDF5: directory in which to save a single HDF5 file ({base_out_path}/reports.h5), with reports at keys {rel_out_path}/{report.id} within the HDF5 file

  • rel_out_path (str, optional) – path relative to base_out_path to store the outputs

  • apply_xml_model_changes (bool, optional) – if True, apply any model changes specified in the SED-ML file before calling task_executer.

  • log (SedDocumentLog, optional) – log of the document

  • indent (int, optional) – degree to indent status messages

  • pretty_print_modified_xml_models (bool, optional) – if True, pretty print modified XML models

  • log_level (StandardOutputErrorCapturerLevel, optional) – level at which to log output

  • config (Config, optional) – BioSimulators common configuration

  • simulator_config (SimulatorConfig, optional) – tellurium configuration

Returns:

  • ReportResults: results of each report

  • SedDocumentLog: log of the document

Return type:

tuple

biosimulators_tellurium.core.exec_sed_task(task, variables, preprocessed_task=None, log=None, config=None, simulator_config=None)[source]#

Execute a task and save its results

Parameters:
  • task (Task) – task

  • variables (list of Variable) – variables that should be recorded

  • preprocessed_task (PreprocessedTask, optional) – preprocessed information about the task, including possible model changes and variables. This can be used to avoid repeatedly executing the same initialization for repeated calls to this method.

  • log (TaskLog, optional) – log for the task

  • config (Config, optional) – BioSimulators common configuration

  • simulator_config (SimulatorConfig, optional) – tellurium configuration

Returns:

VariableResults: results of variables TaskLog: log

Return type:

tuple

Raises:
  • ValueError – if the task or an aspect of the task is not valid, or the requested output variables could not be recorded

  • NotImplementedError – if the task is not of a supported type or involves an unsuported feature

biosimulators_tellurium.core.exec_sedml_docs_in_combine_archive(archive_filename, out_dir, config=None, simulator_config=None)[source]#

Execute the SED tasks defined in a COMBINE/OMEX archive and save the outputs

Parameters:
  • archive_filename (str) – path to COMBINE/OMEX archive

  • out_dir (str) –

    path to store the outputs of the archive

    • CSV: directory in which to save outputs to files { out_dir }/{ relative-path-to-SED-ML-file-within-archive }/{ report.id }.csv

    • HDF5: directory in which to save a single HDF5 file ({ out_dir }/reports.h5), with reports at keys { relative-path-to-SED-ML-file-within-archive }/{ report.id } within the HDF5 file

  • config (Config, optional) – BioSimulators common configuration

  • simulator_config (SimulatorConfig, optional) – tellurium configuration

Returns:

  • SedDocumentResults: results

  • CombineArchiveLog: log

Return type:

tuple

biosimulators_tellurium.core.preprocess_sed_task(task, variables, config=None, simulator_config=None)[source]#

Preprocess a SED task, including its possible model changes and variables. This is useful for avoiding repeatedly initializing tasks on repeated calls of exec_sed_task.

Parameters:
  • task (Task) – task

  • variables (list of Variable) – variables that should be recorded

  • config (Config, optional) – BioSimulators common configuration

  • simulator_config (SimulatorConfig, optional) – tellurium configuration

Returns:

preprocessed information about the task

Return type:

PreprocessedTask

biosimulators_tellurium.data_model module#

Data model for using tellurium to execute SED-ML documents

Author:

Jonathan Karr <karr@mssm.edu>

Date:

2021-08-23

Copyright:

2021, Center for Reproducible Biomedical Modeling

License:

MIT

class biosimulators_tellurium.data_model.PlottingEngine(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: str, Enum

Engine that tellurium uses for plottting

matplotlib = 'matplotlib'[source]#
plotly = 'plotly'[source]#
class biosimulators_tellurium.data_model.PreprocesssedTask(road_runners: dict, solvers: dict, model_change_target_tellurium_id_maps: dict, algorithm_kisao_ids: dict, variable_target_tellurium_observable_maps: dict)[source]#

Bases: object

Processed information about a SED task

road_runners[source]#

Road Runner instances with model, per task

Type:

roadrunner.RoadRunner

solver[source]#

solver, per task

Type:

roadrunner.Integrator or roadrunner.SteadyStateSolver

model_change_target_tellurium_id_map[source]#

dictionaries that map the targets of changes to their corresponding tellurium identifiers (tuples of their type and index within their type), per task

Type:

dict

algorithm_kisao_id[source]#

dictionaries of KiSAO id of algorithm to execute, per task

Type:

str

variable_target_tellurium_observable_maps[source]#

dictionary of dictionaries that map tuples of variable targets and symbols to their corresponding tellurium observable identifiers, per task

Type:

dict

algorithm_kisao_ids: dict[source]#
model_change_target_tellurium_id_maps: dict[source]#
road_runners: dict[source]#
solvers: dict[source]#
variable_target_tellurium_observable_maps: dict[source]#
class biosimulators_tellurium.data_model.SedmlInterpreter(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: str, Enum

Code that interprets SED-ML

biosimulators = 'biosimulators'[source]#
tellurium = 'tellurium'[source]#