1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
package jalview.json.binding.biojson.v1; |
22 |
|
|
23 |
|
import java.util.Locale; |
24 |
|
|
25 |
|
import jalview.datamodel.AnnotatedCollectionI; |
26 |
|
import jalview.schemes.Blosum62ColourScheme; |
27 |
|
import jalview.schemes.BuriedColourScheme; |
28 |
|
import jalview.schemes.ClustalxColourScheme; |
29 |
|
import jalview.schemes.ColourSchemeI; |
30 |
|
import jalview.schemes.HelixColourScheme; |
31 |
|
import jalview.schemes.HydrophobicColourScheme; |
32 |
|
import jalview.schemes.NucleotideColourScheme; |
33 |
|
import jalview.schemes.PIDColourScheme; |
34 |
|
import jalview.schemes.PurinePyrimidineColourScheme; |
35 |
|
import jalview.schemes.RNAHelicesColour; |
36 |
|
import jalview.schemes.RNAInteractionColourScheme; |
37 |
|
import jalview.schemes.StrandColourScheme; |
38 |
|
import jalview.schemes.TCoffeeColourScheme; |
39 |
|
import jalview.schemes.TaylorColourScheme; |
40 |
|
import jalview.schemes.TurnColourScheme; |
41 |
|
import jalview.schemes.ZappoColourScheme; |
42 |
|
|
|
|
| 30.6% |
Uncovered Elements: 43 (62) |
Complexity: 28 |
Complexity Density: 0.52 |
|
43 |
|
public class ColourSchemeMapper |
44 |
|
{ |
45 |
|
private static ColourSchemeI csZappo, csTaylor, csNucleotide, csPurine, |
46 |
|
csHelix, csTurn, csStrand, csBuried, csHydro, |
47 |
|
csRNAInteractionType, csPID, csBlosum62 = null; |
|
|
| 100% |
Uncovered Elements: 0 (12) |
Complexity: 1 |
Complexity Density: 0.08 |
|
48 |
1 |
static... |
49 |
|
{ |
50 |
1 |
csZappo = new ZappoColourScheme(); |
51 |
1 |
csTaylor = new TaylorColourScheme(); |
52 |
1 |
csNucleotide = new NucleotideColourScheme(); |
53 |
1 |
csPurine = new PurinePyrimidineColourScheme(); |
54 |
1 |
csHelix = new HelixColourScheme(); |
55 |
1 |
csTurn = new TurnColourScheme(); |
56 |
1 |
csStrand = new StrandColourScheme(); |
57 |
1 |
csBuried = new BuriedColourScheme(); |
58 |
1 |
csHydro = new HydrophobicColourScheme(); |
59 |
1 |
csRNAInteractionType = new RNAInteractionColourScheme(); |
60 |
1 |
csPID = new PIDColourScheme(); |
61 |
1 |
csBlosum62 = new Blosum62ColourScheme(); |
62 |
|
} |
63 |
|
|
|
|
| 10.4% |
Uncovered Elements: 43 (48) |
Complexity: 27 |
Complexity Density: 0.64 |
|
64 |
8 |
public static ColourSchemeI getJalviewColourScheme(... |
65 |
|
String colourSchemeName, AnnotatedCollectionI annotCol) |
66 |
|
{ |
67 |
8 |
switch (colourSchemeName.toUpperCase(Locale.ROOT)) |
68 |
|
{ |
69 |
5 |
case "ZAPPO": |
70 |
5 |
return csZappo; |
71 |
0 |
case "TAYLOR": |
72 |
0 |
return csTaylor; |
73 |
0 |
case "NUCLEOTIDE": |
74 |
0 |
return csNucleotide; |
75 |
0 |
case "PURINE": |
76 |
0 |
case "PURINE/PYRIMIDINE": |
77 |
0 |
return csPurine; |
78 |
0 |
case "HELIX": |
79 |
0 |
case "HELIX PROPENSITY": |
80 |
0 |
return csHelix; |
81 |
0 |
case "TURN": |
82 |
0 |
case "TURN PROPENSITY": |
83 |
0 |
return csTurn; |
84 |
0 |
case "STRAND": |
85 |
0 |
case "STRAND PROPENSITY": |
86 |
0 |
return csStrand; |
87 |
0 |
case "BURIED": |
88 |
0 |
case "BURIED INDEX": |
89 |
0 |
return csBuried; |
90 |
0 |
case "HYDRO": |
91 |
0 |
case "HYDROPHOBIC": |
92 |
0 |
return csHydro; |
93 |
0 |
case "RNA INTERACTION TYPE": |
94 |
0 |
return csRNAInteractionType; |
95 |
0 |
case "PID": |
96 |
0 |
case "% IDENTITY": |
97 |
0 |
return csPID; |
98 |
0 |
case "BLOSUM62": |
99 |
0 |
return csBlosum62; |
100 |
0 |
case "T-COFFEE SCORES": |
101 |
0 |
return (annotCol != null) ? new TCoffeeColourScheme(annotCol) : null; |
102 |
0 |
case "RNA HELICES": |
103 |
0 |
return (annotCol != null) ? new RNAHelicesColour(annotCol) : null; |
104 |
0 |
case "CLUSTAL": |
105 |
0 |
return (annotCol != null) ? new ClustalxColourScheme(annotCol, null) |
106 |
|
: null; |
107 |
0 |
case "USER DEFINED": |
108 |
0 |
return null; |
109 |
3 |
default: |
110 |
3 |
return null; |
111 |
|
} |
112 |
|
} |
113 |
|
} |