petab.lint

Integrity checks and tests for specific features used

Functions

assert_all_parameters_present_in_parameter_df(…) Ensure all required parameters are contained in the parameter table with no additional ones
assert_measured_observables_present_in_model(…) Check if all observables in measurement files have been specified in the model
assert_model_parameters_in_condition_or_parameter_table(…) Model parameters that are targets of AssignmentRule must not be present in parameter table or in condition table columns.
assert_no_leading_trailing_whitespace(…) Check that there is no trailing whitespace in elements of Iterable
assert_noise_distributions_valid(measurement_df) Check whether there are not multiple noise distributions for an observable, and that the names are correct.
assert_parameter_bounds_are_numeric(parameter_df) Check if all entries in the lowerBound and upperBound columns of the parameter table are numeric.
assert_parameter_estimate_is_boolean(…) Check if all entries in the estimate column of the parameter table are 0 or 1.
assert_parameter_id_is_string(parameter_df) Check if all entries in the parameterId column of the parameter table are string and not empty.
assert_parameter_id_is_unique(parameter_df) Check if the parameterId column of the parameter table is unique.
assert_parameter_scale_is_valid(parameter_df) Check if all entries in the parameterScale column of the parameter table are ‘lin’ for linear, ‘log’ for natural logarithm or ‘log10’ for base 10 logarithm.
check_condition_df(df, sbml_model) Run sanity checks on PEtab condition table
check_measurement_df(df) Run sanity checks on PEtab measurement table
check_parameter_bounds(parameter_df) Check if all entries in the lowerBound are smaller than upperBound column in the parameter table and that bounds are positive for parameterScale log|log10.
check_parameter_df(df, sbml_model, …) Run sanity checks on PEtab parameter table
condition_table_is_parameter_free(condition_df) Check if all entries in the condition table are numeric (no parameter IDs)
lint_problem(problem) Run PEtab validation on problem
measurement_table_has_observable_parameter_numeric_overrides(…) Are there any numbers to override observable parameters?
measurement_table_has_timepoint_specific_mappings(…) Are there time-point or replicate specific parameter assignments in the measurement table.
petab.lint._check_df(df: pandas.core.frame.DataFrame, req_cols: Iterable[T_co], name: str) → None

Check if given columns are present in DataFrame

Parameters:
  • df – Dataframe to check
  • req_cols – Column names which have to be present
  • name – Name of the DataFrame to be included in error message
Raises:

AssertionError – if a column is missing

petab.lint.assert_all_parameters_present_in_parameter_df(parameter_df: pandas.core.frame.DataFrame, sbml_model: libsbml.Model, measurement_df: pandas.core.frame.DataFrame, condition_df: pandas.core.frame.DataFrame) → None

Ensure all required parameters are contained in the parameter table with no additional ones

Parameters:
  • parameter_df – PEtab parameter DataFrame
  • sbml_model – PEtab SBML Model
  • measurement_df – PEtab measurement table
  • condition_df – PEtab condition table
Raises:

AssertionError – in case of problems

petab.lint.assert_measured_observables_present_in_model(measurement_df: pandas.core.frame.DataFrame, sbml_model: libsbml.Model) → None

Check if all observables in measurement files have been specified in the model

Parameters:
  • sbml_model – PEtab SBML Model
  • measurement_df – PEtab measurement table
Raises:

AssertionError – in case of problems

petab.lint.assert_model_parameters_in_condition_or_parameter_table(sbml_model: libsbml.Model, condition_df: pandas.core.frame.DataFrame, parameter_df: pandas.core.frame.DataFrame) → None

Model parameters that are targets of AssignmentRule must not be present in parameter table or in condition table columns. Other parameters must only be present in either in parameter table or condition table columns. Check that.

Parameters:
  • parameter_df – PEtab parameter DataFrame
  • sbml_model – PEtab SBML Model
  • condition_df – PEtab condition table
Raises:

AssertionError – in case of problems

petab.lint.assert_no_leading_trailing_whitespace(names_list: Iterable[str], name: str) → None

Check that there is no trailing whitespace in elements of Iterable

Parameters:
  • names_list – strings to check for whitespace
  • name – name of names_list for error messages
Raises:

AssertionError – if there is trailing whitespace

