agglovar.kmer.plot

Routines for generating dotplots.

Functions

dotplot(→ t_mpl_Figure)

Generate a dotplot for two sequences.

Module Contents

agglovar.kmer.plot.dotplot(seq_x: str, seq_y: str, config: dict = None, title: str = None, anno_list: list[dict] = None) t_mpl_Figure

Generate a dotplot for two sequences.

Configuration items:

  • label_x, label_y: Axis labels (default “Sequence”, and “Reference”)

  • start_x, start_y: Start position along each axis. Should be the first base position in the extracted region (Default 0).

  • linewidth: Width of the lines (default 1)

  • plot_width, plot_height, plot_dpi: Plot dimensions (default 7, 7, 300)

  • invert_y: Invert the y axis (default False)

  • color: A tuple of matplotlib colors for forward and reverse k-mer dots (default (“black”, “red”)) * May be “reverse” or “rev” to reverse the order of the default colors.

  • color_reverse: Reverse the order of the default colors (defaults to invert_y)

  • kmer_util: A kmer_util.KmerUtil object (default None)

  • k: K-mer size if kmer_util is missing (default 32)

Params seq_x:

Sequence 1 (horizontal axis).

Params seq_y:

Sequence 2 (vertical axis).

Params config:

Configuration dictionary.

Params title:

Figure title.

Params anno_list:

List of annotations.

Returns:

A matplotlib figure.

Raises:
  • ImportError – If matplotlib is not installed.

  • ValueError – If an invalid value is provided for an argument.

  • KeyError – If anno_list contains annotation definitions that are missing required elements.`