JAL-2286 modal residue check + commenting
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Wed, 26 Oct 2016 15:11:17 +0000 (16:11 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Wed, 26 Oct 2016 15:11:17 +0000 (16:11 +0100)
src/jalview/schemes/Blosum62ColourScheme.java
src/jalview/schemes/PIDColourScheme.java

index 8cb6ff0..37c31f9 100755 (executable)
@@ -57,6 +57,9 @@ public class Blosum62ColourScheme extends ResidueColourScheme
 
     if (!Comparison.isGap(res))
     {
+      /*
+       * test if this is the consensus (or joint consensus) residue
+       */
       String max = consensus[j].getModalResidue();
 
       if (max.indexOf(res) > -1)
index 5f63ca9..ccc69c2 100755 (executable)
@@ -22,6 +22,7 @@ package jalview.schemes;
 
 import jalview.datamodel.SequenceGroup;
 import jalview.datamodel.SequenceI;
+import jalview.util.Comparison;
 
 import java.awt.Color;
 
@@ -66,19 +67,22 @@ public class PIDColourScheme extends ResidueColourScheme
       return Color.white;
     }
 
-    if (consensus[j].getMaxCount() > 0) //!= -1)
-            //&& consensus[j].contains(String.valueOf(c)))
+    /*
+     * test whether this is the consensus (or joint consensus) residue
+     */
+    boolean matchesConsensus = consensus[j].getModalResidue().contains(
+            String.valueOf(c));
+    if (matchesConsensus)
     {
       sc = consensus[j].getPercentageIdentity(ignoreGaps);
 
-      if (!jalview.util.Comparison.isGap(c))
+      if (!Comparison.isGap(c))
       {
         for (int i = 0; i < thresholds.length; i++)
         {
           if (sc > thresholds[i])
           {
             currentColour = pidColours[i];
-
             break;
           }
         }