clarite.analyze.add_corrected_pvalues

clarite.analyze.add_corrected_pvalues(data: pandas.core.frame.DataFrame, pvalue: str = 'pvalue', groupby: Union[str, List[str], None] = None)

Calculate bonferroni and FDR pvalues and sort by increasing FDR (in-place). Rows with a missing pvalue are not counted as a test.

Parameters:
data:

A dataframe that will be modified in-place to add corrected pvalues

pvalue:

Name of a column in data that the calculations will be based on.

groupby:

A name or list of names of columns (including index columns) that will be used to group rows before performing calculations. This is meant to be used when multiple rows are present with repeated pvalues based on the same test. This will reduce the number of tests. For example, grouping by [“Term1”, “Term2”] in interaction results to apply corrections to the LRT_pvalue when betas are reported (which creates more rows than the number of tests)

Returns:
None

Examples

>>> clarite.analyze.add_corrected_pvalues(ewas_discovery)
>>> clarite.analyze.add_corrected_pvalues(interaction_result, pvalue='Beta_pvalue')
>>> clarite.analyze.add_corrected_pvalues(interaction_result, pvalue='LRT_pvalue', groupby=["Term1", "Term2"])