pegasus.fgsea

pegasus.fgsea(data, log2fc_key, pathways, de_key='de_res', minSize=15, maxSize=500, nproc=0, seed=0, fgsea_key='fgsea_out')[source]

Perform Gene Set Enrichment Analysis using fGSEA. This function calls R package fGSEA, requiring fGSEA in R installed.

Parameters
  • data (Union[MultimodalData, UnimodalData]) – Single-cell or pseudo-bulk data.

  • log2fc_key (str) – Key in pre-computed DE results representing log2 fold change.

  • pathways (str) – Either a string or a path to the gene set file in GMT format. If string, choosing from “hallmark” and “canonical_pathways” (MSigDB H and C2/CP).

  • de_key (str, optional, default: "de_res") – Key name of DE analysis results stored. data.varm[de_key] should contain a record array of DE results.

  • minSize (int, optional, default: 15) – Minimal size of a gene set to consider.

  • maxSize (int, optional, default: 500) – Maximal size of a gene set to consider.

  • nproc (int, optional, default: 0) – Numbr of processes for parallel computation. If nproc > 0, set BPPARAM.

  • seed (int, optional, default: 0) – Random seed to make sure fGSEA results are reproducible.

  • fgsea_key (str, optional, default: "fgsea_out") – Key to use to store fGSEA results as a data frame.

Return type

None

Returns

  • None

  • Update data.unsdata.uns[fgsea_key]: fGSEA outputs sorted by padj.

Examples

>>> pg.fgsea(data, '3:log2FC', hallmark', fgsea_key='fgsea_res')