From 91d1c3a9125eb2aa381476c2d7baf6dfbfcf83a7 Mon Sep 17 00:00:00 2001 From: Ben Soares Date: Thu, 22 Apr 2021 18:33:51 +0100 Subject: [PATCH] JAL-4014 4 gecos colour schemes added --- src/jalview/schemes/BlossomColourScheme.java | 64 ++++++++++++++ src/jalview/schemes/FlowerColourScheme.java | 64 ++++++++++++++ src/jalview/schemes/JalviewColourScheme.java | 4 + src/jalview/schemes/OceanColourScheme.java | 64 ++++++++++++++ src/jalview/schemes/ResidueProperties.java | 119 ++++++++++++++++++++++++++ src/jalview/schemes/SunsetColourScheme.java | 64 ++++++++++++++ 6 files changed, 379 insertions(+) create mode 100755 src/jalview/schemes/BlossomColourScheme.java create mode 100755 src/jalview/schemes/FlowerColourScheme.java create mode 100755 src/jalview/schemes/OceanColourScheme.java create mode 100755 src/jalview/schemes/SunsetColourScheme.java diff --git a/src/jalview/schemes/BlossomColourScheme.java b/src/jalview/schemes/BlossomColourScheme.java new file mode 100755 index 0000000..9b92405 --- /dev/null +++ b/src/jalview/schemes/BlossomColourScheme.java @@ -0,0 +1,64 @@ +/* + * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) + * Copyright (C) $$Year-Rel$$ The Jalview Authors + * + * This file is part of Jalview. + * + * Jalview is free software: you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation, either version 3 + * of the License, or (at your option) any later version. + * + * Jalview is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Jalview. If not, see . + * The Jalview Authors are detailed in the 'AUTHORS' file. + */ +package jalview.schemes; + +import jalview.api.AlignViewportI; +import jalview.datamodel.AnnotatedCollectionI; + +/** + * DOCUMENT ME! + * + * @author $author$ + * @version $Revision$ + */ +public class BlossomColourScheme extends ResidueColourScheme +{ + /** + * Creates a new BlossomColourScheme object. + */ + public BlossomColourScheme() + { + super(ResidueProperties.aaIndex, ResidueProperties.blossom); + } + + @Override + public boolean isPeptideSpecific() + { + return true; + } + + @Override + public String getSchemeName() + { + return JalviewColourScheme.Blossom.toString(); + } + + /** + * Returns a new instance of this colour scheme with which the given data may + * be coloured + */ + @Override + public ColourSchemeI getInstance(AlignViewportI view, + AnnotatedCollectionI coll) + { + return new BlossomColourScheme(); + } +} diff --git a/src/jalview/schemes/FlowerColourScheme.java b/src/jalview/schemes/FlowerColourScheme.java new file mode 100755 index 0000000..040e6e4 --- /dev/null +++ b/src/jalview/schemes/FlowerColourScheme.java @@ -0,0 +1,64 @@ +/* + * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) + * Copyright (C) $$Year-Rel$$ The Jalview Authors + * + * This file is part of Jalview. + * + * Jalview is free software: you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation, either version 3 + * of the License, or (at your option) any later version. + * + * Jalview is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Jalview. If not, see . + * The Jalview Authors are detailed in the 'AUTHORS' file. + */ +package jalview.schemes; + +import jalview.api.AlignViewportI; +import jalview.datamodel.AnnotatedCollectionI; + +/** + * DOCUMENT ME! + * + * @author $author$ + * @version $Revision$ + */ +public class FlowerColourScheme extends ResidueColourScheme +{ + /** + * Creates a new FlowerColourScheme object. + */ + public FlowerColourScheme() + { + super(ResidueProperties.aaIndex, ResidueProperties.flower); + } + + @Override + public boolean isPeptideSpecific() + { + return true; + } + + @Override + public String getSchemeName() + { + return JalviewColourScheme.Flower.toString(); + } + + /** + * Returns a new instance of this colour scheme with which the given data may + * be coloured + */ + @Override + public ColourSchemeI getInstance(AlignViewportI view, + AnnotatedCollectionI coll) + { + return new FlowerColourScheme(); + } +} diff --git a/src/jalview/schemes/JalviewColourScheme.java b/src/jalview/schemes/JalviewColourScheme.java index 456397e..965a26b 100644 --- a/src/jalview/schemes/JalviewColourScheme.java +++ b/src/jalview/schemes/JalviewColourScheme.java @@ -34,6 +34,10 @@ public enum JalviewColourScheme PID("% Identity", PIDColourScheme.class), Zappo("Zappo", ZappoColourScheme.class), Taylor("Taylor", TaylorColourScheme.class), + Flower("gecos:flower", FlowerColourScheme.class), + Blossom("gecos:blossom", BlossomColourScheme.class), + Sunset("gecos:sunset", SunsetColourScheme.class), + Ocean("gecos:ocean", OceanColourScheme.class), Hydrophobic("Hydrophobic", HydrophobicColourScheme.class), Helix("Helix Propensity", HelixColourScheme.class), Strand("Strand Propensity", StrandColourScheme.class), diff --git a/src/jalview/schemes/OceanColourScheme.java b/src/jalview/schemes/OceanColourScheme.java new file mode 100755 index 0000000..23834a6 --- /dev/null +++ b/src/jalview/schemes/OceanColourScheme.java @@ -0,0 +1,64 @@ +/* + * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) + * Copyright (C) $$Year-Rel$$ The Jalview Authors + * + * This file is part of Jalview. + * + * Jalview is free software: you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation, either version 3 + * of the License, or (at your option) any later version. + * + * Jalview is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Jalview. If not, see . + * The Jalview Authors are detailed in the 'AUTHORS' file. + */ +package jalview.schemes; + +import jalview.api.AlignViewportI; +import jalview.datamodel.AnnotatedCollectionI; + +/** + * DOCUMENT ME! + * + * @author $author$ + * @version $Revision$ + */ +public class OceanColourScheme extends ResidueColourScheme +{ + /** + * Creates a new OceanColourScheme object. + */ + public OceanColourScheme() + { + super(ResidueProperties.aaIndex, ResidueProperties.ocean); + } + + @Override + public boolean isPeptideSpecific() + { + return true; + } + + @Override + public String getSchemeName() + { + return JalviewColourScheme.Ocean.toString(); + } + + /** + * Returns a new instance of this colour scheme with which the given data may + * be coloured + */ + @Override + public ColourSchemeI getInstance(AlignViewportI view, + AnnotatedCollectionI coll) + { + return new OceanColourScheme(); + } +} diff --git a/src/jalview/schemes/ResidueProperties.java b/src/jalview/schemes/ResidueProperties.java index ab86400..7ad35c3 100755 --- a/src/jalview/schemes/ResidueProperties.java +++ b/src/jalview/schemes/ResidueProperties.java @@ -407,6 +407,125 @@ public class ResidueProperties Color.white // ' ' }; + /* + * flower, blossom, sunset, ocean colour schemes from geocos. + * See https://gecos.biotite-python.org/ + * https://raw.githubusercontent.com/biotite-dev/biotite/master/src/biotite/sequence/graphics/color_schemes/flower.json + * and https://bmcbioinformatics.biomedcentral.com/articles/10.1186/s12859-020-3526-6 + * (https://doi.org/10.1186/s12859-020-3526-6) + */ + public static final Color[] flower = { new Color(177, 138, 81), // A + new Color(131, 191, 241), // R + new Color(11, 206, 198), // N + new Color(1, 165, 120), // D + new Color(255, 87, 1), // C + new Color(114, 149, 174), // Q + new Color(45, 160, 161), // E + new Color(177, 194, 60), // G + new Color(1, 148, 249), // H + new Color(242, 118, 99), // I + new Color(223, 110, 117), // L + new Color(127, 195, 215), // K + new Color(254, 157, 175), // M + new Color(250, 85, 157), // F + new Color(79, 163, 42), // P + new Color(180, 189, 155), // S + new Color(210, 181, 118), // T + new Color(255, 45, 237), // W + new Color(201, 110, 207), // Y + new Color(253, 153, 123), // V + Color.white, // B + Color.white, // Z + Color.white, // X + Color.white, // - + Color.white, // * + Color.white // . + }; + + public static final Color[] blossom = { new Color(139, 196, 180), // A + new Color(252, 149, 2), // R + new Color(181, 194, 6), // N + new Color(95, 165, 5), // D + new Color(8, 147, 254), // C + new Color(191, 133, 39), // Q + new Color(219, 181, 1), // E + new Color(0, 211, 130), // G + new Color(255, 87, 1), // H + new Color(154, 186, 243), // I + new Color(205, 165, 220), // L + new Color(254, 165, 39), // K + new Color(245, 161, 184), // M + new Color(247, 79, 168), // F + new Color(16, 214, 49), // P + new Color(126, 157, 89), // S + new Color(0, 162, 156), // T + new Color(254, 8, 251), // W + new Color(255, 78, 122), // Y + new Color(135, 192, 228), // V + Color.white, // B + Color.white, // Z + Color.white, // X + Color.white, // - + Color.white, // * + Color.white // . + }; + + public static final Color[] sunset = { new Color(254, 160, 253), // A + new Color(133, 116, 106), // R + new Color(171, 200, 245), // N + new Color(46, 123, 190), // D + new Color(252, 12, 254), // C + new Color(140, 110, 129), // Q + new Color(103, 120, 146), // E + new Color(39, 153, 255), // G + new Color(219, 197, 142), // H + new Color(250, 33, 161), // I + new Color(224, 30, 130), // L + new Color(222, 190, 204), // K + new Color(209, 62, 123), // M + new Color(255, 56, 93), // F + new Color(87, 102, 249), // P + new Color(231, 180, 253), // S + new Color(166, 88, 183), // T + new Color(255, 55, 1), // W + new Color(203, 83, 57), // Y + new Color(254, 81, 184), // V + Color.white, // B + Color.white, // Z + Color.white, // X + Color.white, // - + Color.white, // * + Color.white // . + }; + + public static final Color[] ocean = { new Color(198, 202, 155), // A + new Color(12, 160, 168), // R + new Color(10, 223, 195), // N + new Color(76, 223, 161), // D + new Color(198, 129, 54), // C + new Color(139, 211, 209), // Q + new Color(96, 218, 201), // E + new Color(51, 165, 81), // G + new Color(0, 207, 254), // H + new Color(242, 186, 170), // I + new Color(187, 138, 131), // L + new Color(64, 160, 144), // K + new Color(164, 139, 136), // M + new Color(171, 136, 174), // F + new Color(175, 211, 101), // P + new Color(109, 155, 116), // S + new Color(141, 149, 102), // T + new Color(117, 138, 238), // W + new Color(186, 195, 252), // Y + new Color(233, 190, 164), // V + Color.white, // B + Color.white, // Z + Color.white, // X + Color.white, // - + Color.white, // * + Color.white // . + }; + // Dunno where I got these numbers from public static final double[] hyd2 = { 0.62, // A 0.29, // R diff --git a/src/jalview/schemes/SunsetColourScheme.java b/src/jalview/schemes/SunsetColourScheme.java new file mode 100755 index 0000000..4af7566 --- /dev/null +++ b/src/jalview/schemes/SunsetColourScheme.java @@ -0,0 +1,64 @@ +/* + * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) + * Copyright (C) $$Year-Rel$$ The Jalview Authors + * + * This file is part of Jalview. + * + * Jalview is free software: you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation, either version 3 + * of the License, or (at your option) any later version. + * + * Jalview is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Jalview. If not, see . + * The Jalview Authors are detailed in the 'AUTHORS' file. + */ +package jalview.schemes; + +import jalview.api.AlignViewportI; +import jalview.datamodel.AnnotatedCollectionI; + +/** + * DOCUMENT ME! + * + * @author $author$ + * @version $Revision$ + */ +public class SunsetColourScheme extends ResidueColourScheme +{ + /** + * Creates a new SunsetColourScheme object. + */ + public SunsetColourScheme() + { + super(ResidueProperties.aaIndex, ResidueProperties.sunset); + } + + @Override + public boolean isPeptideSpecific() + { + return true; + } + + @Override + public String getSchemeName() + { + return JalviewColourScheme.Sunset.toString(); + } + + /** + * Returns a new instance of this colour scheme with which the given data may + * be coloured + */ + @Override + public ColourSchemeI getInstance(AlignViewportI view, + AnnotatedCollectionI coll) + { + return new SunsetColourScheme(); + } +} -- 1.7.10.2