amici.petab_objective

PEtab Objective

Functionality related to running simulations or evaluating the objective function as defined by a PEtab problem

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_parameter_mapping(petab_problem, ...)

Generate AMICI specific parameter mapping.

create_parameter_mapping_for_condition(...)

Generate AMICI specific parameter mapping for condition.

create_parameterized_edatas(amici_model, ...)

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

rdatas_to_measurement_df(rdatas, model, ...)

Create a measurement dataframe in the PEtab format from the passed rdatas and own information.

rdatas_to_simulation_df(rdatas, model, ...)

Create a PEtab simulation dataframe from amici.amici.ReturnData s.

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

Simulate PEtab model.

amici.petab_objective.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.swig_wrappers.ExpData

Returns

ExpData instance.

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

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

Parameters
Return type

typing.List[amici.swig_wrappers.ExpData]

Returns

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

amici.petab_objective.create_parameter_mapping(petab_problem, simulation_conditions, scaled_parameters, amici_model, **parameter_mapping_kwargs)[source]

Generate AMICI specific parameter mapping.

Parameters
Return type

amici.parameter_mapping.ParameterMapping

Returns

List of the parameter mappings.

amici.petab_objective.create_parameter_mapping_for_condition(parameter_mapping_for_condition, condition, petab_problem, amici_model)[source]

Generate AMICI specific parameter mapping for condition.

Parameters
Return type

amici.parameter_mapping.ParameterMappingForCondition

Returns

The parameter and parameter scale mappings, for fixed preequilibration, fixed simulation, and variable simulation parameters, and then the respective scalings.

amici.petab_objective.create_parameterized_edatas(amici_model, petab_problem, problem_parameters, scaled_parameters=False, parameter_mapping=None, simulation_conditions=None)[source]

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

Parameters
Return type

typing.List[amici.swig_wrappers.ExpData]

Returns

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

amici.petab_objective.rdatas_to_measurement_df(rdatas, model, measurement_df)[source]

Create a measurement dataframe in the PEtab format from the passed rdatas and own information.

Parameters
Return type

pandas.core.frame.DataFrame

Returns

A dataframe built from the rdatas in the format of measurement_df.

amici.petab_objective.rdatas_to_simulation_df(rdatas, model, measurement_df)[source]

Create a PEtab simulation dataframe from amici.amici.ReturnData s.

See rdatas_to_measurement_df() for details, only that model outputs will appear in column simulation instead of measurement.

Return type

pandas.core.frame.DataFrame

amici.petab_objective.simulate_petab(petab_problem, amici_model, solver=None, problem_parameters=None, simulation_conditions=None, edatas=None, parameter_mapping=None, scaled_parameters=False, log_level=30, num_threads=1, failfast=True)[source]

Simulate PEtab model.

Parameters
Return type

typing.Dict[str, typing.Any]

Returns

Dictionary of

corresponding to the different simulation conditions. For ordering of simulation conditions, see petab.Problem.get_simulation_conditions_from_measurement_df().