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
¶
SEDMLSerializer
¶
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.
serialize_datasets
¶
Serialize sbmlsim.DataSets to libsedml.DataDescription.
Write experiment datasets in SedDocument.
serialize_simulations
¶
Serialize simulations.
Write experiment simulations in SedDocument.
serialize_figures
¶
Serialize sbmlsim.Figures to libsedml.SedFigures.
Write experiment figures in SedDocument.
SEDMLParser
¶
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.
parse_xpath_target
staticmethod
¶
Resolve targets in xpath expression.
Uses a heuristics to figure out the targets.
parse_model
¶
Convert SedModel to AbstractModel.
:param sed_changes: :param source:s :param sed_model: :return:
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 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 information.
parse_report
¶
Parse Report.
:return dictionary of label: dataGenerator.id mapping.
required_data_from_datagenerator
¶
Evaluate a DataGenerator which is required, e.g., the x data of a curve.
data_from_datagenerator
¶
Evaluate DataGenerator with actual data.
Uses results of SimulationExperiment for evaluation.
data_generators_for_task
¶
Get DataGenerators which reference the given task.
get_ordered_subtasks
staticmethod
¶
Ordered list of subtasks for task.