hucira.run_all_enrichment_test#
- hucira.run_all_enrichment_test(adata, df, celltype_combos, celltype_column, contrasts_combo, contrast_column, direction='upregulated', threshold_lfc=1.0, threshold_expression=0.0, threshold_pval=0.01, min_size=10, max_size=1000, permutation_num=1000, weight=1.0, seed=2025, verbose=False, threads=6)#
Compute cytokine enrichment across multiple threshold values for robustness.
Wrapper around
run_one_enrichment_test()that loops through several threshold values to obtain more robust results.- Parameters:
adata (AnnData) – The query AnnData object.
df (pandas.DataFrame) – Human Cytokine Dictionary, CIP signatures, or custom gene-program DataFrame.
celltype_combos (list of tuple) – List of
(query_celltype, df_celltype)pairs.celltype_column (str) – Column name in
adata.obsthat stores the cell types.contrasts_combo (tuple of (str, str) or list of tuple) – Pair(s) of biological conditions to compare.
contrast_column (str) – Column name in
adata.obsthat stores condition labels.direction (str) – One of
"upregulated","downregulated", or"both".threshold_lfc (float or list of float) – Log-fold change threshold(s) for building the gene set.
threshold_expression (float or list of float) – Mean gene-expression threshold(s).
threshold_pval (float) – Maximum adjusted p-value for the gene set.
min_size (int) – Minimum gene-set size passed to GSEA.
max_size (int) – Maximum gene-set size passed to GSEA.
permutation_num (int) – Number of permutations for GSEA.
weight (float) – GSEA weighting exponent.
seed (int) – Random seed for reproducibility.
verbose (bool) – Whether to print progress messages.
threads (int) – Number of threads for GSEA.
- Return type:
DataFrame- Returns:
pandas.DataFrame DataFrame with all computed enrichment scores and statistical parameters from multiple thresholds.