tfmindi.pl.dbd_logos

Contents

tfmindi.pl.dbd_logos#

tfmindi.pl.dbd_logos(patterns, ic_threshold=0.2, min_nucleotides=4, ncols=None, **kwargs)#

Create a subplot grid showing sequence logos for each DNA-binding domain.

This function groups patterns by their DBD annotation and creates one subplot per DBD, showing a representative logo for that domain. Only patterns with DBD annotations are included in the plot.

Parameters:
  • patterns (dict[str, Pattern]) – Dictionary mapping cluster IDs to Pattern objects with DBD annotations. Patterns without DBD annotations (dbd=None) are ignored.

  • ic_threshold (float (default: 0.2)) – Information content threshold for logo trimming.

  • min_nucleotides (int (default: 4)) – Minimum number of nucleotides required after trimming to show logo. Patterns with fewer nucleotides will be skipped.

  • ncols (int | None (default: None)) – Number of columns in the subplot grid. If None, automatically determined based on the number of DBDs (aim for roughly square grid).

  • **kwargs – Additional arguments passed to render_plot() for styling and display options. Common options include title, show, save_path, dpi.

Return type:

Figure | None

Returns:

Figure with logo subplot grid, or None if show=True.

Examples

>>> import tfmindi as tm
>>> # After clustering and creating patterns with DBD annotations
>>> patterns = tm.tl.create_patterns(adata)
>>> # Create logo plots for each DBD
>>> fig = tm.pl.dbd_logos(patterns, title="DBD Logos")
>>> # Custom layout and styling
>>> tm.pl.dbd_logos(
...     patterns, ncols=3, ic_threshold=0.15, min_nucleotides=5, figsize=(12, 8), save_path="dbd_logos.png"
... )