getSequenceAsString
[jalview.git] / src / MCview / PDBChain.java
index 5f23a26..0cb9f02 100755 (executable)
@@ -1,6 +1,6 @@
 /*\r
 * Jalview - A Sequence Alignment Editor and Viewer\r
-* Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle\r
+* Copyright (C) 2006 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle\r
 *\r
 * This program is free software; you can redistribute it and/or\r
 * modify it under the terms of the GNU General Public License\r
@@ -195,26 +195,26 @@ public class PDBChain {
             try {\r
                 Bond b = (Bond) bonds.elementAt(i);\r
 \r
-                if (b.at1.resName.toUpperCase().equals("ASP") ||\r
-                        b.at1.resName.toUpperCase().equals("GLU")) {\r
+                if (b.at1.resName.equalsIgnoreCase("ASP") ||\r
+                        b.at1.resName.equalsIgnoreCase("GLU")) {\r
                     b.startCol = Color.red;\r
-                } else if (b.at1.resName.toUpperCase().equals("LYS") ||\r
-                        b.at1.resName.toUpperCase().equals("ARG")) {\r
+                } else if (b.at1.resName.equalsIgnoreCase("LYS") ||\r
+                        b.at1.resName.equalsIgnoreCase("ARG")) {\r
                     b.startCol = Color.blue;\r
-                } else if (b.at1.resName.toUpperCase().equals("CYS")) {\r
+                } else if (b.at1.resName.equalsIgnoreCase("CYS")) {\r
                     b.startCol = Color.yellow;\r
                 } else {\r
                     //int atno = ((Integer) ResidueProperties.getAA3Hash().get(b.at1.resName.toUpperCase())).intValue();\r
                     b.startCol = Color.lightGray;\r
                 }\r
 \r
-                if (b.at2.resName.toUpperCase().equals("ASP") ||\r
-                        b.at2.resName.toUpperCase().equals("GLU")) {\r
+                if (b.at2.resName.equalsIgnoreCase("ASP") ||\r
+                        b.at2.resName.equalsIgnoreCase("GLU")) {\r
                     b.endCol = Color.red;\r
-                } else if (b.at2.resName.toUpperCase().equals("LYS") ||\r
-                        b.at2.resName.toUpperCase().equals("ARG")) {\r
+                } else if (b.at2.resName.equalsIgnoreCase("LYS") ||\r
+                        b.at2.resName.equalsIgnoreCase("ARG")) {\r
                     b.endCol = Color.blue;\r
-                } else if (b.at2.resName.toUpperCase().equals("CYS")) {\r
+                } else if (b.at2.resName.equalsIgnoreCase("CYS")) {\r
                     b.endCol = Color.yellow;\r
                 } else {\r
                     //int atno = ((Integer) ResidueProperties.getAA3Hash().get(b.at2.resName.toUpperCase())).intValue();\r
@@ -228,44 +228,27 @@ public class PDBChain {
         }\r
     }\r
 \r
-    public void setHydrophobicityColours() {\r
-        float hydmin = (float) ResidueProperties.getHydmin();\r
-        float hydmax = (float) ResidueProperties.getHydmax();\r
-        double[] hyd = ResidueProperties.getHyd();\r
-\r
-        Hashtable AA3Hash = ResidueProperties.getAA3Hash();\r
 \r
+    public void setChainColours(jalview.schemes.ColourSchemeI cs)\r
+    {\r
+        Bond b;\r
         for (int i = 0; i < bonds.size(); i++) {\r
             try {\r
-                Bond b = (Bond) bonds.elementAt(i);\r
-\r
-                int atno = ((Integer) AA3Hash.get(b.at1.resName.toUpperCase())).intValue();\r
-                float red = ((float) hyd[atno] - hydmin) / (hydmax - hydmin);\r
-\r
-                if (red > (float) 1.0) {\r
-                    red = (float) 1.0;\r
-                }\r
-\r
-                if (red < (float) 0.0) {\r
-                    red = (float) 0.0;\r
-                }\r
+              b = (Bond) bonds.elementAt(i);\r
 \r
-                b.startCol = new Color(red, (float) 0.0, (float) 1.0 - red);\r
-                atno = ((Integer) AA3Hash.get(b.at2.resName.toUpperCase())).intValue();\r
+            /*  ( (Bond) bonds.elementAt(i)).startCol = cs.findColour(\r
+                  ResidueProperties.codonTranslate(\r
+                      ResidueProperties.aa3Hash.get(b.at1.resName).toString().charAt(0)\r
+                  );\r
 \r
-                red = ((float) hyd[atno] - hydmin) / (hydmax - hydmin);\r
+              b.endCol = cs.findColour(\r
+                  ResidueProperties.aa[ ( (Integer) ResidueProperties.aa3Hash.\r
+                                         get(b.at2.resName)).intValue()]\r
+                  );*/\r
 \r
-                if (red > (float) 1.0) {\r
-                    red = (float) 1.0;\r
-                }\r
-\r
-                if (red < (float) 0.0) {\r
-                    red = (float) 0.0;\r
-                }\r
-\r
-                b.endCol = new Color(red, (float) 0.2, (float) 1.0 - red);\r
-            } catch (Exception e) {\r
-                Bond b = (Bond) bonds.elementAt(i);\r
+            } catch (Exception e)\r
+            {\r
+                b = (Bond) bonds.elementAt(i);\r
                 b.startCol = Color.gray;\r
                 b.endCol = Color.gray;\r
             }\r