1 package jalview.analysis.scoremodels;
3 import jalview.api.analysis.SimilarityParamsI;
5 public class SimilarityParams implements SimilarityParamsI
8 * Based on Jalview's Comparison.PID method, which includes gaps and counts
9 * them as matching; it counts over the length of the shorter sequence
11 public static final SimilarityParamsI Jalview = new SimilarityParams(
12 true, true, true, true);
15 * 'SeqSpace' mode PCA calculation includes gaps but does not count them as
16 * matching; it uses the longest sequence length
18 public static final SimilarityParamsI SeqSpace = new SimilarityParams(
19 true, false, true, true);
22 * as described in the Raghava-Barton paper
24 * <li>ignores gap-gap</li>
25 * <li>does not score gap-residue</li>
26 * <li>includes gap-residue in lengths</li>
27 * <li>matches on longer of two sequences</li>
30 public static final SimilarityParamsI PID1 = new SimilarityParams(false,
34 * as described in the Raghava-Barton paper
36 * <li>ignores gap-gap</li>
37 * <li>ignores gap-residue</li>
38 * <li>matches on longer of two sequences</li>
41 public static final SimilarityParamsI PID2 = new SimilarityParams(false,
45 * as described in the Raghava-Barton paper
47 * <li>ignores gap-gap</li>
48 * <li>ignores gap-residue</li>
49 * <li>matches on shorter of sequences only</li>
52 public static final SimilarityParamsI PID3 = new SimilarityParams(false,
56 * as described in the Raghava-Barton paper
58 * <li>ignores gap-gap</li>
59 * <li>does not score gap-residue</li>
60 * <li>includes gap-residue in lengths</li>
61 * <li>matches on shorter of sequences only</li>
64 public static final SimilarityParamsI PID4 = new SimilarityParams(false,
67 private boolean includeGappedColumns;
69 private boolean matchGaps;
71 private boolean includeGaps;
73 private boolean denominateByShortestLength;
78 * @param includeGapGap
79 * @param matchGapResidue
80 * @param includeGapResidue
81 * if true, gapped positions are counted for normalisation by length
82 * @param shortestLength
83 * if true, the denominator is the shorter sequence length (possibly
86 public SimilarityParams(boolean includeGapGap, boolean matchGapResidue,
87 boolean includeGapResidue, boolean shortestLength)
89 includeGappedColumns = includeGapGap;
90 matchGaps = matchGapResidue;
91 includeGaps = includeGapResidue;
92 denominateByShortestLength = shortestLength;
96 public boolean includeGaps()
102 public boolean denominateByShortestLength()
104 return denominateByShortestLength;
108 public boolean includeGappedColumns()
110 return includeGappedColumns;
114 public boolean matchGaps()