Calculations#

omicspylib.calculations.fold_change.calc_fold_change(data: DataFrame, condition_a: str, condition_b: str) DataFrame#

Calculates fold change of condition a over condition b. Log2 values of fold change are also calculated, so that you can use them for plotting. Note the 2x fold increase has log2 = 1 and 2x fold decrease has log2 value = -1.

Use identifiers as index in the provided data.

Parameters:
  • data (pd.DataFrame) – A table with averaged values.

  • condition_a (str) – Column name of condition a.

  • condition_b (str) – Column name of condition b.

Returns:

A data frame with fold change of condition a over condition b.

Return type:

pd.DataFrame

omicspylib.calculations.ttest.calc_ttest_adj(data: ProteinsDataset, condition_a: str, condition_b: str, na_threshold: float = 0.0, pval_adj_method: Literal['bonferroni', 'sidak', 'holm-sidak', 'holm', 'simes-hochberg', 'hommel', 'fdr_bh', 'fdr_by', 'fdr_tsbh', 'fdr_tsbky'] | None = 'fdr_bh') DataFrame#

Calculate t-test and correct p-values for multiple-hypothesis testing error.

Parameters:
  • data (ProteinsDataset) – A proteins dataset object.

  • condition_a (str) – Name of condition A to be evaluated.

  • condition_b (str) – Name of condition B to be evaluated.

  • na_threshold (float) – Threshold for NaN values.

  • pval_adj_method (MULTITEST_METHOD, optional) – Method to adjust p-values for multiple-hypothesis testing. By default, Benjamini/Hochberg (non-negative) (fdr_bh) is selected.

Returns:

A pandas data frame with the calculated p-values, t-statistic and optionally adjusted p-values. Row indices remain as they were provided.

Return type:

pd.DataFrame