X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fanalysis%2Fscoremodels%2FSimilarityParams.java;h=e5751ca6e61d6aac1a3eb1b7a3ccef14820d8689;hb=e529f0aa0690ac7a6f58677fd043135d21e5e148;hp=4cc5b1fd914667945e461b42e5a5391a93e0b810;hpb=8717834368bd00d8adfa47ee099288acd34363ef;p=jalview.git
diff --git a/src/jalview/analysis/scoremodels/SimilarityParams.java b/src/jalview/analysis/scoremodels/SimilarityParams.java
index 4cc5b1f..e5751ca 100644
--- a/src/jalview/analysis/scoremodels/SimilarityParams.java
+++ b/src/jalview/analysis/scoremodels/SimilarityParams.java
@@ -2,6 +2,18 @@ package jalview.analysis.scoremodels;
import jalview.api.analysis.SimilarityParamsI;
+/**
+ * A class to hold parameters that configure the pairwise similarity
+ * calculation. Based on the paper
+ *
+ *
+ * Quantification of the variation in percentage identity for protein sequence alignments
+ * Raghava, GP and Barton, GJ
+ * BMC Bioinformatics. 2006 Sep 19;7:415
+ *
+ *
+ * @see https://www.ncbi.nlm.nih.gov/pubmed/16984632
+ */
public class SimilarityParams implements SimilarityParamsI
{
/**
@@ -19,29 +31,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
+ *
+ * - ignores gap-gap
+ * - does not score gap-residue
+ * - includes gap-residue in lengths
+ * - matches on longer of two sequences
+ *
*/
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
+ *
+ * - ignores gap-gap
+ * - ignores gap-residue
+ * - matches on longer of two sequences
+ *
*/
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
+ *
+ * - ignores gap-gap
+ * - ignores gap-residue
+ * - matches on shorter of sequences only
+ *
*/
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
+ *
+ * - ignores gap-gap
+ * - does not score gap-residue
+ * - includes gap-residue in lengths
+ * - matches on shorter of sequences only
+ *
*/
public static final SimilarityParamsI PID4 = new SimilarityParams(false,
false, true, true);
@@ -50,7 +80,7 @@ public class SimilarityParams implements SimilarityParamsI
private boolean matchGaps;
- private boolean denominatorIncludesGaps;
+ private boolean includeGaps;
private boolean denominateByShortestLength;
@@ -58,26 +88,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)
*/
- 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 denominatorIncludesGaps()
+ public boolean includeGaps()
{
- return denominatorIncludesGaps;
+ return includeGaps;
}
@Override