dilimap.pp.pathway_signatures
- dilimap.pp.pathway_signatures(df, pval_thresh=0.05, gene_sets='WikiPathways_2019_Human')
Perform pathway enrichment analysis on DEGs for each compound.
This function takes a DataFrame of p-values, identifies significant genes based on a p-value threshold, and runs pathway enrichment analysis using Enrichr via GSEApy. It supports both single-sample and multi-sample differential expression data, returning results as an AnnData object with pathway enrichment statistics.
- Parameters:
df (pd.DataFrame or pd.Series) – Input data containing p-values for each gene. Columns should represent genes, and rows observations (e.g., perturbations)
pval_thresh (float) – P-value threshold for selecting significant genes.
gene_sets (str) – The gene set library to use for pathway enrichment.
- Returns:
An AnnData object containing pathway enrichment results, indexed by the observations in
df, withlayersforDES: -log10(FDR) enrichment scores.pval: Raw p-values for each pathway.FDR: Adjusted p-values (FDR).combined_score: Enrichr’s combined score.