petab.lint.assert_noise_distributions_valid(measurement_df: pandas.core.frame.DataFrame) → None

Check whether there are not multiple noise distributions for an observable, and that the names are correct.

Parameters:measurement_df – PEtab measurement table
Raises:AssertionError – in case of problems
petab.lint.assert_parameter_bounds_are_numeric(parameter_df: pandas.core.frame.DataFrame) → None

Check if all entries in the lowerBound and upperBound columns of the parameter table are numeric.

Parameters:parameter_df – PEtab parameter DataFrame
Raises:AssertionError – in case of problems
petab.lint.assert_parameter_estimate_is_boolean(parameter_df: pandas.core.frame.DataFrame) → None

Check if all entries in the estimate column of the parameter table are 0 or 1.

Parameters:parameter_df – PEtab parameter DataFrame
Raises:AssertionError – in case of problems
petab.lint.assert_parameter_id_is_string(parameter_df: pandas.core.frame.DataFrame) → None

Check if all entries in the parameterId column of the parameter table are string and not empty.

Parameters:parameter_df – PEtab parameter DataFrame
Raises:AssertionError – in case of problems
petab.lint.assert_parameter_id_is_unique(parameter_df: pandas.core.frame.DataFrame) → None

Check if the parameterId column of the parameter table is unique.

Parameters:parameter_df – PEtab parameter DataFrame
Raises:AssertionError – in case of problems
petab.lint.assert_parameter_scale_is_valid(parameter_df: pandas.core.frame.DataFrame) → None

Check if all entries in the parameterScale column of the parameter table are ‘lin’ for linear, ‘log’ for natural logarithm or ‘log10’ for base 10 logarithm.

Parameters:parameter_df – PEtab parameter DataFrame
Raises:AssertionError – in case of problems
petab.lint.check_condition_df(df: pandas.core.frame.DataFrame, sbml_model: Optional[libsbml.Model]) → None

Run sanity checks on PEtab condition table

Parameters:
  • df – PEtab condition DataFrame
  • sbml_model – SBML Model for additional checking of parameter IDs
Raises:

AssertionError – in case of problems

petab.lint.check_measurement_df(df: pandas.core.frame.DataFrame) → None

Run sanity checks on PEtab measurement table

Parameters:df – PEtab measurement DataFrame
Raises:AssertionError – in case of problems
petab.lint.check_parameter_bounds(parameter_df: pandas.core.frame.DataFrame) → None

Check if all entries in the lowerBound are smaller than upperBound column in the parameter table and that bounds are positive for parameterScale log|log10.

Parameters:parameter_df – PEtab parameter DataFrame
Raises:AssertionError – in case of problems
petab.lint.check_parameter_df(df: pandas.core.frame.DataFrame, sbml_model: Optional[libsbml.Model], measurement_df: Optional[pandas.core.frame.DataFrame], condition_df: Optional[pandas.core.frame.DataFrame]) → None

Run sanity checks on PEtab parameter table

Parameters:
  • df – PEtab condition DataFrame
  • sbml_model – SBML Model for additional checking of parameter IDs
  • measurement_df – PEtab measurement table for additional checks
  • condition_df – PEtab condition table for additional checks
Raises:

AssertionError – in case of problems

petab.lint.condition_table_is_parameter_free(condition_df: pandas.core.frame.DataFrame) → bool

Check if all entries in the condition table are numeric (no parameter IDs)

Parameters:condition_df – PEtab condition table
Returns:True if there are no parameter overrides in the condition table, False otherweise.
petab.lint.lint_problem(problem: petab.problem.Problem) → bool

Run PEtab validation on problem

Parameters:problem – PEtab problem to check
Returns:True is errors occurred, False otherwise
petab.lint.measurement_table_has_observable_parameter_numeric_overrides(measurement_df: pandas.core.frame.DataFrame) → bool

Are there any numbers to override observable parameters?

Parameters:measurement_df – PEtab measurement table
Returns:True if there any numbers to override observable parameters, False otherwise.
petab.lint.measurement_table_has_timepoint_specific_mappings(measurement_df: pandas.core.frame.DataFrame) → bool

Are there time-point or replicate specific parameter assignments in the measurement table.

Parameters:measurement_df – PEtab measurement table
Returns:True if there are time-point or replicate specific parameter assignments in the measurement table, False otherwise.