Skip to content

combine.sedml.parser

SED-ML support for sbmlsim.

This modules parses SED-ML based simulation experiments in the sbmlsim SimulationExperiment format and executes them.

Overview SED-ML

SED-ML is build of the main classes - DataDescription - Model - Simulation - Task - DataGenerator - Output

DataDescription

The DataDescription allows to reference external data, and contains a description on how to access the data, in what format it is, and what subset of data to extract.

Model

The Model class is used to reference the models used in the simulation experiment. SED-ML itself is independent of the model encoding underlying the models. The only requirement is that the model needs to be referenced by using an unambiguous identifier which allows for finding it, for example using a MIRIAM URI. To specify the language in which the model is encoded, a set of predefined language URNs is provided. The SED-ML Change class allows the application of changes to the referenced models, including changes on the XML attributes, e.g. changing the value of an observable, computing the change of a value using mathematics, or general changes on any XML element of the model representation that is addressable by XPath expressions, e.g. substituting a piece of XML by an updated one.

Simulation

The Simulation class defines the simulation settings and the steps taken during simulation. These include the particular type of simulation and the algorithm used for the execution of the simulation; preferably an unambiguous reference to such an algorithm should be given, using a controlled vocabulary, or ontologies. One example for an ontology of simulation algorithms is the Kinetic Simulation Algorithm Ontology KiSAO. Further information encodable in the Simulation class includes the step size, simulation duration, and other simulation-type dependent information.

Task

SED-ML makes use of the notion of a Task class to combine a defined model (from the Model class) and a defined simulation setting (from the Simulation class). A task always holds one reference each. To refer to a specific model and to a specific simulation, the corresponding IDs are used.

DataGenerator

The raw simulation result sometimes does not correspond to the desired output of the simulation, e.g. one might want to normalise a plot before output, or apply post-processing like mean-value calculation. The DataGenerator class allows for the encoding of such post-processings which need to be applied to the simulation result before output. To define data generators, any addressable variable or parameter of any defined model (from instances of the Model class) may be referenced, and new entities might be specified using MathML definitions.

Output

The Output class defines the output of the simulation, in the sense that it specifies what shall be plotted in the output. To do so, an output type is defined, e.g. 2D-plot, 3D-plot or data table, and the according axes or columns are all assigned to one of the formerly specified instances of the DataGenerator class.

For information about SED-ML please refer to http://www.sed-ml.org/ and the SED-ML specification.

SBMLModelTargetType

Bases: Enum

Supported target types in SBML models.

SBMLModelTarget

SBMLModelTarget(selection, target_type)

Target in an SBML model.

Initialize SBMLModelTarget.

sedml_symbol property

sedml_symbol

Get symbol for model target.

sedml_target property

sedml_target

Get xpath target.

sbmlsim_model_targets staticmethod

sbmlsim_model_targets(r)

Model targets which are supported by sbmlsim.

SEDMLSerializer

SEDMLSerializer(
    exp_class,
    working_dir,
    sedml_filename,
    omex_path=None,
    data_path=None,
)

Serialize SimulationExperiment to SED-ML.

Creates the SED-ML and the COMBINE archive containing all models and data for the simulation experiment.

Initialize SED-ML serializer.

datagenerator_id_from_data

datagenerator_id_from_data(data)

Get the data generator id from data.

serialize_datasets

serialize_datasets()

Serialize sbmlsim.DataSets to libsedml.DataDescription.

Write experiment datasets in SedDocument.

serialize_models

serialize_models()

Serialize models.

Write experiment models in SedDocument.

serialize_simulations

serialize_simulations()

Serialize simulations.

Write experiment simulations in SedDocument.

serialize_tasks

serialize_tasks()

Serialize tasks.

Write experiment tasks in SedDocument.

serialize_data

serialize_data()

Serialize data generators.

Write experiment data in SedDocument.

serialize_figures

serialize_figures()

Serialize sbmlsim.Figures to libsedml.SedFigures.

Write experiment figures in SedDocument.

serialize_axis

serialize_axis(axis, sed_axis)

Serialize sbmlsim.Axis to libsedml.SEDAxis.

serialize_style

serialize_style(style, sed_style)

Serialize sbmlsim.Style to libsedml.Style.

SEDMLParser

SEDMLParser(sed_doc, exec_dir, working_dir, name=None)

Parse SED-ML to sbmlsim.SimulationExperiment.

Initialize SED-ML parser from SedDocument.

:param sed_doc: SedDocument :param working_dir: working dir to execute the SED-ML :param name: class name used for the simulation experiment. Must be valid python class name.

print_info

print_info()

Print information.

parse_xpath_target staticmethod

parse_xpath_target(xpath)

Resolve targets in xpath expression.

Uses a heuristics to figure out the targets.

parse_model

parse_model(sed_model, source, sed_changes)

Convert SedModel to AbstractModel.

:param sed_changes: :param source:s :param sed_model: :return:

resolve_model_changes

resolve_model_changes()

Resolve the original model sources and full change lists.

Going through the tree of model upwards until root is reached and collecting changes on the way (example models m* and changes c*) m1 (source) -> m2 (c1, c2) -> m3 (c3, c4) resolves to m1 (source) [] m2 (source) [c1,c2] m3 (source) [c1,c2,c3,c4] The order of changes is important (at least between nodes on different levels of hierarchies), because later changes of derived models could reverse earlier changes.

Uses recursive search strategy, which should be okay as long as the model tree hierarchy is not getting to deep.

parse_change

parse_change(sed_change)

Parse the libsedml.Change.

Currently only a limited subset of model changes is supported. Namely changes of parameters and concentrations within a SedChangeAttribute.

parse_algorithm_parameter

parse_algorithm_parameter(sed_alg_par)

Parse algorithm parameter information.

parse_simulation

parse_simulation(sed_sim)

Parse simulation information.

parse_task

parse_task(sed_task)

Parse arbitrary task (repeated or simple, or simple repeated).

parse_figure

parse_figure(sed_figure)

Parse figure information.

parse_plot2d

parse_plot2d(sed_plot2d)

Parse the libsedml.Plot2D into a sbmlsim.Plot.

parse_plot3d

parse_plot3d(sed_plot3d)

Parse Plot3D.

parse_report

parse_report(sed_report)

Parse Report.

:return dictionary of label: dataGenerator.id mapping.

parse_axis

parse_axis(sed_axis)

Parse axes information.

parse_abstract_curve

parse_abstract_curve(sed_acurve)

Parse abstract curve.

parse_style

parse_style(sed_style)

Parse SED-ML style.

parse_line

parse_line(sed_line)

Parse line information.

parse_marker

parse_marker(sed_marker)

Parse the line information.

parse_fill

parse_fill(sed_fill)

Parse fill information.

required_data_from_datagenerator

required_data_from_datagenerator(sed_dg_ref)

Evaluate a DataGenerator which is required, e.g., the x data of a curve.

data_from_datagenerator

data_from_datagenerator(sed_dg_ref)

Evaluate DataGenerator with actual data.

Uses results of SimulationExperiment for evaluation.

data_generators_for_task

data_generators_for_task(sed_task)

Get DataGenerators which reference the given task.

get_ordered_subtasks staticmethod

get_ordered_subtasks(sed_task)

Ordered list of subtasks for task.