From: jprocter Date: Wed, 13 Apr 2005 16:40:53 +0000 (+0000) Subject: Fixed so that all alternate residues are used to calculate blosum62 X-Git-Tag: Release_2_0~428 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=d18ec5d6a72d262bbd6a8233010b92737b3840b7;p=jalview.git Fixed so that all alternate residues are used to calculate blosum62 conservation. --- 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; }