1 package jalview.analysis.scoremodels;
3 import jalview.api.analysis.ScoreModelI;
4 import jalview.api.analysis.SimilarityParamsI;
5 import jalview.datamodel.AlignmentView;
6 import jalview.math.MatrixI;
8 public abstract class DistanceScoreModel implements ScoreModelI
11 * A similarity score is calculated by first computing a distance score, and
12 * then reversing the min-max range of the score values
15 public MatrixI findSimilarities(AlignmentView seqData,
16 SimilarityParamsI options)
18 MatrixI distances = findDistances(seqData, options);
20 MatrixI similarities = distanceToSimilarity(distances);
26 * Converts distance scores to similarity scores, by reversing the range of
27 * score values so that max becomes min and vice versa. The input matrix is
32 public static MatrixI distanceToSimilarity(MatrixI distances)
34 MatrixI similarities = distances.copy();
36 similarities.reverseRange(false);