JAL-2416 score matrix gap symbol (if any) dynamically determined
[jalview.git] / src / jalview / analysis / Conservation.java
index d1a3c37..55881d7 100755 (executable)
@@ -172,7 +172,7 @@ public class Conservation
    */
   private void calcSeqNum(int i, ScoreMatrix sm)
   {
-    int gapIndex = sm.getMatrixIndex(' ');
+    int gapIndex = sm.getGapIndex();
     int sSize = sequences.length;
 
     if ((i > -1) && (i < sSize))
@@ -554,7 +554,7 @@ public class Conservation
       calcSeqNum(i, sm);
     }
 
-    int gapIndex = sm.getMatrixIndex(' ');
+    int gapIndex = sm.getGapIndex();
 
     if ((cons2 == null) || seqNumsChanged)
     {
@@ -597,7 +597,6 @@ public class Conservation
     double max = -Double.MAX_VALUE;
     ScoreMatrix blosum62 = ScoreModels.getInstance().getBlosum62();
     float[][] blosumScores = blosum62.getMatrix();
-    int gapIndex = blosum62.getMatrixIndex(' ');
 
     // Loop over columns // JBPNote Profiling info
     // long ts = System.currentTimeMillis();
@@ -618,6 +617,7 @@ public class Conservation
     // todo ? remove '*' (unused?) from score matrix and
     // use getSize() here instead of getSize() - 1 ??
     final int symbolCount = blosum62.getSize() - 1; // 24;
+    int gapIndex = blosum62.getGapIndex();
 
     for (j = startRes; j <= endRes; j++)
     {