LetterTypePlotter#
- class biotite.sequence.graphics.LetterTypePlotter(axes: Axes, alphabet: Any, color_scheme: str | list[Any] | None = None, color_symbols: bool = False, font_size: float | None = None, font_param: dict[str, Any] | None = None)[source]#
Bases:
LetterPlotterThis SymbolPloter colors each symbol based on the general color of that symbol defined by a color scheme.
EXPERIMENTAL: Future API changes are probable.
- Parameters:
- axesAxes
A Matplotlib axes, that is used as plotting area.
- alphabetAlphabet
The alphabet of the alignment(s) to be plotted.
- color_schemestr or list of (tuple or str), optional
Either a valid color scheme name (e.g.
"flower","clustalx",blossom, etc.) or a list of Matplotlib compatible colors. The list length must be at least as long as the length of the alphabet used by the sequences.- color_symbolsbool, optional
If true, the symbols themselves are colored. If false, the symbols are black, and the boxes behind the symbols are colored.
- font_sizefloat, optional
Font size of the sequence symbols.
- font_paramdict, optional
Additional parameters that is given to the
matplotlib.Textinstance of each symbol.
- get_color(alignment: Alignment, column_i: int, seq_i: int) Any#
Get the color of a symbol at a specified position in the alignment.
The symbol is specified as position in the alignment’s trace (
trace[pos_i, seq_i]).PROTECTED: Override when inheriting.
- Parameters:
- alignmentAlignment
The respective alignment.
- column_iint
The position index in the trace.
- seq_iint
The sequence index in the trace.
- Returns:
- colorobject
A Matplotlib compatible color used for the background or the symbol itself at the specifed position.
- plot_symbol(bbox: Bbox, alignment: Alignment, column_i: int, seq_i: int) None#
Get the color of a symbol at a specified position in the alignment.
The symbol is specified as position in the alignment’s trace (
trace[pos_i, seq_i]).- Parameters:
- bboxBbox
The axes area to plot the symbol in.
- alignmentAlignment
The respective alignment.
- column_iint
The position index in the trace.
- seq_iint
The sequence index in the trace.