amici.petab.sbml_import

Functions

import_model_sbml([sbml_model, ...])

Create AMICI model from PEtab problem

show_model_info(sbml_model)

Log some model quantities

species_to_parameters(species_ids, sbml_model)

Turn a SBML species into parameters and replace species references inside the model instance.

amici.petab.sbml_import.import_model_sbml(sbml_model=None, condition_table=None, observable_table=None, measurement_table=None, petab_problem=None, model_name=None, model_output_dir=None, verbose=True, allow_reinit_fixpar_initcond=True, validate=True, non_estimated_parameters_as_constants=True, output_parameter_defaults=None, discard_sbml_annotations=False, **kwargs)[source]

Create AMICI model from PEtab problem

Parameters:
  • sbml_model (typing.Union[str, pathlib.Path, libsbml.Model]) – PEtab SBML model or SBML file name. Deprecated, pass petab_problem instead.

  • condition_table (typing.Union[str, pathlib.Path, pandas.core.frame.DataFrame, None]) – PEtab condition table. If provided, parameters from there will be turned into AMICI constant parameters (i.e. parameters w.r.t. which no sensitivities will be computed). Deprecated, pass petab_problem instead.

  • observable_table (typing.Union[str, pathlib.Path, pandas.core.frame.DataFrame, None]) – PEtab observable table. Deprecated, pass petab_problem instead.

  • measurement_table (typing.Union[str, pathlib.Path, pandas.core.frame.DataFrame, None]) – PEtab measurement table. Deprecated, pass petab_problem instead.

  • petab_problem (petab.problem.Problem) – PEtab problem.

  • model_name (typing.Optional[str]) – Name of the generated model. If model file name was provided, this defaults to the file name without extension, otherwise the SBML model ID will be used.

  • model_output_dir (typing.Union[str, pathlib.Path, None]) – Directory to write the model code to. Will be created if doesn’t exist. Defaults to current directory.

  • verbose (typing.Union[bool, int, None]) – Print/log extra information.

  • allow_reinit_fixpar_initcond (bool) – See amici.de_export.ODEExporter. Must be enabled if initial states are to be reset after preequilibration.

  • validate (bool) – Whether to validate the PEtab problem

  • 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.

  • output_parameter_defaults (typing.Optional[dict[str, float]]) – Optional default parameter values for output parameters introduced in the PEtab observables table, in particular for placeholder parameters. dictionary mapping parameter IDs to default values.

  • discard_sbml_annotations (bool) – Discard information contained in AMICI SBML annotations (debug).

  • kwargs – Additional keyword arguments to be passed to amici.sbml_import.SbmlImporter.sbml2amici().

Return type:

amici.sbml_import.SbmlImporter

Returns:

The created amici.sbml_import.SbmlImporter instance.

amici.petab.sbml_import.show_model_info(sbml_model)[source]

Log some model quantities

amici.petab.sbml_import.species_to_parameters(species_ids, sbml_model)[source]

Turn a SBML species into parameters and replace species references inside the model instance.

Parameters:
  • species_ids (list[str]) – list of SBML species ID to convert to parameters with the same ID as the replaced species.

  • sbml_model (libsbml.Model) – SBML model to modify

Return type:

list[str]

Returns:

list of IDs of species which have been converted to parameters