X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fschemes%2FResidueProperties.java;h=0b1b7cc943ba6d14aacdb10310d6108bfd004cb1;hb=a45b4529c64901e9e4b53b6c74ee804370c91002;hp=4d46279ba34d53b63fe75e00b2bc8f82be8bacd6;hpb=a0559d1b4aa6c156f413cde0e7ae5c877cb3cbdb;p=jalview.git diff --git a/src/jalview/schemes/ResidueProperties.java b/src/jalview/schemes/ResidueProperties.java index 4d46279..0b1b7cc 100755 --- a/src/jalview/schemes/ResidueProperties.java +++ b/src/jalview/schemes/ResidueProperties.java @@ -20,10 +20,6 @@ */ package jalview.schemes; -import jalview.analysis.scoremodels.FeatureScoreModel; -import jalview.analysis.scoremodels.PIDScoreModel; -import jalview.api.analysis.ScoreModelI; - import java.awt.Color; import java.util.ArrayList; import java.util.Arrays; @@ -36,8 +32,6 @@ import java.util.Vector; public class ResidueProperties { - public static Hashtable scoreMatrices = new Hashtable(); - // Stores residue codes/names and colours and other things public static final int[] aaIndex; // aaHash version 2.1.1 and below @@ -477,7 +471,7 @@ public class ResidueProperties // public static final double hydmax = 1.38; // public static final double hydmin = -2.53; - private static final int[][] BLOSUM62 = { + public static final float[][] BLOSUM62 = { { 4, -1, -2, -2, 0, -1, -1, 0, -2, -1, -1, -1, -1, -2, -1, 1, 0, -3, -2, 0, -2, -1, 0, -4 }, { -1, 5, 0, -2, -3, 1, 0, -2, 0, -3, -2, 2, -1, -3, -2, -1, -1, -3, @@ -527,7 +521,7 @@ public class ResidueProperties { -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, 1 }, }; - static final int[][] PAM250 = { + public static final float[][] PAM250 = { { 2, -2, 0, 0, -2, 0, 0, 1, -1, -1, -2, -1, -1, -3, 1, 1, 1, -6, -3, 0, 0, 0, 0, -8 }, { -2, 6, 0, -1, -4, 1, -1, -3, 2, -2, -3, 3, 0, -4, 0, 0, -1, 2, -4, @@ -603,7 +597,8 @@ public class ResidueProperties // treats T and U identically. R and Y weak equivalence with AG and CTU. // N matches any other base weakly // - static final int[][] DNA = { { 10, -8, -8, -8, -8, 1, 1, 1, -8, 1, 1 }, // A + public static final float[][] DNA = { + { 10, -8, -8, -8, -8, 1, 1, 1, -8, 1, 1 }, // A { -8, 10, -8, -8, -8, 1, 1, -8, 1, 1, 1 }, // C { -8, -8, 10, -8, -8, 1, 1, 1, -8, 1, 1 }, // G { -8, -8, -8, 10, 10, 1, 1, -8, 1, 1, 1 }, // T @@ -620,18 +615,11 @@ public class ResidueProperties */ static { - scoreMatrices.put("BLOSUM62", new ScoreMatrix("BLOSUM62", BLOSUM62, 0)); - scoreMatrices.put("PAM250", new ScoreMatrix("PAM250", PAM250, 0)); - scoreMatrices.put("DNA", new ScoreMatrix("DNA", DNA, 1)); + // scoreMatrices.put("BLOSUM62", new ScoreMatrix("BLOSUM62", BLOSUM62)); + // scoreMatrices.put("PAM250", new ScoreMatrix("PAM250", PAM250)); + // scoreMatrices.put("DNA", new ScoreMatrix("DNA", DNA)); } - public static final Color[] pidColours = { midBlue, - new Color(153, 153, 255), - // Color.lightGray, - new Color(204, 204, 255), }; - - public static final float[] pidThresholds = { 80, 60, 40, }; - public static List STOP = Arrays.asList("TGA", "TAA", "TAG"); public static String START = "ATG"; @@ -1251,15 +1239,6 @@ public class ResidueProperties propMatrixPos[i][i] = maxP; propMatrixEpos[i][i] = maxEP; } - // JAL-1512 comment out physicochemical score matrices for 2.8.1 release - // scoreMatrices.put("Conservation Pos", new - // ScoreMatrix("Conservation Pos",propMatrixPos,0)); - // scoreMatrices.put("Conservation Both", new - // ScoreMatrix("Conservation Both",propMatrixF,0)); - // scoreMatrices.put("Conservation EnhPos", new - // ScoreMatrix("Conservation EnhPos",propMatrixEpos,0)); - scoreMatrices.put("PID", new PIDScoreModel()); - scoreMatrices.put("Displayed Features", new FeatureScoreModel()); } private ResidueProperties() @@ -1286,39 +1265,16 @@ public class ResidueProperties return aa3Hash; } - public static int[][] getDNA() - { - return ResidueProperties.DNA; - } - - public static int[][] getBLOSUM62() + public static float[][] getBLOSUM62() { return ResidueProperties.BLOSUM62; } - public static int getPAM250(String A1, String A2) + public static float getPAM250(String A1, String A2) { return getPAM250(A1.charAt(0), A2.charAt(0)); } - public static int getBLOSUM62(char c1, char c2) - { - int pog = 0; - - try - { - int a = aaIndex[c1]; - int b = aaIndex[c2]; - - pog = ResidueProperties.BLOSUM62[a][b]; - } catch (Exception e) - { - // System.out.println("Unknown residue in " + A1 + " " + A2); - } - - return pog; - } - public static String codonTranslate(String lccodon) { String cdn = codonHash2.get(lccodon.toUpperCase()); @@ -1329,49 +1285,12 @@ public class ResidueProperties return cdn; } - public static int[][] getDefaultPeptideMatrix() - { - return ResidueProperties.getBLOSUM62(); - } - - public static int[][] getDefaultDnaMatrix() - { - return ResidueProperties.getDNA(); - } - - /** - * get a ScoreMatrix based on its string name - * - * @param pwtype - * @return matrix in scoreMatrices with key pwtype or null - */ - public static ScoreMatrix getScoreMatrix(String pwtype) - { - Object val = scoreMatrices.get(pwtype); - if (val != null && val instanceof ScoreMatrix) - { - return (ScoreMatrix) val; - } - return null; - } - - /** - * get a ScoreModel based on its string name - * - * @param pwtype - * @return scoremodel of type pwtype or null - */ - public static ScoreModelI getScoreModel(String pwtype) - { - return scoreMatrices.get(pwtype); - } - - public static int getPAM250(char c, char d) + public static float getPAM250(char c, char d) { int a = aaIndex[c]; int b = aaIndex[d]; - int pog = ResidueProperties.PAM250[a][b]; + float pog = ResidueProperties.PAM250[a][b]; return pog; }