JAL-98 ProfilesI container for profiles for columns
[jalview.git] / src / jalview / schemes / PIDColourScheme.java
index ccc69c2..0ad5b5c 100755 (executable)
@@ -20,6 +20,7 @@
  */
 package jalview.schemes;
 
+import jalview.datamodel.ProfileI;
 import jalview.datamodel.SequenceGroup;
 import jalview.datamodel.SequenceI;
 import jalview.util.Comparison;
@@ -48,7 +49,7 @@ public class PIDColourScheme extends ResidueColourScheme
       c -= ('a' - 'A');
     }
 
-    if (consensus == null || j >= consensus.length || consensus[j] == null)
+    if (consensus == null || consensus.get(j) == null)
     {
       return Color.white;
     }
@@ -62,19 +63,16 @@ public class PIDColourScheme extends ResidueColourScheme
 
     double sc = 0;
 
-    if (consensus.length <= j)
-    {
-      return Color.white;
-    }
 
     /*
      * test whether this is the consensus (or joint consensus) residue
      */
-    boolean matchesConsensus = consensus[j].getModalResidue().contains(
+    ProfileI profile = consensus.get(j);
+    boolean matchesConsensus = profile.getModalResidue().contains(
             String.valueOf(c));
     if (matchesConsensus)
     {
-      sc = consensus[j].getPercentageIdentity(ignoreGaps);
+      sc = profile.getPercentageIdentity(ignoreGaps);
 
       if (!Comparison.isGap(c))
       {