amici.petab.conditions

PEtab conditions to AMICI ExpDatas.

Functions

create_edata_for_condition(condition, ...)

Get amici.amici.ExpData for the given PEtab condition.

create_edatas(amici_model, petab_problem[, ...])

Create list of amici.amici.ExpData objects for PEtab problem.

create_parameterized_edatas(amici_model, ...)

Create list of :class:amici.ExpData objects with parameters filled in.

fill_in_parameters(edatas, ...[, warn_unused])

Fill fixed and dynamic parameters into the edatas (in-place).

fill_in_parameters_for_condition(edata, ...)

Fill fixed and dynamic parameters into the edata for condition (in-place).

amici.petab.conditions.create_edata_for_condition(condition, measurement_df, amici_model, petab_problem, observable_ids)[source]

Get amici.amici.ExpData for the given PEtab condition.

Sets timepoints, observed data and sigmas.

Parameters:
Return type:

amici.amici.ExpData

Returns:

ExpData instance.

amici.petab.conditions.create_edatas(amici_model, petab_problem, simulation_conditions=None)[source]

Create list of amici.amici.ExpData objects for PEtab problem.

Parameters:
Return type:

list[amici.amici.ExpData]

Returns:

List with one amici.amici.ExpData per simulation condition, with filled in timepoints and data, but without parameter values (see create_parameterized_edatas() or fill_in_parameters() for that).

amici.petab.conditions.create_parameterized_edatas(amici_model, petab_problem, problem_parameters, scaled_parameters=False, parameter_mapping=None, simulation_conditions=None, warn_unused=True)[source]

Create list of :class:amici.ExpData objects with parameters filled in.

Parameters:
  • amici_model (typing.Union[amici.amici.Model, amici.amici.ModelPtr]) – AMICI Model assumed to be compatible with petab_problem.

  • petab_problem (petab.v1.problem.Problem) – PEtab problem to work on.

  • problem_parameters (dict[str, numbers.Number]) – Run simulation with these parameters. If None, PEtab nominalValues will be used. To be provided as dict, mapping PEtab problem parameters to SBML IDs.

  • scaled_parameters (bool) – If True, problem_parameters are assumed to be on the scale provided in the PEtab parameter table and will be unscaled. If False, they are assumed to be in linear scale.

  • parameter_mapping (amici.petab.parameter_mapping.ParameterMapping) – Optional precomputed PEtab parameter mapping for efficiency, as generated by create_parameter_mapping().

  • simulation_conditions (pandas.core.frame.DataFrame | dict) – Result of petab.get_simulation_conditions(). Can be provided to save time if this has been obtained before.

  • warn_unused (bool) – Whether a warning should be emitted if not all problem parameters were used. I.e., if there are parameters in problem_parameters that are not in parameter_mapping or in the generated parameter mapping.

Return type:

list[amici.amici.ExpData]

Returns:

List with one amici.amici.ExpData per simulation condition, with filled in timepoints, data and parameters.

amici.petab.conditions.fill_in_parameters(edatas, problem_parameters, scaled_parameters, parameter_mapping, amici_model, warn_unused=True)[source]

Fill fixed and dynamic parameters into the edatas (in-place).

Parameters:
  • edatas (list[amici.amici.ExpData]) – List of experimental datas amici.amici.ExpData with everything except parameters filled.

  • problem_parameters (dict[str, numbers.Number]) – Problem parameters as parameterId=>value dict. Only parameters included here will be set. Remaining parameters will be used as currently set in amici_model.

  • scaled_parameters (bool) – If True, problem_parameters are assumed to be on the scale provided in the parameter mapping. If False, they are assumed to be in linear scale.

  • parameter_mapping (amici.petab.parameter_mapping.ParameterMapping) – Parameter mapping for all conditions.

  • amici_model (typing.Union[amici.amici.Model, amici.amici.ModelPtr]) – AMICI model.

  • warn_unused (bool) – Whether a warning should be emitted if not all problem parameters were used. I.e., if there are parameters in problem_parameters that are not in parameter_mapping.

Return type:

None

amici.petab.conditions.fill_in_parameters_for_condition(edata, problem_parameters, scaled_parameters, parameter_mapping, amici_model)[source]

Fill fixed and dynamic parameters into the edata for condition (in-place).

Parameters:
Return type:

None