1 package jalview.schemes;
\r
3 import jalview.datamodel.*;
\r
7 public class ResidueColourScheme implements ColourSchemeI{
\r
10 public Vector consensus;
\r
12 public ResidueColourScheme(Color[] colors, int threshold) {
\r
13 this.colors = colors;
\r
14 this.threshold = threshold;
\r
17 public ResidueColourScheme()
\r
20 public void setConsensus(Vector consensus)
\r
22 this.consensus = consensus;
\r
25 public Color findColour(String aa)
\r
27 return colors[((Integer)(ResidueProperties.aaHash.get(aa))).intValue()];
\r
30 public Color findColour(String s, int j) {
\r
32 if( threshold==0 || aboveThreshold(s,j))
\r
33 return colors[((Integer)(ResidueProperties.aaHash.get(s))).intValue()];
\r
39 public int getThreshold() {
\r
43 public void setThreshold(int ct) {
\r
47 public boolean aboveThreshold(String s, int j)
\r
49 Hashtable hash = (Hashtable)consensus.elementAt(j);
\r
51 if ( ( (Integer) hash.get("maxCount")).intValue() != -1 && hash.contains(s))
\r
53 //// resCount//////////////////// ///////////////seq count////////////
\r
54 double sc = ( (Integer) hash.get(s)).intValue() * 100.0 / ( (Integer) hash.get("size")).intValue();
\r
56 if (sc >= threshold)
\r
64 public boolean canThreshold() {
\r
67 public boolean isUserDefinable() {
\r