1 package jalview.schemes;
\r
6 public class ResidueColourScheme implements ColourSchemeI{
\r
9 public Vector consensus;
\r
11 public ResidueColourScheme(Color[] colors, int threshold) {
\r
12 this.colors = colors;
\r
13 this.threshold = threshold;
\r
16 public ResidueColourScheme()
\r
19 public void setConsensus(Vector consensus)
\r
21 this.consensus = consensus;
\r
24 public Color findColour(String aa)
\r
26 return colors[((Integer)(ResidueProperties.aaHash.get(aa))).intValue()];
\r
29 public Color findColour(String s, int j) {
\r
31 if( threshold==0 || aboveThreshold(s,j))
\r
32 return colors[((Integer)(ResidueProperties.aaHash.get(s))).intValue()];
\r
38 public int getThreshold() {
\r
42 public void setThreshold(int ct) {
\r
46 public boolean aboveThreshold(String s, int j)
\r
48 Hashtable hash = (Hashtable)consensus.elementAt(j);
\r
50 if ( ( (Integer) hash.get("maxCount")).intValue() != -1 && hash.contains(s))
\r
52 //// resCount//////////////////// ///////////////seq count////////////
\r
53 double sc = ( (Integer) hash.get(s)).intValue() * 100.0 / ( (Integer) hash.get("size")).intValue();
\r
55 if (sc >= threshold)
\r