amici.petab.import_helpers

General helper functions for PEtab import.

Functions for PEtab import that are independent of the model format.

Functions

check_model(amici_model, petab_problem)

Check that the model is consistent with the PEtab problem.

get_fixed_parameters(petab_problem[, ...])

Determine, set and return fixed model parameters.

get_observation_model(observable_df)

Get observables, sigmas, and noise distributions from PEtab observation table in a format suitable for amici.sbml_import.SbmlImporter.sbml2amici().

petab_noise_distributions_to_amici(observable_df)

Map from the petab to the amici format of noise distribution identifiers.

petab_scale_to_amici_scale(scale_str)

Convert PEtab parameter scaling string to AMICI scaling integer

amici.petab.import_helpers.check_model(amici_model, petab_problem)[source]

Check that the model is consistent with the PEtab problem.

Return type:

None

amici.petab.import_helpers.get_fixed_parameters(petab_problem, non_estimated_parameters_as_constants=True)[source]

Determine, set and return fixed model parameters.

Non-estimated parameters and parameters specified in the condition table are turned into constants (unless they are overridden). Only global SBML parameters are considered. Local parameters are ignored.

Parameters:
  • petab_problem (petab.problem.Problem) – The PEtab problem instance

  • non_estimated_parameters_as_constants – Whether parameters marked as non-estimated in PEtab should be considered constant in AMICI. Setting this to True will reduce model size and simulation times. If sensitivities with respect to those parameters are required, this should be set to False.

Return type:

list[str]

Returns:

list of IDs of parameters which are to be considered constant.

amici.petab.import_helpers.get_observation_model(observable_df)[source]

Get observables, sigmas, and noise distributions from PEtab observation table in a format suitable for amici.sbml_import.SbmlImporter.sbml2amici().

Parameters:

observable_df (pandas.core.frame.DataFrame) – PEtab observables table

Return type:

tuple[dict[str, dict[str, str]], dict[str, str], dict[str, typing.Union[str, float]]]

Returns:

Tuple of dicts with observables, noise distributions, and sigmas.

amici.petab.import_helpers.petab_noise_distributions_to_amici(observable_df)[source]

Map from the petab to the amici format of noise distribution identifiers.

Parameters:

observable_df (pandas.core.frame.DataFrame) – PEtab observable table

Return type:

dict[str, str]

Returns:

dictionary of observable_id => AMICI noise-distributions

amici.petab.import_helpers.petab_scale_to_amici_scale(scale_str)[source]

Convert PEtab parameter scaling string to AMICI scaling integer

Return type:

int