Show all hydrophobic residues
authoramwaterhouse <Andrew Waterhouse>
Tue, 16 Nov 2004 15:16:17 +0000 (15:16 +0000)
committeramwaterhouse <Andrew Waterhouse>
Tue, 16 Nov 2004 15:16:17 +0000 (15:16 +0000)
src/jalview/gui/ColourKey.java

index 4dd62a2..ab399ec 100755 (executable)
@@ -116,8 +116,8 @@ protected void taylorMenuItem_actionPerformed(ActionEvent e)
 {\r
   menu.setText("Taylor colour scheme");\r
   String [] res = new String[]{"A","V","I","L","M","F","Y","W","H","R","K","N","Q","E","D","S","T","G","P","C"};\r
-  Color [] col = new Color[20];\r
-  for (int i=0; i<20; i++)\r
+  Color [] col = new Color[res.length];\r
+  for (int i=0; i<res.length; i++)\r
     col[i] = ResidueProperties.taylor[ ((Integer)ResidueProperties.aaHash.get(res[i])).intValue() ];\r
 \r
 \r
@@ -130,9 +130,9 @@ protected void hydroMenuItem_actionPerformed(ActionEvent e)
 \r
   menu.setText("Hydrophobicity colour scheme");\r
   String [] res = new String[]{"I","V","L","F","C","M","A","G","X","T","S","W","Y","P","H","E","Z","Q","D","B","N","K","R"};\r
-  Color [] col = new Color[20];\r
+  Color [] col = new Color[res.length];\r
   HydrophobicColourScheme cs = new HydrophobicColourScheme();\r
-  for (int i=0; i<20; i++)\r
+  for (int i=0; i<res.length; i++)\r
     col[i] = cs.findColour(null,  res[i], -1,  null);\r
 \r
   displayKey( res, null, col, "According to the hydrophobicity table of  Kyte, J., and Doolittle, R.F., J. Mol. Biol. 1157, 105-132, 1982.  The most hydrophobic residues according to this table are coloured red and the most hydrophilic ones are coloured blue.");\r