From d18ec5d6a72d262bbd6a8233010b92737b3840b7 Mon Sep 17 00:00:00 2001 From: jprocter Date: Wed, 13 Apr 2005 16:40:53 +0000 Subject: [PATCH] Fixed so that all alternate residues are used to calculate blosum62 conservation. --- src/jalview/schemes/Blosum62ColourScheme.java | 31 ++++++++++++++++++------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/src/jalview/schemes/Blosum62ColourScheme.java b/src/jalview/schemes/Blosum62ColourScheme.java index d0546dc..6c83920 100755 --- a/src/jalview/schemes/Blosum62ColourScheme.java +++ b/src/jalview/schemes/Blosum62ColourScheme.java @@ -38,20 +38,35 @@ public class Blosum62ColourScheme extends ResidueColourScheme public Color findColour(String s, int j, Vector aa) { + Hashtable hash; - if (!jalview.util.Comparison.isGap((s.charAt(0)))) - { - String max = av.getVisibleConsensus().charAt(j) + ""; + if (aa != null) + hash = (Hashtable)aa.elementAt(j); + else + return Color.white; - if (s.equals(max)) - return new Color(154, 154, 255); - else if (ResidueProperties.getBLOSUM62(max, s) > 0) + if (!jalview.util.Comparison.isGap((s.charAt(0)))) + { + String max = (String)hash.get("maxResidue"); + + if (max.indexOf(s)>-1) + return new Color(154, 154, 255); + else { + + int c = 0, + max_aa=0, + n=max.length(); + do { + c+=ResidueProperties.getBLOSUM62(max.substring(max_aa, max_aa+1), s); + } while (++max_aa0) return new Color(204, 204, 255); else return Color.white; - } - else + } + else return Color.white; } -- 1.7.10.2