1 package jalview.analysis.scoremodels;
3 import jalview.api.analysis.SimilarityParamsI;
6 * A class to hold parameters that configure the pairwise similarity
7 * calculation. Based on the paper
10 * Quantification of the variation in percentage identity for protein sequence alignments
11 * Raghava, GP and Barton, GJ
12 * BMC Bioinformatics. 2006 Sep 19;7:415
15 * @see https://www.ncbi.nlm.nih.gov/pubmed/16984632
17 public class SimilarityParams implements SimilarityParamsI
20 * Based on Jalview's Comparison.PID method, which includes gaps and counts
21 * them as matching; it counts over the length of the shorter sequence
23 public static final SimilarityParamsI Jalview = new SimilarityParams(
24 true, true, true, true);
27 * 'SeqSpace' mode PCA calculation includes gaps but does not count them as
28 * matching; it uses the longest sequence length
30 public static final SimilarityParamsI SeqSpace = new SimilarityParams(
31 true, false, true, true);
34 * as described in the Raghava-Barton paper
36 * <li>ignores gap-gap</li>
37 * <li>does not score gap-residue</li>
38 * <li>includes gap-residue in lengths</li>
39 * <li>matches on longer of two sequences</li>
42 public static final SimilarityParamsI PID1 = new SimilarityParams(false,
46 * as described in the Raghava-Barton paper
48 * <li>ignores gap-gap</li>
49 * <li>ignores gap-residue</li>
50 * <li>matches on longer of two sequences</li>
53 public static final SimilarityParamsI PID2 = new SimilarityParams(false,
57 * as described in the Raghava-Barton paper
59 * <li>ignores gap-gap</li>
60 * <li>ignores gap-residue</li>
61 * <li>matches on shorter of sequences only</li>
64 public static final SimilarityParamsI PID3 = new SimilarityParams(false,
68 * as described in the Raghava-Barton paper
70 * <li>ignores gap-gap</li>
71 * <li>does not score gap-residue</li>
72 * <li>includes gap-residue in lengths</li>
73 * <li>matches on shorter of sequences only</li>
76 public static final SimilarityParamsI PID4 = new SimilarityParams(false,
79 private boolean includeGappedColumns;
81 private boolean matchGaps;
83 private boolean includeGaps;
85 private boolean denominateByShortestLength;
90 * @param includeGapGap
91 * @param matchGapResidue
92 * @param includeGapResidue
93 * if true, gapped positions are counted for normalisation by length
94 * @param shortestLength
95 * if true, the denominator is the shorter sequence length (possibly
98 public SimilarityParams(boolean includeGapGap, boolean matchGapResidue,
99 boolean includeGapResidue, boolean shortestLength)
101 includeGappedColumns = includeGapGap;
102 matchGaps = matchGapResidue;
103 includeGaps = includeGapResidue;
104 denominateByShortestLength = shortestLength;
108 public boolean includeGaps()
114 public boolean denominateByShortestLength()
116 return denominateByShortestLength;
120 public boolean includeGappedColumns()
122 return includeGappedColumns;
126 public boolean matchGaps()