petab.problem
PEtab Problem class
Functions
|
Get file name according to proposed convention |
|
Get file name according to proposed convention |
|
Get file name according to proposed convention |
|
Get file name according to proposed convention |
Classes
|
PEtab parameter estimation problem as defined by |
- class petab.problem.Problem(sbml_model: Optional[libsbml.Model] = None, sbml_reader: Optional[libsbml.SBMLReader] = None, sbml_document: Optional[libsbml.SBMLDocument] = None, condition_df: Optional[pandas.core.frame.DataFrame] = None, measurement_df: Optional[pandas.core.frame.DataFrame] = None, parameter_df: Optional[pandas.core.frame.DataFrame] = None, visualization_df: Optional[pandas.core.frame.DataFrame] = None, observable_df: Optional[pandas.core.frame.DataFrame] = None)[source]
Bases:
object
PEtab parameter estimation problem as defined by
SBML model
condition table
measurement table
parameter table
observables table
Optionally it may contain visualization tables.
- condition_df
PEtab condition table
- measurement_df
PEtab measurement table
- parameter_df
PEtab parameter table
- observable_df
PEtab observable table
- visualization_df
PEtab visualization table
- sbml_reader
Stored to keep object alive.
- sbml_document
Stored to keep object alive.
- sbml_model
PEtab SBML model
- _apply_mask(v: List, free: bool = True, fixed: bool = True)[source]
Apply mask of only free or only fixed values.
- Parameters
v – The full vector the mask is to be applied to.
free – Whether to return free parameters, i.e. parameters to estimate.
fixed – Whether to return fixed parameters, i.e. parameters not to estimate.
- Returns
- Return type
The reduced vector with applied mask.
- static from_combine(filename: str) petab.problem.Problem [source]
Read PEtab COMBINE archive (http://co.mbine.org/documents/archive).
See also
petab.create_combine_archive()
.- Parameters
filename – Path to the PEtab-COMBINE archive
- Returns
A
petab.Problem
instance.
- static from_files(sbml_file: Optional[str] = None, condition_file: Optional[str] = None, measurement_file: Optional[Union[str, Iterable[str]]] = None, parameter_file: Optional[Union[str, List[str]]] = None, visualization_files: Optional[Union[str, Iterable[str]]] = None, observable_files: Optional[Union[str, Iterable[str]]] = None) petab.problem.Problem [source]
Factory method to load model and tables from files.
- Parameters
sbml_file – PEtab SBML model
condition_file – PEtab condition table
measurement_file – PEtab measurement table
parameter_file – PEtab parameter table
visualization_files – PEtab visualization tables
observable_files – PEtab observables tables
- static from_folder(folder: str, model_name: Optional[str] = None) petab.problem.Problem [source]
Factory method to use the standard folder structure and file names, i.e.
${model_name}/ +-- experimentalCondition_${model_name}.tsv +-- measurementData_${model_name}.tsv +-- model_${model_name}.xml +-- parameters_${model_name}.tsv
- Parameters
folder – Path to the directory in which the files are located.
model_name – If specified, overrides the model component in the file names. Defaults to the last component of
folder
.
- static from_yaml(yaml_config: Union[Dict, str]) petab.problem.Problem [source]
Factory method to load model and tables as specified by YAML file.
- Parameters
yaml_config – PEtab configuration as dictionary or YAML file name
- get_lb(free: bool = True, fixed: bool = True, scaled: bool = False)[source]
Generic function to get lower parameter bounds.
- Parameters
free – Whether to return free parameters, i.e. parameters to estimate.
fixed – Whether to return fixed parameters, i.e. parameters not to estimate.
scaled – Whether to scale the values according to the parameter scale, or return them on linear scale.
- Returns
- Return type
The lower parameter bounds.
- get_observables(remove: bool = False)[source]
Returns dictionary of observables definitions.
See
petab.assignment_rules_to_dict()
for details.
- get_optimization_to_simulation_parameter_mapping(warn_unmapped: bool = True, scaled_parameters: bool = False, allow_timepoint_specific_numeric_noise_parameters: bool = False)[source]
See get_simulation_to_optimization_parameter_mapping.
- get_sigmas(remove: bool = False)[source]
Return dictionary of observableId => sigma as defined in the SBML model.
This does not include parameter mappings defined in the measurement table.
- get_ub(free: bool = True, fixed: bool = True, scaled: bool = False)[source]
Generic function to get upper parameter bounds.
- Parameters
free – Whether to return free parameters, i.e. parameters to estimate.
fixed – Whether to return fixed parameters, i.e. parameters not to estimate.
scaled – Whether to scale the values according to the parameter scale, or return them on linear scale.
- Returns
- Return type
The upper parameter bounds.
- get_x_ids(free: bool = True, fixed: bool = True)[source]
Generic function to get parameter ids.
- Parameters
free – Whether to return free parameters, i.e. parameters to estimate.
fixed – Whether to return fixed parameters, i.e. parameters not to estimate.
- Returns
- Return type
The parameter IDs.
- get_x_nominal(free: bool = True, fixed: bool = True, scaled: bool = False)[source]
Generic function to get parameter nominal values.
- Parameters
free – Whether to return free parameters, i.e. parameters to estimate.
fixed – Whether to return fixed parameters, i.e. parameters not to estimate.
scaled – Whether to scale the values according to the parameter scale, or return them on linear scale.
- Returns
- Return type
The parameter nominal values.
- property lb: List
Parameter table lower bounds.
- property lb_scaled: List
Parameter table lower bounds with applied parameter scaling
- to_files(sbml_file: Optional[str] = None, condition_file: Optional[str] = None, measurement_file: Optional[str] = None, parameter_file: Optional[str] = None, visualization_file: Optional[str] = None, observable_file: Optional[str] = None, yaml_file: Optional[str] = None, prefix_path: Optional[Union[str, pathlib.Path]] = None, relative_paths: bool = True) None [source]
Write PEtab tables to files for this problem
Writes PEtab files for those entities for which a destination was passed.
NOTE: If this instance was created from multiple measurement or visualization tables, they will be merged and written to a single file.
- Parameters
sbml_file – SBML model destination
condition_file – Condition table destination
measurement_file – Measurement table destination
parameter_file – Parameter table destination
visualization_file – Visualization table destination
observable_file – Observables table destination
yaml_file – YAML file destination
prefix_path – Specify a prefix to all paths, to avoid specifying the prefix for all paths individually. NB: the prefix is added to paths before relative_paths is handled.
relative_paths – whether all paths in the YAML file should be relative to the location of the YAML file. If False, then paths are left unchanged.
- Raises
ValueError – If a destination was provided for a non-existing entity.
- to_files_generic(prefix_path: Union[str, pathlib.Path]) None [source]
Save a PEtab problem to generic file names.
The PEtab problem YAML file is always created. PEtab data files are only created if the PEtab problem contains corresponding data (e.g. a PEtab visualization TSV file is only created if the PEtab problem has one).
- Parameters
prefix_path – Specify a prefix to all paths, to avoid specifying the prefix for all paths individually. NB: the prefix is added to paths before relative_paths is handled downstream in petab.yaml.create_problem_yaml.
- Returns
The path to the PEtab problem YAML file.
- property ub: List
Parameter table upper bounds
- property ub_scaled: List
Parameter table upper bounds with applied parameter scaling
- property x_nominal: List
Parameter table nominal values
- property x_nominal_fixed: List
Parameter table nominal values, for fixed parameters.
- property x_nominal_fixed_scaled: List
Parameter table nominal values with applied parameter scaling, for fixed parameters.
- property x_nominal_free: List
Parameter table nominal values, for free parameters.
- property x_nominal_free_scaled: List
Parameter table nominal values with applied parameter scaling, for free parameters.
- property x_nominal_scaled: List
Parameter table nominal values with applied parameter scaling
- petab.problem.get_default_condition_file_name(model_name: str, folder: str = '')[source]
Get file name according to proposed convention
- petab.problem.get_default_measurement_file_name(model_name: str, folder: str = '')[source]
Get file name according to proposed convention