package jalview.analysis.scoremodels;
import jalview.analysis.AlignSeq;
-import jalview.api.analysis.DistanceScoreModelI;
import jalview.api.analysis.SimilarityParamsI;
+import jalview.api.analysis.SimilarityScoreModelI;
import jalview.datamodel.AlignmentView;
import jalview.datamodel.SequenceI;
import jalview.math.Matrix;
import jalview.math.MatrixI;
import jalview.util.Comparison;
-public class SWDistanceModel implements DistanceScoreModelI
+/**
+ * A class that computes pairwise similarity scores using the Smith-Waterman
+ * alignment algorithm
+ */
+public class SmithWatermanModel implements SimilarityScoreModelI
{
+ private static final String NAME = "Smith Waterman Score";
@Override
- public MatrixI findDistances(AlignmentView seqData,
+ public MatrixI findSimilarities(AlignmentView seqData,
SimilarityParamsI options)
{
SequenceI[] sequenceString = seqData.getVisibleAlignment(
}
}
- for (int i = 0; i < (noseqs - 1); i++)
- {
- for (int j = i; j < noseqs; j++)
- {
- distances[i][j] = max - distances[i][j];
- distances[j][i] = distances[i][j];
- }
- }
-
return new Matrix(distances);
}
@Override
public String getName()
{
- return "Smith Waterman Score";
+ return NAME;
}
@Override