amici.petab_import_pysb
PySB-PEtab Import
Import a model in the PySB-adapted petab
(https://github.com/PEtab-dev/PEtab) format into AMICI.
Functions
|
Create SBML dummy model for to use PySB models with PEtab. |
|
Create AMICI model from PySB-PEtab problem |
Classes
|
Representation of a PySB-model-based PEtab problem |
- class amici.petab_import_pysb.PysbPetabProblem(pysb_model=None, *args, **kwargs)[source]
Representation of a PySB-model-based PEtab problem
This class extends
petab.Problem
with a PySB model. The model is augmented with the observation model based on the PEtab observable table. For now, a dummy SBML model is created which allows used the existing SBML-PEtab API.- Variables
pysb_model – PySB model instance from of this PEtab problem.
- static from_files(condition_file=None, measurement_file=None, parameter_file=None, visualization_files=None, observable_files=None, pysb_model_file=None, flatten=False)[source]
Factory method to load model and tables from files.
- Parameters
condition_file (
typing.Union
[str
,pathlib.Path
,typing.Iterable
[typing.Union
[str
,pathlib.Path
]],None
]) – PEtab condition tablemeasurement_file (
typing.Union
[str
,pathlib.Path
,typing.Iterable
[typing.Union
[str
,pathlib.Path
]],None
]) – PEtab measurement tableparameter_file (
typing.Union
[str
,pathlib.Path
,typing.Iterable
[typing.Union
[str
,pathlib.Path
]],None
]) – PEtab parameter tablevisualization_files (
typing.Union
[str
,pathlib.Path
,typing.Iterable
[typing.Union
[str
,pathlib.Path
]],None
]) – PEtab visualization tablesobservable_files (
typing.Union
[str
,pathlib.Path
,typing.Iterable
[typing.Union
[str
,pathlib.Path
]],None
]) – PEtab observables tablespysb_model_file (
typing.Union
[str
,pathlib.Path
,None
]) – PySB model fileflatten (
bool
) – Flatten the petab problem
- Return type
- Returns
Petab Problem
- static from_yaml(yaml_config, flatten=False)[source]
Factory method to load model and tables as specified by YAML file.
NOTE: The PySB model is currently expected in the YAML file under
sbml_files
.- Parameters
yaml_config (
typing.Union
[typing.Dict
,pathlib.Path
,str
]) – PEtab configuration as dictionary or YAML file nameflatten (
bool
) – Flatten the petab problem
- Return type
- Returns
Petab Problem
- amici.petab_import_pysb.create_dummy_sbml(pysb_model, observable_ids=None)[source]
Create SBML dummy model for to use PySB models with PEtab.
Model must at least contain PEtab problem parameter and noise parameters for observables.
- Parameters
pysb_model (
pysb.core.Model
) – PySB modelobservable_ids (
typing.Optional
[typing.Iterable
[str
]]) – Observable IDs
- Return type
typing.Tuple
[libsbml.Model
,libsbml.SBMLDocument
]- Returns
A dummy SBML model and document.
- amici.petab_import_pysb.import_model_pysb(petab_problem, model_output_dir=None, verbose=True, model_name=None, **kwargs)[source]
Create AMICI model from PySB-PEtab problem
- Parameters
petab_problem (
amici.petab_import_pysb.PysbPetabProblem
) – PySB PEtab problemmodel_output_dir (
typing.Union
[pathlib.Path
,str
,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.model_name (
typing.Optional
[str
]) – Name of the generated model modulekwargs – Additional keyword arguments to be passed to
amici.pysb_import.pysb2amici()
.
- Return type