snapatac2.tl.motif_enrichment#

snapatac2.tl.motif_enrichment(motifs, regions, genome_fasta, background=None, method=None)[source]#

Identify enriched transcription factor motifs.

Parameters:
  • motifs (list[PyDNAMotif]) – A list of transcription factor motifs.

  • regions (dict[str, list[str]]) – Groups of regions. Each group will be tested independently against the background.

  • genome_fasta (Path | Genome) – A fasta file containing the genome sequences or a Genome object.

  • background (Optional[list[str]]) – A list of regions to be used as the background. If None, the union of elements in regions will be used as the background.

  • method (Optional[Literal['binomial', 'hypergeometric']]) – Statistical testing method: “binomial” or “hypergeometric”. To use “hypergeometric”, the testing regions must be a subset of background regions.

Returns:

Dataframes containing the enrichment analysis results for different groups.

Return type:

dict[str, pl.DataFrame]