JAL-2416 use '-' not space for gap in score matrices
[jalview.git] / test / jalview / analysis / scoremodels / ScoreMatrixTest.java
index 5051bf6..5c699d1 100644 (file)
@@ -148,10 +148,10 @@ public class ScoreMatrixTest
     assertEquals(sm.getMatrixIndex('D'), 3);
     assertEquals(sm.getMatrixIndex('X'), 22);
     assertEquals(sm.getMatrixIndex('x'), 22);
-    assertEquals(sm.getMatrixIndex(' '), 23);
+    assertEquals(sm.getMatrixIndex('-'), 23);
     assertEquals(sm.getMatrixIndex('*'), 24);
     assertEquals(sm.getMatrixIndex('.'), -1);
-    assertEquals(sm.getMatrixIndex('-'), -1);
+    assertEquals(sm.getMatrixIndex(' '), -1);
     assertEquals(sm.getMatrixIndex('?'), -1);
     assertEquals(sm.getMatrixIndex((char) 128), -1);
   }
@@ -167,10 +167,9 @@ public class ScoreMatrixTest
   public void testComputePairwiseScores()
   {
     /*
-     * NB score matrix assumes space for gap - Jalview converts
-     * space to gap before computing PCA or Tree
+     * NB score matrix expects '-' for gap
      */
-    String[] seqs = new String[] { "FKL", "R D", "QIA", "GWC" };
+    String[] seqs = new String[] { "FKL", "R-D", "QIA", "GWC" };
     ScoreMatrix sm = ScoreModels.getInstance().getBlosum62();
 
     MatrixI pairwise = sm.findSimilarities(seqs, SimilarityParams.Jalview);
@@ -253,16 +252,11 @@ public class ScoreMatrixTest
   @Test(groups = "Functional")
   public void testcomputeSimilarity_matchLongestSequence()
   {
-    // TODO params.matchGaps() is not used for ScoreMatrix
-    // - includeGaps is sufficient (there is no denominator)
-    // ==> bespoke parameters only 3 booleans?
     /*
-     * for now, using space for gap to match callers of
-     * AlignmentView.getSequenceStrings()
-     * may change this to '-' (with corresponding change to matrices)
+     * ScoreMatrix expects '-' for gaps
      */
-    String s1 = "FR K S";
-    String s2 = "FS  L";
+    String s1 = "FR-K-S";
+    String s2 = "FS--L";
     ScoreMatrix blosum = ScoreModels.getInstance().getBlosum62();
   
     /*
@@ -318,16 +312,11 @@ public class ScoreMatrixTest
   @Test(groups = "Functional")
   public void testcomputeSimilarity_matchShortestSequence()
   {
-    // TODO params.matchGaps() is not used for ScoreMatrix
-    // - includeGaps is sufficient (there is no denominator)
-    // ==> bespoke parameters only 3 booleans?
     /*
-     * for now, using space for gap to match callers of
-     * AlignmentView.getSequenceStrings()
-     * may change this to '-' (with corresponding change to matrices)
+     * ScoreMatrix expects '-' for gaps
      */
-    String s1 = "FR K S";
-    String s2 = "FS  L";
+    String s1 = "FR-K-S";
+    String s2 = "FS--L";
     ScoreMatrix blosum = ScoreModels.getInstance().getBlosum62();
 
     /*