petab.v2.converters

Conversion of PEtab problems.

Classes

ExperimentsToSbmlConverter(problem[, ...])

Convert PEtab experiments to SBML.

class petab.v2.converters.ExperimentsToSbmlConverter(problem: Problem, default_priority: float = None)[source]

Bases: object

Convert PEtab experiments to SBML.

For an SBML-model-based PEtab problem, this class converts the PEtab experiments to initial assignments and events as far as possible.

If the model already contains events, PEtab events are added with a higher priority than the existing events to guarantee that PEtab condition changes are applied before any pre-existing assignments. This requires that all event priorities in the original model are numeric constants.

The PEtab problem must not contain any identifiers starting with _petab.

All periods and condition changes that are represented by initial assignments or events will be removed from the condition table. Each experiment will have at most one period with a start time of -inf and one period with a finite start time. The associated changes with these periods are only the pre-equilibration indicator (if necessary), and the experiment indicator parameter.

CONDITION_ID_PREEQ_OFF = '_petab_preequilibration_off'

The condition ID of the condition that sets the pre-equilibration indicator to 0.

CONDITION_ID_PREEQ_ON = '_petab_preequilibration_on'

The condition ID of the condition that sets the pre-equilibration indicator to 1.

PREEQ_INDICATOR = '_petab_preequilibration_indicator'
convert() Problem[source]

Convert the PEtab experiments to SBML events.

Returns:

The converted PEtab problem.

static get_experiment_indicator(experiment_id: str) str[source]

The ID of the experiment indicator parameter.

The experiment indicator parameter is used to identify the experiment in the SBML model. It is a parameter that is set to 1 for the current experiment and 0 for all other experiments. The parameter is used in the event trigger to determine whether the event should be triggered.

Parameters:

experiment_id – The ID of the experiment for which to create the experiment indicator parameter ID.