JAL-1632 'includeGaps' applied to FeatureDistanceModel (needs review)
[jalview.git] / src / jalview / analysis / scoremodels / SimilarityParams.java
index 556cdc1..35e3b9c 100644 (file)
@@ -19,29 +19,47 @@ public class SimilarityParams implements SimilarityParamsI
           true, false, true, true);
 
   /**
-   * as described in the Raghava-Barton paper; considers pairwise similarity
-   * only (excludes gap-gap) and does not match gaps
+   * as described in the Raghava-Barton paper
+   * <ul>
+   * <li>ignores gap-gap</li>
+   * <li>does not score gap-residue</li>
+   * <li>includes gap-residue in lengths</li>
+   * <li>matches on longer of two sequences</li>
+   * </ul>
    */
   public static final SimilarityParamsI PID1 = new SimilarityParams(false,
           false, true, false);
 
   /**
-   * as described in the Raghava-Barton paper; considers pairwise similarity
-   * only (excludes gap-gap) and does not match gaps
+   * as described in the Raghava-Barton paper
+   * <ul>
+   * <li>ignores gap-gap</li>
+   * <li>ignores gap-residue</li>
+   * <li>matches on longer of two sequences</li>
+   * </ul>
    */
   public static final SimilarityParamsI PID2 = new SimilarityParams(false,
           false, false, false);
 
   /**
-   * as described in the Raghava-Barton paper; considers pairwise similarity
-   * only (excludes gap-gap) and does not match gaps
+   * as described in the Raghava-Barton paper
+   * <ul>
+   * <li>ignores gap-gap</li>
+   * <li>ignores gap-residue</li>
+   * <li>matches on shorter of sequences only</li>
+   * </ul>
    */
   public static final SimilarityParamsI PID3 = new SimilarityParams(false,
           false, false, true);
 
   /**
-   * as described in the Raghava-Barton paper; considers pairwise similarity
-   * only (excludes gap-gap) and does not match gaps
+   * as described in the Raghava-Barton paper
+   * <ul>
+   * <li>ignores gap-gap</li>
+   * <li>does not score gap-residue</li>
+   * <li>includes gap-residue in lengths</li>
+   * <li>matches on shorter of sequences only</li>
+   * </ul>
    */
   public static final SimilarityParamsI PID4 = new SimilarityParams(false,
           false, true, true);
@@ -50,7 +68,7 @@ public class SimilarityParams implements SimilarityParamsI
 
   private boolean matchGaps;
 
-  private boolean denominatorIncludesGaps;
+  private boolean includeGaps;
 
   private boolean denominateByShortestLength;
 
@@ -58,26 +76,26 @@ public class SimilarityParams implements SimilarityParamsI
    * Constructor
    * 
    * @param includeGapGap
-   * @param matchGap
-   * @param includeGaps
-   *          if true, gapped positions are counted in the PID denominator
+   * @param matchGapResidue
+   * @param includeGapResidue
+   *          if true, gapped positions are counted for normalisation by length
    * @param shortestLength
    *          if true, the denominator is the shorter sequence length (possibly
    *          including gaps)
    */
-  public SimilarityParams(boolean includeGapGap, boolean matchGap,
-          boolean includeGaps, boolean shortestLength)
+  public SimilarityParams(boolean includeGapGap, boolean matchGapResidue,
+          boolean includeGapResidue, boolean shortestLength)
   {
     includeGappedColumns = includeGapGap;
-    matchGaps = matchGap;
-    denominatorIncludesGaps = includeGaps;
+    matchGaps = matchGapResidue;
+    includeGaps = includeGapResidue;
     denominateByShortestLength = shortestLength;
   }
 
   @Override
-  public boolean includesGaps()
+  public boolean includeGaps()
   {
-    return denominatorIncludesGaps;
+    return includeGaps;
   }
 
   @Override