petab.problem¶
PEtab Problem class
Functions
get_default_condition_file_name (model_name, …) |
Get file name according to proposed convention |
get_default_measurement_file_name (…) |
Get file name according to proposed convention |
get_default_parameter_file_name (model_name, …) |
Get file name according to proposed convention |
get_default_sbml_file_name (model_name, folder) |
Get file name according to proposed convention |
Classes
Problem (sbml_model, sbml_reader, …) |
PEtab parameter estimation problem as defined by |
-
class
petab.problem.
Problem
(sbml_model: libsbml.Model = None, sbml_reader: libsbml.SBMLReader = None, sbml_document: libsbml.SBMLDocument = None, condition_df: pandas.core.frame.DataFrame = None, measurement_df: pandas.core.frame.DataFrame = None, parameter_df: pandas.core.frame.DataFrame = None, visualization_df: pandas.core.frame.DataFrame = None, observable_df: pandas.core.frame.DataFrame = None)¶ 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[T], free: bool = True, fixed: bool = True)¶ 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: The reduced vector with applied mask.
Return type: v
-
create_parameter_df
(*args, **kwargs)¶ Create a new PEtab parameter table
See create_parameter_df
-
static
from_combine
(filename: str) → petab.problem.Problem¶ Read PEtab COMBINE archive (http://co.mbine.org/documents/archive).
See also
create_combine_archive
.Parameters: filename – Path to the PEtab-COMBINE archive Returns: A petab.Problem
instance.
-
static
from_files
(sbml_file: str = None, condition_file: str = None, measurement_file: Union[str, Iterable[str]] = None, parameter_file: Union[str, List[str]] = None, visualization_files: Union[str, Iterable[str]] = None, observable_files: Union[str, Iterable[str]] = None) → petab.problem.Problem¶ 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: str = None) → petab.problem.Problem¶ 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[KT, VT], str]) → petab.problem.Problem¶ 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)¶ 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: The lower parameter bounds.
Return type: v
-
get_model_parameters
()¶ See petab.sbml.get_model_parameters
-
get_noise_distributions
()¶ See get_noise_distributions.
-
get_observable_ids
()¶ Returns dictionary of observable ids.
-
get_observables
(remove: bool = False)¶ Returns dictionary of observables definitions. See assignment_rules_to_dict for details.
-
get_optimization_parameter_scales
()¶ Return list of optimization parameter scaling strings.
See
petab.parameters.get_optimization_parameters
.
-
get_optimization_parameters
()¶ Return list of optimization parameter IDs.
See
petab.parameters.get_optimization_parameters
.
-
get_optimization_to_simulation_parameter_mapping
(warn_unmapped: bool = True, scaled_parameters: bool = False)¶ See get_simulation_to_optimization_parameter_mapping.
-
get_sigmas
(remove: bool = False)¶ Return dictionary of observableId => sigma as defined in the SBML model. This does not include parameter mappings defined in the measurement table.
-
get_simulation_conditions_from_measurement_df
()¶ See petab.get_simulation_conditions
-
get_ub
(free: bool = True, fixed: bool = True, scaled: bool = False)¶ 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: The upper parameter bounds.
Return type: v
-
get_x_ids
(free: bool = True, fixed: bool = True)¶ 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: The parameter ids.
Return type: v
-
get_x_nominal
(free: bool = True, fixed: bool = True, scaled: bool = False)¶ 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: The parameter nominal values.
Return type: v
-
lb
¶ Parameter table lower bounds.
-
lb_scaled
¶ Parameter table lower bounds with applied parameter scaling
-
sample_parameter_startpoints
(n_starts: int = 100)¶ Create starting points for optimization
See sample_parameter_startpoints
-
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) → None¶ 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
Raises: ValueError
– If a destination was provided for a non-existingentity.
-
ub
¶ Parameter table upper bounds
-
ub_scaled
¶ Parameter table upper bounds with applied parameter scaling
-
x_fixed_ids
¶ Parameter table parameter IDs, for fixed parameters.
-
x_fixed_indices
¶ Parameter table non-estimated parameter indices.
-
x_free_ids
¶ Parameter table parameter IDs, for free parameters.
-
x_free_indices
¶ Parameter table estimated parameter indices.
-
x_ids
¶ Parameter table parameter IDs
-
x_nominal
¶ Parameter table nominal values
-
x_nominal_fixed
¶ Parameter table nominal values, for fixed parameters.
-
x_nominal_fixed_scaled
¶ Parameter table nominal values with applied parameter scaling, for fixed parameters.
-
x_nominal_free
¶ Parameter table nominal values, for free parameters.
-
x_nominal_free_scaled
¶ Parameter table nominal values with applied parameter scaling, for free parameters.
-
x_nominal_scaled
¶ Parameter table nominal values with applied parameter scaling
-
petab.problem.
get_default_condition_file_name
(model_name: str, folder: str = '')¶ Get file name according to proposed convention
-
petab.problem.
get_default_measurement_file_name
(model_name: str, folder: str = '')¶ Get file name according to proposed convention
-
petab.problem.
get_default_parameter_file_name
(model_name: str, folder: str = '')¶ Get file name according to proposed convention
-
petab.problem.
get_default_sbml_file_name
(model_name: str, folder: str = '')¶ Get file name according to proposed convention