proteometer.stats#
Classes#
Functions#
|
Recalculates adjusted p-values for specified comparisons. |
|
Recalculates adjusted p-values for specified comparisons, computed protein-wise. |
|
Applies log2 transformation to specified intensity columns in a DataFrame. |
|
Performs ANOVA on specified columns of a DataFrame. |
|
Performs pairwise t-tests for specified treatment and control groups. |
|
Calculates pairwise scalars based on significance thresholds. |
|
Calculates pairwise scalars for all specified t-test groups. |
Module Contents#
- class proteometer.stats.TTestGroup[source]#
-
- treat_samples: collections.abc.Sequence[str][source]#
- control_samples: collections.abc.Sequence[str][source]#
- proteometer.stats.recalculate_adj_pval(df: pandas.DataFrame, comparisons: list[str])[source]#
Recalculates adjusted p-values for specified comparisons.
- Parameters:
- Returns:
DataFrame with recalculated adjusted p-values.
- Return type:
pd.DataFrame
- proteometer.stats.recalculate_adj_pval_proteinwise(df: pandas.DataFrame, comparisons: list[str], protein_col: str = 'Protein')[source]#
Recalculates adjusted p-values for specified comparisons, computed protein-wise.
See: - Schopper et al. Nature Protocols, 12(11):2391-2410, October 2017. - Nagel et al. Cellular Proteomics, 24(4):100934, April 2025.
- Parameters:
- Returns:
DataFrame with recalculated adjusted p-values.
- Return type:
pd.DataFrame
- proteometer.stats.log2_transformation(df2transform: pandas.DataFrame, int_cols: collections.abc.Sequence[str]) pandas.DataFrame [source]#
Applies log2 transformation to specified intensity columns in a DataFrame.
- Parameters:
df2transform (pd.DataFrame) – DataFrame containing the data to transform.
int_cols (Sequence[str]) – List of intensity column names to apply the transformation.
- Returns:
DataFrame with log2-transformed intensity columns.
- Return type:
pd.DataFrame
- proteometer.stats.anova(df: pandas.DataFrame, anova_cols: list[str], metadata: pandas.DataFrame, anova_factors: collections.abc.Sequence[str], sample_col: str) pandas.DataFrame [source]#
Performs ANOVA on specified columns of a DataFrame.
- Parameters:
- Returns:
DataFrame with ANOVA p-values and adjusted p-values.
- Return type:
pd.DataFrame
- proteometer.stats.pairwise_ttest(df: pandas.DataFrame, pairwise_ttest_groups: collections.abc.Iterable[TTestGroup]) pandas.DataFrame [source]#
Performs pairwise t-tests for specified treatment and control groups.
- Parameters:
df (pd.DataFrame) – DataFrame containing the data for analysis.
pairwise_ttest_groups (Iterable[TTestGroup]) – Iterable of TTestGroup objects defining the groups.
- Returns:
DataFrame with t-test results, including p-values and adjusted p-values.
- Return type:
pd.DataFrame
- proteometer.stats.calculate_pairwise_scalars(prot: pandas.DataFrame, pairwise_ttest_name: str | None = None, sig_type: str = 'pval', sig_thr: float = 0.05) pandas.DataFrame [source]#
Calculates pairwise scalars based on significance thresholds.
- Parameters:
prot (pd.DataFrame) – DataFrame containing pairwise t-test results.
pairwise_ttest_name (str | None, optional) – Name of the pairwise t-test column. Defaults to None.
sig_type (str, optional) – Type of significance metric (e.g., “pval”). Defaults to “pval”.
sig_thr (float, optional) – Significance threshold. Defaults to 0.05.
- Returns:
DataFrame with calculated scalars.
- Return type:
pd.DataFrame
- proteometer.stats.calculate_all_pairwise_scalars(prot: pandas.DataFrame, pairwise_ttest_groups: collections.abc.Iterable[TTestGroup], sig_type: str = 'pval', sig_thr: float = 0.05) pandas.DataFrame [source]#
Calculates pairwise scalars for all specified t-test groups.
- Parameters:
prot (pd.DataFrame) – DataFrame containing pairwise t-test results.
pairwise_ttest_groups (Iterable[TTestGroup]) – Iterable of TTestGroup objects defining the groups.
sig_type (str, optional) – Type of significance metric (e.g., “pval”). Defaults to “pval”.
sig_thr (float, optional) – Significance threshold. Defaults to 0.05.
- Returns:
DataFrame with calculated scalars for all groups.
- Return type:
pd.DataFrame