grelu.io.meme#

Functions related to reading and writing MEME files

Functions#

read_meme_file(→ tuple)

Read a motif database in MEME format

modisco_to_meme(→ str)

Reads motifs discovered by TF-modisco and writes them to a MEME file.

Module Contents#

grelu.io.meme.read_meme_file(file: str, names: List[str] | None = None) tuple[source]#

Read a motif database in MEME format

Parameters:
  • file – The path to the MEME file

  • names – List of motif names to read

Returns:

A list of motifs as pymemesuite.common.Motif objects bg: Background distribution

Return type:

motifs

grelu.io.meme.modisco_to_meme(h5_file: str, trim_threshold: float = 0.3) str[source]#

Reads motifs discovered by TF-modisco and writes them to a MEME file.

Parameters:
  • h5_file – Path to an h5 file containing modisco output

  • trim_threshold – A threshold value between 0 and 1 used for trimming the PPMs. Each PPM will be trimmed from both ends until the first position for which the probability for any base is greater than or equal to trim_threshold. trim_threshold = 0 will result in no trimming.

Returns:

Path to the MEME file