AAlogoPlot

class AAlogoPlot(logo_type='probability', jmd_n_len=10, jmd_c_len=10, verbose=True)[source]

Bases: object

Amino Acid logo Plot (AAlogoPlot) class for visualizing sequence logos.

Every plotting method returns a (fig, ax) pair (a thin tuple subclass): unpack as fig, ax = .... For backward compatibility, the returned object also forwards attribute access to ax, so legacy ax = ...; ax.set_title(...) keeps working.

Renders single and stacked multiple sequence logos (via the logomaker [Tareen20] package) with automatic target middle domain (TMD) / juxta middle domain (JMD) part annotations. jmd_n_len and jmd_c_len are set at initialization and used by all plot methods to derive the TMD region length from the logo DataFrame. The logo_type set at initialization controls only the y-axis label; the logo data itself is provided as a pre-computed df_logo from AAlogo.

Added in version 1.0.3.

Parameters:
  • logo_type (Literal[‘probability’, ‘weight’, ‘counts’, ‘information’])

  • jmd_n_len (int)

  • jmd_c_len (int)

  • verbose (bool)

Methods

multi_logo([list_df_logo, ...])

Plot multiple sequence logos stacked vertically for group comparison, each with an optional bit-score bar on top.

single_logo([df_logo, df_logo_info, ...])

Plot a single sequence logo with optional bit-score bar and target middle domain (TMD) / juxta middle domain (JMD) annotations.

__init__(logo_type='probability', jmd_n_len=10, jmd_c_len=10, verbose=True)[source]
Parameters:
  • logo_type ({'probability', 'weight', 'counts', 'information'}, default='probability') –

    Type of sequence logo encoding, used to set the y-axis label:

    • 'probability': y-axis label is 'Probability [%]'.

    • 'weight': y-axis label is 'Weight'.

    • 'counts': y-axis label is 'Counts'.

    • 'information': y-axis label is 'Bits'.

  • jmd_n_len (int, default=10) – Length of the juxta middle domain (JMD)-N region (>=0). Used together with jmd_c_len to derive the target middle domain (TMD) length from the logo DataFrame for part annotations.

  • jmd_c_len (int, default=10) – Length of the JMD-C region (>=0).

  • verbose (bool, default=True) – If True, verbose outputs are enabled.

See also

  • AAlogo: the corresponding data computation class.

  • logomaker: the underlying logo rendering package.