X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fschemes%2FResidueProperties.java;fp=src%2Fjalview%2Fschemes%2FResidueProperties.java;h=751175d8025f607e7a433933ebb36134bdf0e44c;hb=e0aacff0a162fdf1beb71cd5965b6ff4f8c9de0d;hp=1e6142d56a24ca4368ea041cc9c6025f3056cc79;hpb=627a783b3535fc5ac2a2b2354ee3f61006f6c37f;p=jalview.git diff --git a/src/jalview/schemes/ResidueProperties.java b/src/jalview/schemes/ResidueProperties.java index 1e6142d..751175d 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,105 +471,6 @@ public class ResidueProperties // public static final double hydmax = 1.38; // public static final double hydmin = -2.53; - private static final int[][] 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, - -2, -3, -1, 0, -1, -4 }, - { -2, 0, 6, 1, -3, 0, 0, 0, 1, -3, -3, 0, -2, -3, -2, 1, 0, -4, -2, - -3, 3, 0, -1, -4 }, - { -2, -2, 1, 6, -3, 0, 2, -1, -1, -3, -4, -1, -3, -3, -1, 0, -1, -4, - -3, -3, 4, 1, -1, -4 }, - { 0, -3, -3, -3, 9, -3, -4, -3, -3, -1, -1, -3, -1, -2, -3, -1, -1, - -2, -2, -1, -3, -3, -2, -4 }, - { -1, 1, 0, 0, -3, 5, 2, -2, 0, -3, -2, 1, 0, -3, -1, 0, -1, -2, -1, - -2, 0, 3, -1, -4 }, - { -1, 0, 0, 2, -4, 2, 5, -2, 0, -3, -3, 1, -2, -3, -1, 0, -1, -3, -2, - -2, 1, 4, -1, -4 }, - { 0, -2, 0, -1, -3, -2, -2, 6, -2, -4, -4, -2, -3, -3, -2, 0, -2, -2, - -3, -3, -1, -2, -1, -4 }, - { -2, 0, 1, -1, -3, 0, 0, -2, 8, -3, -3, -1, -2, -1, -2, -1, -2, -2, - 2, -3, 0, 0, -1, -4 }, - { -1, -3, -3, -3, -1, -3, -3, -4, -3, 4, 2, -3, 1, 0, -3, -2, -1, -3, - -1, 3, -3, -3, -1, -4 }, - { -1, -2, -3, -4, -1, -2, -3, -4, -3, 2, 4, -2, 2, 0, -3, -2, -1, -2, - -1, 1, -4, -3, -1, -4 }, - { -1, 2, 0, -1, -3, 1, 1, -2, -1, -3, -2, 5, -1, -3, -1, 0, -1, -3, - -2, -2, 0, 1, -1, -4 }, - { -1, -1, -2, -3, -1, 0, -2, -3, -2, 1, 2, -1, 5, 0, -2, -1, -1, -1, - -1, 1, -3, -1, -1, -4 }, - { -2, -3, -3, -3, -2, -3, -3, -3, -1, 0, 0, -3, 0, 6, -4, -2, -2, 1, - 3, -1, -3, -3, -1, -4 }, - { -1, -2, -2, -1, -3, -1, -1, -2, -2, -3, -3, -1, -2, -4, 7, -1, -1, - -4, -3, -2, -2, -1, -2, -4 }, - { 1, -1, 1, 0, -1, 0, 0, 0, -1, -2, -2, 0, -1, -2, -1, 4, 1, -3, -2, - -2, 0, 0, 0, -4 }, - { 0, -1, 0, -1, -1, -1, -1, -2, -2, -1, -1, -1, -1, -2, -1, 1, 5, -2, - -2, 0, -1, -1, 0, -4 }, - { -3, -3, -4, -4, -2, -2, -3, -2, -2, -3, -2, -3, -1, 1, -4, -3, -2, - 11, 2, -3, -4, -3, -2, -4 }, - { -2, -2, -2, -3, -2, -1, -2, -3, 2, -1, -1, -2, -1, 3, -3, -2, -2, - 2, 7, -1, -3, -2, -1, -4 }, - { 0, -3, -3, -3, -1, -2, -2, -3, -3, 3, 1, -2, 1, -1, -2, -2, 0, -3, - -1, 4, -3, -2, -1, -4 }, - { -2, -1, 3, 4, -3, 0, 1, -1, 0, -3, -4, 0, -3, -3, -2, 0, -1, -4, - -3, -3, 4, 1, -1, -4 }, - { -1, 0, 0, 1, -3, 3, 4, -2, 0, -3, -3, 1, -1, -3, -1, 0, -1, -3, -2, - -2, 1, 4, -1, -4 }, - { 0, -1, -1, -1, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -2, 0, 0, - -2, -1, -1, -1, -1, -1, -4 }, - { -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 = { - { 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, - -2, -1, 0, -1, -8 }, - { 0, 0, 2, 2, -4, 1, 1, 0, 2, -2, -3, 1, -2, -3, 0, 1, 0, -4, -2, -2, - 2, 1, 0, -8 }, - { 0, -1, 2, 4, -5, 2, 3, 1, 1, -2, -4, 0, -3, -6, -1, 0, 0, -7, -4, - -2, 3, 3, -1, -8 }, - { -2, -4, -4, -5, 12, -5, -5, -3, -3, -2, -6, -5, -5, -4, -3, 0, -2, - -8, 0, -2, -4, -5, -3, -8 }, - { 0, 1, 1, 2, -5, 4, 2, -1, 3, -2, -2, 1, -1, -5, 0, -1, -1, -5, -4, - -2, 1, 3, -1, -8 }, - { 0, -1, 1, 3, -5, 2, 4, 0, 1, -2, -3, 0, -2, -5, -1, 0, 0, -7, -4, - -2, 3, 3, -1, -8 }, - { 1, -3, 0, 1, -3, -1, 0, 5, -2, -3, -4, -2, -3, -5, 0, 1, 0, -7, -5, - -1, 0, 0, -1, -8 }, - { -1, 2, 2, 1, -3, 3, 1, -2, 6, -2, -2, 0, -2, -2, 0, -1, -1, -3, 0, - -2, 1, 2, -1, -8 }, - { -1, -2, -2, -2, -2, -2, -2, -3, -2, 5, 2, -2, 2, 1, -2, -1, 0, -5, - -1, 4, -2, -2, -1, -8 }, - { -2, -3, -3, -4, -6, -2, -3, -4, -2, 2, 6, -3, 4, 2, -3, -3, -2, -2, - -1, 2, -3, -3, -1, -8 }, - { -1, 3, 1, 0, -5, 1, 0, -2, 0, -2, -3, 5, 0, -5, -1, 0, 0, -3, -4, - -2, 1, 0, -1, -8 }, - { -1, 0, -2, -3, -5, -1, -2, -3, -2, 2, 4, 0, 6, 0, -2, -2, -1, -4, - -2, 2, -2, -2, -1, -8 }, - { -3, -4, -3, -6, -4, -5, -5, -5, -2, 1, 2, -5, 0, 9, -5, -3, -3, 0, - 7, -1, -4, -5, -2, -8 }, - { 1, 0, 0, -1, -3, 0, -1, 0, 0, -2, -3, -1, -2, -5, 6, 1, 0, -6, -5, - -1, -1, 0, -1, -8 }, - { 1, 0, 1, 0, 0, -1, 0, 1, -1, -1, -3, 0, -2, -3, 1, 2, 1, -2, -3, - -1, 0, 0, 0, -8 }, - { 1, -1, 0, 0, -2, -1, 0, 0, -1, 0, -2, 0, -1, -3, 0, 1, 3, -5, -3, - 0, 0, -1, 0, -8 }, - { -6, 2, -4, -7, -8, -5, -7, -7, -3, -5, -2, -3, -4, 0, -6, -2, -5, - 17, 0, -6, -5, -6, -4, -8 }, - { -3, -4, -2, -4, 0, -4, -4, -5, 0, -1, -1, -4, -2, 7, -5, -3, -3, 0, - 10, -2, -3, -4, -2, -8 }, - { 0, -2, -2, -2, -2, -2, -2, -1, -2, 4, 2, -2, 2, -1, -1, -1, 0, -6, - -2, 4, -2, -2, -1, -8 }, - { 0, -1, 2, 3, -4, 1, 3, 0, 1, -2, -3, 1, -2, -4, -1, 0, 0, -5, -3, - -2, 3, 2, -1, -8 }, - { 0, 0, 1, 3, -5, 3, 3, 0, 2, -2, -3, 0, -2, -5, 0, 0, -1, -6, -4, - -2, 2, 3, -1, -8 }, - { 0, -1, 0, -1, -3, -1, -1, -1, -1, -1, -1, -1, -1, -2, -1, 0, 0, -4, - -2, -1, -1, -1, -1, -8 }, - { -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, - -8, -8, -8, -8, -8, -8, 1 }, }; // not currently used // public static final Map ssHash = new Hashtable STOP = Arrays.asList("TGA", "TAA", "TAG"); public static String START = "ATG"; @@ -1244,15 +1112,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() @@ -1279,39 +1138,6 @@ public class ResidueProperties return aa3Hash; } - public static int[][] getDNA() - { - return ResidueProperties.DNA; - } - - public static int[][] getBLOSUM62() - { - return ResidueProperties.BLOSUM62; - } - - public static int 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()); @@ -1322,53 +1148,6 @@ 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) - { - int a = aaIndex[c]; - int b = aaIndex[d]; - - int pog = ResidueProperties.PAM250[a][b]; - - return pog; - } - public static Hashtable toDssp3State; static {