zoom.sc_tool.gsea_perm

zoom.sc_tool.gsea_perm(gene_rep: pandas.DataFrame, weight_key: str, sign_key: str, weight_perm: pandas.DataFrame, sign_perm: pandas.DataFrame, gene_sets: dict, min_size: int, max_size: int, one_sided: bool, n_jobs: int) pandas.DataFrame[source]

Permform GSEA based on spatial permutation test.

Parameters:
  • gene_rep (pd.DataFrame) – Results for PLS-R, must contain following columns: - weight_key: Column name indicating the original gene weights for scoring. - sign_key: Column name indicating the direction of genes.

  • weight_perm (pd.DataFrame) – Gene weights in permutation tests.

  • sign_perm (pd.DataFrame) – Signed gene weights in permutation tests.

  • direction (bool) – If True, find gene set relevant to the positive direction of given SBP else negative direction.

  • gene_sets (dict) – Gene sets for enrichment analysis, must be organized as {‘Term1’: [Gene1, Gene2,…],…}

  • max_size (min_size &) – Minimum and maximum size of target gene set to be included in GSEA analysis

  • one_sided (bool:) – If True, infer statistical significance via one-sided p-values. Else, use two-sided p-values.

  • n_jobs (int) – Number of cores used for parallel computation.

Returns:

gsea_res – Results of spatial permutation test based GSEA. - index: Gene terms in gene_sets. - ES: Raw GSEA enrichment scores. - NES: Normalized GSEA enrichment scores. - p_perm: P-values inferred from spatial permutation test.

Return type:

pd.DataFrame

References

[1] Fulcher, B. D., Arnatkeviciute, A. & Fornito, A. Overcoming false-positive

gene-category enrichment in the analysis of spatially resolved transcriptomic brain atlas data. Nat. Commun. 12, 2669 (2021).

[2] Martins, D. et al. Imaging transcriptomics: convergent cellular,

transcriptomic, and molecular neuroimaging signatures in the healthy adult human brain. Cell Rep. 37, 110173 (2021).

[3] Fang, Z., Liu, X. & Peltz, G. GSEApy: a comprehensive package for performing

gene set enrichment analysis in Python. Bioinformatics 39, btac757 (2023).

Notes

Though we developed this function to link SBP-derived gene signatures to cell type- specific gene co-expression modules, this function can be equally applied to other biologically meaningful gene sets like GO, KEGG pathways, and so on.