get_color_scheme#

biotite.sequence.graphics.get_color_scheme(name, alphabet, default='#FFFFFF')[source]#

Get a color scheme by name and alphabet.

A color scheme is a list of colors that correspond to symbols of an alphabet. The color for a symbol is list of colors indexed by the corresponding symbol code.

Parameters:
namestr

The name of the color scheme.

alphabetAlphabet

The alphabet to obtain the scheme for. The alphabet of the scheme must equal or extend this parameter.

defaultstr or tuple, optional

A Matplotlib compatible color that is used for symbols that have no defined color in the scheme.

Returns:
colorslist

A list of Matplotlib compatible colors. The colors in the list have the same order as the symbols in the given alphabet. Since the alphabet of the color scheme may extend the given alphabet, the list of colors can be longer than the alphabet.

Notes

There can be multiple color schemes with the same name but for different alphabets (e.g. one for dna and one for protein sequences).

Examples

>>> alphabet = NucleotideSequence.alphabet_unamb
>>> color_scheme = get_color_scheme("rainbow", alphabet)
>>> print(color_scheme)
['#3737f5', '#37f537', '#f5f537', '#f53737']