- * Computes a pairwise similarity matrix for the given sequence regions using
- * the configured score model. If the score model is a similarity model, then
- * it computes the result directly. If it is a distance model, then use it to
- * compute pairwise distances, and convert these to similarity scores by
- * substracting from the maximum value.
- *
- * @param av
- * @return
- */
- MatrixI computeSimilarity(AlignmentView av)
- {
- MatrixI result = null;
- // TODO pass choice of params from GUI in constructo
- if (scoreModel instanceof SimilarityScoreModelI)
- {
- result = ((SimilarityScoreModelI) scoreModel).findSimilarities(av,
- SimilarityParams.SeqSpace);
- }
- else if (scoreModel instanceof DistanceScoreModelI)
- {
- result = ((DistanceScoreModelI) scoreModel).findDistances(av,
- SimilarityParams.SeqSpace);
- result.reverseRange(false);
- }
- else
- {
- System.err
- .println("Unexpected type of score model, cannot calculate similarity");
- }
-
- return result;
- }
-
- public void setJvCalcMode(boolean calcMode)
- {
- this.jvCalcMode = calcMode;
- }
-
- /**