Clover icon

jalviewX

  1. Project Clover database Wed Oct 31 2018 15:13:58 GMT
  2. Package jalview.json.binding.biojson.v1

File ColourSchemeMapper.java

 

Coverage histogram

../../../../../img/srcFileCovDistChart3.png
47% of files have more coverage

Code metrics

6
54
2
1
111
88
28
0.52
27
2
14

Classes

Class Line # Actions
ColourSchemeMapper 41 54 28 43
0.3064516230.6%
 

Contributing tests

This file is covered by 2 tests. .

Source view

1    /*
2    * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3    * Copyright (C) $$Year-Rel$$ The Jalview Authors
4    *
5    * This file is part of Jalview.
6    *
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.
11    *
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.
16    *
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.
20    */
21    package jalview.json.binding.biojson.v1;
22   
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;
40   
 
41    public class ColourSchemeMapper
42    {
43    private static ColourSchemeI csZappo, csTaylor, csNucleotide, csPurine,
44    csHelix, csTurn, csStrand, csBuried, csHydro,
45    csRNAInteractionType, csPID, csBlosum62 = null;
 
46  1 toggle static
47    {
48  1 csZappo = new ZappoColourScheme();
49  1 csTaylor = new TaylorColourScheme();
50  1 csNucleotide = new NucleotideColourScheme();
51  1 csPurine = new PurinePyrimidineColourScheme();
52  1 csHelix = new HelixColourScheme();
53  1 csTurn = new TurnColourScheme();
54  1 csStrand = new StrandColourScheme();
55  1 csBuried = new BuriedColourScheme();
56  1 csHydro = new HydrophobicColourScheme();
57  1 csRNAInteractionType = new RNAInteractionColourScheme();
58  1 csPID = new PIDColourScheme();
59  1 csBlosum62 = new Blosum62ColourScheme();
60    }
61   
 
62  8 toggle public static ColourSchemeI getJalviewColourScheme(
63    String colourSchemeName, AnnotatedCollectionI annotCol)
64    {
65  8 switch (colourSchemeName.toUpperCase())
66    {
67  6 case "ZAPPO":
68  6 return csZappo;
69  0 case "TAYLOR":
70  0 return csTaylor;
71  0 case "NUCLEOTIDE":
72  0 return csNucleotide;
73  0 case "PURINE":
74  0 case "PURINE/PYRIMIDINE":
75  0 return csPurine;
76  0 case "HELIX":
77  0 case "HELIX PROPENSITY":
78  0 return csHelix;
79  0 case "TURN":
80  0 case "TURN PROPENSITY":
81  0 return csTurn;
82  0 case "STRAND":
83  0 case "STRAND PROPENSITY":
84  0 return csStrand;
85  0 case "BURIED":
86  0 case "BURIED INDEX":
87  0 return csBuried;
88  0 case "HYDRO":
89  0 case "HYDROPHOBIC":
90  0 return csHydro;
91  0 case "RNA INTERACTION TYPE":
92  0 return csRNAInteractionType;
93  0 case "PID":
94  0 case "% IDENTITY":
95  0 return csPID;
96  0 case "BLOSUM62":
97  0 return csBlosum62;
98  0 case "T-COFFEE SCORES":
99  0 return (annotCol != null) ? new TCoffeeColourScheme(annotCol) : null;
100  0 case "RNA HELICES":
101  0 return (annotCol != null) ? new RNAHelicesColour(annotCol) : null;
102  0 case "CLUSTAL":
103  0 return (annotCol != null) ? new ClustalxColourScheme(annotCol, null)
104    : null;
105  0 case "USER DEFINED":
106  0 return null;
107  2 default:
108  2 return null;
109    }
110    }
111    }