Skip to content

Commit ff94fb1

Browse files
committed
Merge pull request #617 from padix-key/color-scheme
Use 'flower' as default color scheme
2 parents e0fa33c + 03cbe8b commit ff94fb1

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

doc/examples/scripts/sequence/misc/color_schemes_protein.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
- **clustalx** - Default color scheme of the *ClustalX* software
1010
- Color schemes generated with the software *Gecos*
1111
:footcite:`Kunzmann2020`:
12-
12+
1313
- **flower** - Light color scheme, based on *BLOSUM62*
1414
- **blossom** - Light color scheme with high contrast, based on
1515
*BLOSUM62*, depicts symbol similarity worse than *flower*
@@ -21,12 +21,12 @@
2121
scheme, based on *BLOSUM62*
2222
- **ocean** - Blue shifted, light color scheme, based on
2323
*BLOSUM62*
24-
24+
2525
- Color schemes adapted from *JalView* :footcite:`Clamp2004`:
26-
26+
2727
- **zappo** - Color scheme that depicts physicochemical properties
2828
- **taylor** - Color scheme invented by Willie Taylor
29-
- **buried** - Color scheme depicting the *buried index*
29+
- **buried** - Color scheme depicting the *buried index*
3030
- **hydrophobicity** - Color scheme depicting hydrophobicity
3131
- **prophelix** - Color scheme depicting secondary structure
3232
propensities
@@ -70,8 +70,8 @@
7070
# Get color scheme names
7171
alphabet = seq.ProteinSequence.alphabet
7272
schemes = [
73-
"rainbow", "clustalx",
7473
"flower", "blossom", "spring", "wither", "autumn", "sunset", "ocean",
74+
"rainbow", "clustalx",
7575
"zappo", "taylor", "buried", "hydrophobicity",
7676
"prophelix", "propstrand", "propturn"
7777
]

src/biotite/sequence/graphics/alignment.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ class LetterTypePlotter(LetterPlotter):
310310
The alphabet of the alignment(s) to be plotted
311311
color_scheme : str or list of (tuple or str), optional
312312
Either a valid color scheme name
313-
(e.g. ``"rainbow"``, ``"clustalx"``, ``blossom``, etc.)
313+
(e.g. ``"flower"``, ``"clustalx"``, ``blossom``, etc.)
314314
or a list of *Matplotlib* compatible colors.
315315
The list length must be at least as long as the
316316
length of the alphabet used by the sequences.
@@ -330,7 +330,7 @@ def __init__(self, axes, alphabet, color_scheme=None, color_symbols=False,
330330
super().__init__(axes, color_symbols, font_size, font_param)
331331

332332
if color_scheme is None:
333-
self._colors = get_color_scheme("rainbow", alphabet)
333+
self._colors = get_color_scheme("flower", alphabet)
334334
elif isinstance(color_scheme, str):
335335
self._colors = get_color_scheme(color_scheme, alphabet)
336336
else:
@@ -873,7 +873,7 @@ def plot_alignment_type_based(axes, alignment, symbols_per_line=50,
873873
is equal to the size of a symbol box.
874874
color_scheme : str or list of (tuple or str), optional
875875
Either a valid color scheme name
876-
(e.g. ``"rainbow"``, ``"clustalx"``, ``blossom``, etc.)
876+
(e.g. ``"flower"``, ``"clustalx"``, ``blossom``, etc.)
877877
or a list of *Matplotlib* compatible colors.
878878
The list length must be at least as long as the
879879
length of the alphabet used by the sequences.

src/biotite/sequence/graphics/logo.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,16 @@ def plot_sequence_logo(axes, profile, scheme=None, **kwargs):
3636
The logo is created based on this profile.
3737
scheme : str or list of (tuple or str)
3838
Either a valid color scheme name
39-
(e.g. ``"rainbow"``, ``"clustalx"``, ``blossom``, etc.)
39+
(e.g. ``"flower"``, ``"clustalx"``, ``blossom``, etc.)
4040
or a list of *Matplotlib* compatible colors.
4141
The list length must be at least as long as the
4242
length of the alphabet used by the `profile`.
4343
**kwargs
4444
Additional `text parameters <https://matplotlib.org/api/text_api.html#matplotlib.text.Text>`_.
45-
45+
4646
References
4747
----------
48-
48+
4949
.. footbibliography::
5050
"""
5151
from matplotlib.text import Text
@@ -59,16 +59,16 @@ def plot_sequence_logo(axes, profile, scheme=None, **kwargs):
5959
raise TypeError("The sequences' alphabet must be a letter alphabet")
6060

6161
if scheme is None:
62-
colors = get_color_scheme("rainbow", alphabet)
62+
colors = get_color_scheme("flower", alphabet)
6363
elif isinstance(scheme, str):
6464
colors = get_color_scheme(scheme, alphabet)
6565
else:
6666
colors = scheme
67-
67+
6868
# 'color' and 'size' property is not passed on to text
6969
kwargs.pop("color", None)
7070
kwargs.pop("size", None)
71-
71+
7272
frequencies, entropies, max_entropy = _get_entropy(profile)
7373
stack_heights = (max_entropy - entropies)
7474
symbols_heights = stack_heights[:, np.newaxis] * frequencies

0 commit comments

Comments
 (0)