hucira.get_robust_significant_results

hucira.get_robust_significant_results#

hucira.get_robust_significant_results(results, alphas=None, threshold_valid=0.1, threshold_below_alpha=0.9, display_df_nicely=True)#

Filter for robust and significant results from original enrichments.

Returns only the enrichments that are statistically significant (q-val) and stable across many different tests (per contrast). Calls check_robustness() for different q-val thresholds to explore more stringent significance thresholds. Use for visualization of results (e.g. in a heatmap).

Parameters:
  • results (pandas.DataFrame) – The DataFrame output from run_one_enrichment_test().

  • alphas (list of float or None) – List of thresholds (q-val) to check significance of results. Result is considered significant if its q-val is below this threshold.

  • threshold_valid (float) – The fraction of results required to even consider this condition. I.e. if the test only ran for one set of thresholds, then it is not very robust.

  • threshold_below_alpha (float) – The fraction of results that need to be significant.

  • display_df_nicely (bool) – Whether to display the result DataFrames inline.

Return type:

dict | None

Returns:

dict Dictionary mapping contrasts to lists of the enrichment score results (pivot_df), their significance annotations (annot_df), and significance thresholds (robust_sub).