2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $$Year-Rel$$ The Jalview Authors
5 * This file is part of Jalview.
7 * Jalview is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, either version 3
10 * of the License, or (at your option) any later version.
12 * Jalview is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19 * The Jalview Authors are detailed in the 'AUTHORS' file.
21 package jalview.json.binding.biojson.v1;
23 import jalview.datamodel.AnnotatedCollectionI;
24 import jalview.schemes.Blosum62ColourScheme;
25 import jalview.schemes.BuriedColourScheme;
26 import jalview.schemes.ClustalxColourScheme;
27 import jalview.schemes.ColourSchemeI;
28 import jalview.schemes.HelixColourScheme;
29 import jalview.schemes.HydrophobicColourScheme;
30 import jalview.schemes.NucleotideColourScheme;
31 import jalview.schemes.PIDColourScheme;
32 import jalview.schemes.PurinePyrimidineColourScheme;
33 import jalview.schemes.RNAHelicesColour;
34 import jalview.schemes.RNAInteractionColourScheme;
35 import jalview.schemes.StrandColourScheme;
36 import jalview.schemes.TCoffeeColourScheme;
37 import jalview.schemes.TaylorColourScheme;
38 import jalview.schemes.TurnColourScheme;
39 import jalview.schemes.ZappoColourScheme;
41 public class ColourSchemeMapper
43 private static ColourSchemeI csZappo, csTaylor, csNucleotide, csPurine,
44 csHelix, csTurn, csStrand, csBuried, csHydro,
45 csRNAInteractionType, csPID, csBlosum62 = null;
48 csZappo = new ZappoColourScheme();
49 csTaylor = new TaylorColourScheme();
50 csNucleotide = new NucleotideColourScheme();
51 csPurine = new PurinePyrimidineColourScheme();
52 csHelix = new HelixColourScheme();
53 csTurn = new TurnColourScheme();
54 csStrand = new StrandColourScheme();
55 csBuried = new BuriedColourScheme();
56 csHydro = new HydrophobicColourScheme();
57 csRNAInteractionType = new RNAInteractionColourScheme();
58 csPID = new PIDColourScheme();
59 csBlosum62 = new Blosum62ColourScheme();
62 public static ColourSchemeI getJalviewColourScheme(
63 String colourSchemeName, AnnotatedCollectionI annotCol)
65 switch (colourSchemeName.toUpperCase())
74 case "PURINE/PYRIMIDINE":
77 case "HELIX PROPENSITY":
80 case "TURN PROPENSITY":
83 case "STRAND PROPENSITY":
91 case "RNA INTERACTION TYPE":
92 return csRNAInteractionType;
98 case "T-COFFEE SCORES":
99 return (annotCol != null) ? new TCoffeeColourScheme(annotCol) : null;
101 return (annotCol != null) ? new RNAHelicesColour(annotCol) : null;
103 return (annotCol != null) ? new ClustalxColourScheme(annotCol, null)