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