X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fschemes%2FScoreMatrix.java;h=69a0922e37c55c2e3f32efe72109b574825ea9a1;hb=7bc226b58110fa26d9dbd3f0c78095d06909ffc3;hp=03b6778cf32828bef78cdbc71423111c633c6f2a;hpb=dd74fc4938723fe5ec48d4e5fdcfbe58ac42a48d;p=jalview.git diff --git a/src/jalview/schemes/ScoreMatrix.java b/src/jalview/schemes/ScoreMatrix.java index 03b6778..69a0922 100644 --- a/src/jalview/schemes/ScoreMatrix.java +++ b/src/jalview/schemes/ScoreMatrix.java @@ -1,6 +1,7 @@ package jalview.schemes; -public class ScoreMatrix { +public class ScoreMatrix +{ String name; /** * reference to integer score matrix @@ -10,36 +11,48 @@ public class ScoreMatrix { * 0 for Protein Score matrix. 1 for dna score matrix */ int type; - ScoreMatrix(String name, int[][] matrix, int type) { - this.matrix=matrix; - this.type=type; + ScoreMatrix(String name, int[][] matrix, int type) + { + this.matrix = matrix; + this.type = type; } - public boolean isDNA() { - return type==1; + + public boolean isDNA() + { + return type == 1; } - public boolean isProtein() { - return type==0; + + public boolean isProtein() + { + return type == 0; } - public int[][] getMatrix() { + + public int[][] getMatrix() + { return matrix; } + /** - * + * * @param A1 * @param A2 * @return score for substituting first char in A1 with first char in A2 */ public int getPairwiseScore(String A1, String A2) { - return getPairwiseScore(A1.charAt(0),A2.charAt(0)); + return getPairwiseScore(A1.charAt(0), A2.charAt(0)); } - public int getPairwiseScore(char c, char d) { + + public int getPairwiseScore(char c, char d) + { int pog = 0; try { - int a = (type==0) ? ResidueProperties.aaIndex[c] : ResidueProperties.nucleotideIndex[c]; - int b = (type==0) ? ResidueProperties.aaIndex[d] : ResidueProperties.nucleotideIndex[d]; + int a = (type == 0) ? ResidueProperties.aaIndex[c] : + ResidueProperties.nucleotideIndex[c]; + int b = (type == 0) ? ResidueProperties.aaIndex[d] : + ResidueProperties.nucleotideIndex[d]; pog = matrix[a][b]; }