JAL-2286 modal residue check + commenting
[jalview.git] / src / jalview / schemes / PIDColourScheme.java
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;
           }
         }