LetterPlotter#

class biotite.sequence.graphics.LetterPlotter(axes, color_symbols=False, font_size=None, font_param=None)[source]#

Bases: SymbolPlotter

This abstract SymbolPlotter is the most widely used one. Symbols are visualized as character on a colored background box or as colored character, if color_symbols is set to true.

Subclasses must override the get_color() method.

Parameters:
axesAxes

A Matplotlib axes, that is used as plotting area.

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.Text instance of each symbol.

abstract get_color(alignment, column_i, seq_i)#

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, alignment, column_i, seq_i)#

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.