maayanlab_bioinformatics.enrichment package

Submodules

maayanlab_bioinformatics.enrichment.crisp module

class maayanlab_bioinformatics.enrichment.crisp.FisherOverlap(pvalue: float, odds_ratio: float, n_overlap: int, overlap: Set[Hashable] | None)[source]

Bases: object

n_overlap: int
odds_ratio: float
overlap: Set[Hashable] | None
pvalue: float
maayanlab_bioinformatics.enrichment.crisp.enrich_crisp(input_signature: Dict[Hashable, Any] | Iterable[Tuple[Hashable, Any]] | Set[Hashable], background_signatures: Dict[Hashable, Dict[Hashable, Any] | Iterable[Tuple[Hashable, Any]] | Set[Hashable]] | Iterable[Tuple[Hashable, Dict[Hashable, Any] | Iterable[Tuple[Hashable, Any]] | Set[Hashable]]], n_background_entities: int, preserve_overlap: bool = False) Iterable[Tuple[Hashable, FisherOverlap]][source]

Perform crisp set enrichment analysis using fisher overlap. Eriches the signature in input_signature against signatures in background_signatures.

Parameters:

n_background_entities – should correspond to the approximate number of entities exist, in the case of Human Genes for instance this might be 21000.

maayanlab_bioinformatics.enrichment.crisp.fisher_overlap(input_signature: Set[Hashable], background_signature: Set[Hashable], n_background_entities: int, preserve_overlap: bool = False) FisherOverlap | None[source]

Given input and background set, compute the overlap, fisher significance, and odds ratio. In the case of no overlap, will return None.

maayanlab_bioinformatics.enrichment.crisp.safe_odds_ratio(a, b, c, d)[source]

Compute the odds ratio returning helpful answers in the case of division by zero issues..

maayanlab_bioinformatics.enrichment.gsea2003 module

maayanlab_bioinformatics.enrichment.gsea2003.GSEA2003(geneset_membership: Series, gene_difference_metric: Series)[source]

Implementation of algorithm described here: https://pubmed.ncbi.nlm.nih.gov/12808457/

Parameters:
  • geneset_membership – (pd.Series) True if in set, False if not, index: all genes

  • gene_difference_metric – (pd.Series) Difference metric between two classes, e.g. SNR difference

:return (Tuple[np.array, np.array]) x and y arrays ready to be plotted. ES = y.max()

maayanlab_bioinformatics.enrichment.gsea2005 module

maayanlab_bioinformatics.enrichment.gsea2005.GSEA2005(geneset_membership: Series, correlations: Series)[source]

Implementation of algorithm described here: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC1239896/

Parameters:
  • geneset_membership – (pd.Series) True if in set, False if not, index: all genes

  • correlations – (pd.Series) Correlation of a given gene

:return (Tuple[np.array, np.array]) x and y arrays ready to be plotted. ES = y.max()

Module contents

This module contains functions that perform enrichment analysis.