petab - a Python package for handling PEtab files
PEtab is a data format for specifying
parameter estimation problems in systems biology. This repository provides
the petab
Python package for reading, writing and validating PEtab files.
Documentation
Documentation of the petab
Python package is available at
https://libpetab-python.readthedocs.io/en/latest/.
Documentation of the PEtab format in general is available at
https://petab.readthedocs.io/en/latest/.
Installation
The PEtab library is available on pypi and the easiest way to install it is running
pip3 install petab
It will require Python>=3.10 to run. (We are following the numpy Python support policy).
Development versions of the PEtab library can be installed using
pip3 install https://github.com/PEtab-dev/libpetab-python/archive/develop.zip
(replace develop
by the branch or commit you would like to install).
When setting up a new parameter estimation problem, the most useful tools will be:
The PEtab validator, which is automatically installed using Python entrypoints to be available as a shell command from anywhere, called
petablint
petab.create_parameter_df to create the parameter table, once you have set up the model, condition table, observable table and measurement table
petab.create_combine_archive to create a COMBINE Archive from PEtab files
Examples
Examples for PEtab Python library usage:
Getting help
If you have any questions or problems with this package, feel free to post them at our GitHub issue tracker.
Contributing
Contributions and feedback to this package are very welcome, see our contribution guide.
- API Reference
- petab
- petab.v1
CompositeProblem
ParMappingDict
ParMappingDictQuadruple
ParMappingDictTuple
Problem
ScaleMappingDict
ScaleMappingDictTuple
Simulator
assert_all_parameters_present_in_parameter_df()
assert_measured_observables_defined()
assert_measurement_conditions_present_in_condition_table()
assert_measurements_not_null()
assert_measurements_numeric()
assert_model_parameters_in_condition_or_parameter_table()
assert_no_leading_trailing_whitespace()
assert_noise_distributions_valid()
assert_overrides_match_parameter_count()
assert_parameter_bounds_are_numeric()
assert_parameter_estimate_is_boolean()
assert_parameter_id_is_string()
assert_parameter_prior_parameters_are_valid()
assert_parameter_prior_type_is_valid()
assert_parameter_scale_is_valid()
assert_single_condition_and_sbml_file()
assert_unique_observable_ids()
assert_unique_parameter_ids()
calculate_chi2()
calculate_chi2_for_table_from_residuals()
calculate_llh()
calculate_llh_for_table()
calculate_residuals()
calculate_residuals_for_table()
calculate_single_llh()
check_condition_df()
check_ids()
check_mapping_df()
check_measurement_df()
check_observable_df()
check_parameter_bounds()
check_parameter_df()
concat_tables()
condition_table_is_parameter_free()
create_combine_archive()
create_condition_df()
create_measurement_df()
create_observable_df()
create_parameter_df()
create_problem_yaml()
evaluate_noise_formula()
flatten_timepoint_specific_output_overrides()
get_condition_df()
get_formula_placeholders()
get_mapping_df()
get_measurement_df()
get_measurement_parameter_ids()
get_model_for_condition()
get_model_parameters()
get_notnull_columns()
get_observable_df()
get_optimization_parameter_scaling()
get_optimization_parameters()
get_optimization_to_simulation_parameter_mapping()
get_output_parameters()
get_parameter_df()
get_parameter_mapping_for_condition()
get_parametric_overrides()
get_path_prefix()
get_placeholders()
get_priors_from_df()
get_rows_for_condition()
get_sbml_model()
get_simulation_conditions()
get_simulation_df()
get_symbolic_noise_formulas()
get_valid_parameters_for_parameter_table()
get_visualization_df()
globalize_parameters()
handle_missing_overrides()
is_composite_problem()
is_empty()
is_sbml_consistent()
is_scalar_float()
is_valid_identifier()
lint_problem()
load_sbml_from_file()
load_sbml_from_string()
load_yaml()
log_sbml_errors()
map_scale()
map_unscale()
measurement_is_at_steady_state()
measurement_table_has_observable_parameter_numeric_overrides()
measurement_table_has_timepoint_specific_mappings()
measurements_have_replicates()
merge_preeq_and_sim_pars()
merge_preeq_and_sim_pars_condition()
normalize_parameter_df()
observable_table_has_nontrivial_noise_formula()
resolve_mapping()
sample_from_prior()
sample_noise()
sample_parameter_startpoints()
scale()
split_parameter_replacement_list()
to_float_if_float()
unflatten_simulation_df()
unique_preserve_order()
unscale()
validate()
validate_yaml_semantics()
validate_yaml_syntax()
write_condition_df()
write_mapping_df()
write_measurement_df()
write_observable_df()
write_parameter_df()
write_sbml()
write_simulation_df()
write_visualization_df()
write_yaml()
- petab.v1.C
- petab.v1.calculate
- petab.v1.composite_problem
- petab.v1.conditions
- petab.v1.core
- petab.v1.format_version
- petab.v1.lint
- petab.v1.mapping
- petab.v1.math
- petab.v1.measurements
- petab.v1.models
- petab.v1.observables
- petab.v1.parameter_mapping
- petab.v1.parameters
- petab.v1.problem
- petab.v1.sampling
- petab.v1.sbml
- petab.v1.simplify
- petab.v1.simulate
- petab.v1.visualize
- petab.v1.yaml
- petab.v1.C
BAR_PLOT
CONDITION_FILES
CONDITION_ID
CONDITION_NAME
DATASET_ID
ESTIMATE
FORMAT_VERSION
INITIALIZATION
INITIALIZATION_PRIOR_PARAMETERS
INITIALIZATION_PRIOR_TYPE
LAPLACE
LEGEND_ENTRY
LIN
LINE_PLOT
LOG
LOG10
LOG_LAPLACE
LOG_NORMAL
LOWER_BOUND
MEASUREMENT
MEASUREMENT_DF_COLS
MEASUREMENT_DF_OPTIONAL_COLS
MEASUREMENT_DF_REQUIRED_COLS
MEASUREMENT_FILES
NOISE_DISTRIBUTION
NOISE_FORMULA
NOISE_MODELS
NOISE_PARAMETERS
NOISE_VALUE
NOMINAL_VALUE
NORMAL
OBJECTIVE
OBJECTIVE_PRIOR_PARAMETERS
OBJECTIVE_PRIOR_TYPE
OBSERVABLE_DF_COLS
OBSERVABLE_DF_OPTIONAL_COLS
OBSERVABLE_DF_REQUIRED_COLS
OBSERVABLE_FILES
OBSERVABLE_FORMULA
OBSERVABLE_ID
OBSERVABLE_NAME
OBSERVABLE_PARAMETERS
OBSERVABLE_TRANSFORMATION
OBSERVABLE_TRANSFORMATIONS
PARAMETER_DF_COLS
PARAMETER_DF_OPTIONAL_COLS
PARAMETER_DF_REQUIRED_COLS
PARAMETER_FILE
PARAMETER_ID
PARAMETER_NAME
PARAMETER_SCALE
PARAMETER_SCALE_LAPLACE
PARAMETER_SCALE_NORMAL
PARAMETER_SCALE_UNIFORM
PARAMETER_SEPARATOR
PLOT_ID
PLOT_NAME
PLOT_TYPES_DATA
PLOT_TYPES_SIMULATION
PLOT_TYPE_DATA
PLOT_TYPE_SIMULATION
PREEQUILIBRATION_CONDITION_ID
PRIOR_TYPES
PROBLEMS
PROVIDED
REPLICATE
REPLICATE_ID
RESIDUAL
SBML_FILES
SCATTER_PLOT
SIMULATION
SIMULATION_CONDITION_ID
TIME
TIME_STEADY_STATE
UNIFORM
UPPER_BOUND
VISUALIZATION_DF_COLS
VISUALIZATION_DF_OPTIONAL_COLS
VISUALIZATION_DF_REQUIRED_COLS
VISUALIZATION_DF_SINGLE_PLOT_LEVEL_COLS
VISUALIZATION_DF_SUBPLOT_LEVEL_COLS
VISUALIZATION_FILES
X_LABEL
X_OFFSET
X_SCALE
X_SCALES
X_VALUES
Y_LABEL
Y_OFFSET
Y_SCALE
Y_SCALES
Y_VALUES
- petab.v1.calculate
- petab.v1.composite_problem
- petab.v1.conditions
- petab.v1.core
- petab.v1.lint
assert_all_parameters_present_in_parameter_df()
assert_measured_observables_defined()
assert_measurement_conditions_present_in_condition_table()
assert_measurements_not_null()
assert_measurements_numeric()
assert_model_parameters_in_condition_or_parameter_table()
assert_no_leading_trailing_whitespace()
assert_noise_distributions_valid()
assert_parameter_bounds_are_numeric()
assert_parameter_estimate_is_boolean()
assert_parameter_id_is_string()
assert_parameter_prior_parameters_are_valid()
assert_parameter_prior_type_is_valid()
assert_parameter_scale_is_valid()
assert_unique_observable_ids()
assert_unique_parameter_ids()
check_condition_df()
check_ids()
check_measurement_df()
check_observable_df()
check_parameter_bounds()
check_parameter_df()
condition_table_is_parameter_free()
is_scalar_float()
is_valid_identifier()
lint_problem()
measurement_table_has_observable_parameter_numeric_overrides()
measurement_table_has_timepoint_specific_mappings()
observable_table_has_nontrivial_noise_formula()
- petab.v1.measurements
- petab.v1.models
- petab.v1.observables
- petab.v1.parameter_mapping
- petab.v1.parameters
- petab.v1.problem
- petab.v1.sampling
- petab.v1.sbml
- petab.v1.simulate
- petab.v1.simplify
- petab.v1.visualize
- Visualize
DataProvider
Figure
MPLPlotter
plot_goodness_of_fit()
plot_problem()
plot_residuals_vs_simulation()
plot_with_vis_spec()
plot_without_vis_spec()
- petab.v1.visualize.cli
- petab.v1.visualize.data_overview
- petab.v1.visualize.helper_functions
- petab.v1.visualize.lint
- petab.v1.visualize.plot_data_and_simulation
- petab.v1.visualize.plot_residuals
- petab.v1.visualize.plotter
- petab.v1.visualize.plotting
- petab.v1.yaml
- petab.v2
CompositeProblem
ParMappingDict
ParMappingDictQuadruple
ParMappingDictTuple
Problem
ScaleMappingDict
ScaleMappingDictTuple
Simulator
assert_all_parameters_present_in_parameter_df()
assert_measured_observables_defined()
assert_measurement_conditions_present_in_condition_table()
assert_measurements_not_null()
assert_measurements_numeric()
assert_model_parameters_in_condition_or_parameter_table()
assert_no_leading_trailing_whitespace()
assert_noise_distributions_valid()
assert_overrides_match_parameter_count()
assert_parameter_bounds_are_numeric()
assert_parameter_estimate_is_boolean()
assert_parameter_id_is_string()
assert_parameter_prior_parameters_are_valid()
assert_parameter_prior_type_is_valid()
assert_parameter_scale_is_valid()
assert_single_condition_and_sbml_file()
assert_unique_observable_ids()
assert_unique_parameter_ids()
calculate_chi2()
calculate_chi2_for_table_from_residuals()
calculate_llh()
calculate_llh_for_table()
calculate_residuals()
calculate_residuals_for_table()
calculate_single_llh()
check_condition_df()
check_ids()
check_mapping_df()
check_measurement_df()
check_observable_df()
check_parameter_bounds()
check_parameter_df()
concat_tables()
condition_table_is_parameter_free()
create_combine_archive()
create_condition_df()
create_measurement_df()
create_observable_df()
create_parameter_df()
create_problem_yaml()
evaluate_noise_formula()
flatten_timepoint_specific_output_overrides()
get_condition_df()
get_formula_placeholders()
get_mapping_df()
get_measurement_df()
get_measurement_parameter_ids()
get_model_for_condition()
get_model_parameters()
get_notnull_columns()
get_observable_df()
get_optimization_parameter_scaling()
get_optimization_parameters()
get_optimization_to_simulation_parameter_mapping()
get_output_parameters()
get_parameter_df()
get_parameter_mapping_for_condition()
get_parametric_overrides()
get_path_prefix()
get_placeholders()
get_priors_from_df()
get_rows_for_condition()
get_sbml_model()
get_simulation_conditions()
get_simulation_df()
get_symbolic_noise_formulas()
get_valid_parameters_for_parameter_table()
get_visualization_df()
globalize_parameters()
handle_missing_overrides()
is_composite_problem()
is_empty()
is_sbml_consistent()
is_scalar_float()
is_valid_identifier()
lint_problem()
load_sbml_from_file()
load_sbml_from_string()
load_yaml()
log_sbml_errors()
map_scale()
map_unscale()
measurement_is_at_steady_state()
measurement_table_has_observable_parameter_numeric_overrides()
measurement_table_has_timepoint_specific_mappings()
measurements_have_replicates()
merge_preeq_and_sim_pars()
merge_preeq_and_sim_pars_condition()
normalize_parameter_df()
observable_table_has_nontrivial_noise_formula()
resolve_mapping()
sample_from_prior()
sample_noise()
sample_parameter_startpoints()
scale()
split_parameter_replacement_list()
to_float_if_float()
unflatten_simulation_df()
unique_preserve_order()
unscale()
validate()
validate_yaml_semantics()
validate_yaml_syntax()
warn()
write_condition_df()
write_mapping_df()
write_measurement_df()
write_observable_df()
write_parameter_df()
write_sbml()
write_simulation_df()
write_visualization_df()
write_yaml()
- petab.v2.C
- petab.v2.lint
- petab.v2.petab1to2
- petab.v2.problem
- petab.v2.C
BAR_PLOT
CONDITION_FILES
CONDITION_ID
CONDITION_NAME
DATASET_ID
ESTIMATE
EXTENSIONS
FORMAT_VERSION
INITIALIZATION
INITIALIZATION_PRIOR_PARAMETERS
INITIALIZATION_PRIOR_TYPE
LAPLACE
LEGEND_ENTRY
LIN
LINE_PLOT
LOG
LOG10
LOG_LAPLACE
LOG_NORMAL
LOWER_BOUND
MAPPING_DF_REQUIRED_COLS
MAPPING_FILES
MEASUREMENT
MEASUREMENT_DF_COLS
MEASUREMENT_DF_OPTIONAL_COLS
MEASUREMENT_DF_REQUIRED_COLS
MEASUREMENT_FILES
MODEL_ENTITY_ID
MODEL_FILES
MODEL_LANGUAGE
MODEL_LOCATION
NOISE_DISTRIBUTION
NOISE_FORMULA
NOISE_MODELS
NOISE_PARAMETERS
NOISE_VALUE
NOMINAL_VALUE
NORMAL
OBJECTIVE
OBJECTIVE_PRIOR_PARAMETERS
OBJECTIVE_PRIOR_TYPE
OBSERVABLE_DF_COLS
OBSERVABLE_DF_OPTIONAL_COLS
OBSERVABLE_DF_REQUIRED_COLS
OBSERVABLE_FILES
OBSERVABLE_FORMULA
OBSERVABLE_ID
OBSERVABLE_NAME
OBSERVABLE_PARAMETERS
OBSERVABLE_TRANSFORMATION
OBSERVABLE_TRANSFORMATIONS
PARAMETER_DF_COLS
PARAMETER_DF_OPTIONAL_COLS
PARAMETER_DF_REQUIRED_COLS
PARAMETER_FILE
PARAMETER_ID
PARAMETER_NAME
PARAMETER_SCALE
PARAMETER_SCALE_LAPLACE
PARAMETER_SCALE_NORMAL
PARAMETER_SCALE_UNIFORM
PARAMETER_SEPARATOR
PETAB_ENTITY_ID
PLOT_ID
PLOT_NAME
PLOT_TYPES_DATA
PLOT_TYPES_SIMULATION
PLOT_TYPE_DATA
PLOT_TYPE_SIMULATION
PREEQUILIBRATION_CONDITION_ID
PRIOR_TYPES
PROBLEMS
PROVIDED
REPLICATE
REPLICATE_ID
RESIDUAL
SCATTER_PLOT
SIMULATION
SIMULATION_CONDITION_ID
TIME
TIME_STEADY_STATE
UNIFORM
UPPER_BOUND
VISUALIZATION_DF_COLS
VISUALIZATION_DF_OPTIONAL_COLS
VISUALIZATION_DF_REQUIRED_COLS
VISUALIZATION_DF_SINGLE_PLOT_LEVEL_COLS
VISUALIZATION_DF_SUBPLOT_LEVEL_COLS
VISUALIZATION_FILES
X_LABEL
X_OFFSET
X_SCALE
X_SCALES
X_VALUES
Y_LABEL
Y_OFFSET
Y_SCALE
Y_SCALES
Y_VALUES
- petab.v2.lint
CheckAllParametersPresentInParameterTable
CheckConditionTable
CheckMeasurementTable
CheckModel
CheckObservableTable
CheckParameterTable
CheckTableExists
CheckValidParameterInConditionOrParameterTable
CheckVisualizationTable
ValidationError
ValidationIssue
ValidationIssueSeverity
ValidationResultList
ValidationTask
default_validation_tasks
lint_problem()
- petab.v2.problem