From: gmungoc Date: Wed, 29 Mar 2017 08:20:13 +0000 (+0100) Subject: JAL-2416 explicit constant for unknown/unknown identity score (* X-Git-Tag: Release_2_10_2~3^2~105^2~2^2~35 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=ae783be4cfa1df7fd59a4d0895df8bd1534d334c;p=jalview.git JAL-2416 explicit constant for unknown/unknown identity score (* diagonal), comments --- diff --git a/src/jalview/analysis/scoremodels/ScoreMatrix.java b/src/jalview/analysis/scoremodels/ScoreMatrix.java index 7e07b9f..e2c14e9 100644 --- a/src/jalview/analysis/scoremodels/ScoreMatrix.java +++ b/src/jalview/analysis/scoremodels/ScoreMatrix.java @@ -38,6 +38,13 @@ public class ScoreMatrix implements SimilarityScoreModelI, PairwiseScoreModelI { /* + * an arbitrary score to assign for identity of an unknown symbol + * (this is the value on the diagonal in the * column of the NCBI matrix) + * (though a case could be made for using the minimum diagonal value) + */ + private static final int UNKNOWN_IDENTITY_SCORE = 1; + + /* * this fields records which gap character (if any) is used in the alphabet; * space, dash or dot are recognised as gap symbols */ @@ -316,8 +323,11 @@ public class ScoreMatrix implements SimilarityScoreModelI, /* * one or both symbols not found in the matrix + * currently scoring as 1 (for identity) or the minimum + * matrix score value (otherwise) + * (a case could be made for using minimum row/column value instead) */ - return c == d ? 1 : getMinimumScore(); + return c == d ? UNKNOWN_IDENTITY_SCORE : getMinimumScore(); } /**