X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fschemes%2FResidueProperties.java;h=0ca155ac505df91fc5ec9b077f7a2e0edefe56f5;hb=28b416f0fdb491114107ef88f7b60baaca1d00d7;hp=4c8394ff147a72f91e7b18f8fbbd0eda7b927a5c;hpb=797df64fa2a0a30773d0f48f5494d4155e5a8be3;p=jalview.git diff --git a/src/jalview/schemes/ResidueProperties.java b/src/jalview/schemes/ResidueProperties.java index 4c8394f..0ca155a 100755 --- a/src/jalview/schemes/ResidueProperties.java +++ b/src/jalview/schemes/ResidueProperties.java @@ -1,13 +1,13 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7) - * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8) + * Copyright (C) 2012 J Procter, AM Waterhouse, LM Lui, J Engelhardt, G Barton, M Clamp, S Searle * * This file is part of Jalview. * * Jalview is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - * + * * Jalview is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR @@ -97,6 +97,16 @@ public class ResidueProperties // extend subt. matrices } + /** + * maximum (gap) index for matrices involving protein alphabet + */ + public final static int maxProteinIndex = 23; + + /** + * maximum (gap) index for matrices involving nucleotide alphabet + */ + public final static int maxNucleotideIndex = 10; + static { nucleotideIndex = new int[255]; @@ -572,18 +582,24 @@ public class ResidueProperties * new Color(60, 136, 238), // U Color.white, // I Color.white, // X * Color.white, // R Color.white, // Y Color.white, // N Color.white, // Gap */ + + // JBPNote: patch matrix for T/U equivalence when working with DNA or RNA. + // Will equate sequences if working with mixed nucleotide sets. + // 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, 1, 0, 0, 0, 0, 0, 1 }, // C - { -8, 10, -8, -8, 1, 0, 0, 0, 0, 0, 1 }, // T - { -8, -8, 10, -8, 1, 0, 0, 0, 0, 0, 1 }, // A - { -8, -8, -8, 10, 1, 0, 0, 0, 0, 0, 1 }, // G - { 1, 1, 1, 1, 10, 0, 0, 0, 0, 0, 1 }, // - - { 1, 1, 1, 1, 1, 10, 0, 0, 0, 0, 1 }, // - - { 1, 1, 1, 1, 1, 0, 10, 0, 0, 0, 1 }, // - - { 1, 1, 1, 1, 1, 0, 0, 10, 0, 0, 1 }, // - - { 1, 1, 1, 1, 1, 0, 0, 0, 10, 0, 1 }, // - - { 1, 1, 1, 1, 1, 0, 0, 0, 0, 10, 1 }, // - + { 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 + { -8, -8, -8, 10, 10, 1, 1, -8, 1, 1, 1 }, // U + { 1, 1, 1, 1, 1, 10, 0, 0, 0, 1, 1 }, // I + { 1, 1, 1, 1, 1, 0, 10, 0, 0, 1, 1 }, // X + { 1, -8, 1, -8, -8, 0, 0, 10, -8, 1, 1 }, // R + { -8, 1, -8, 1, 1, 0, 0, -8, 10, 1, 1 }, // Y + { 1, 1, 1, 1, 1, 1, 1, 1, 1, 10, 1 }, // N { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }, // - }; /** @@ -594,6 +610,7 @@ public class ResidueProperties scoreMatrices.put("BLOSUM62", new ScoreMatrix("BLOSUM62", BLOSUM62, 0)); scoreMatrices.put("PAM250", new ScoreMatrix("PAM250", PAM250, 0)); scoreMatrices.put("DNA", new ScoreMatrix("DNA", DNA, 1)); + } public static final Color[] pidColours = @@ -1324,8 +1341,67 @@ public class ResidueProperties static { toRNAssState = new Hashtable(); - toRNAssState.put(")", "S"); - toRNAssState.put("(", "S"); + toRNAssState.put(")", "("); + toRNAssState.put("(", "("); + toRNAssState.put("]", "["); + toRNAssState.put("[", "["); + toRNAssState.put("{", "{"); + toRNAssState.put("}", "{"); + toRNAssState.put(">", ">"); + toRNAssState.put("<", ">"); + toRNAssState.put("A", "A"); + toRNAssState.put("a", "A"); + toRNAssState.put("B", "B"); + toRNAssState.put("b", "B"); + toRNAssState.put("C", "C"); + toRNAssState.put("c", "C"); + toRNAssState.put("D", "D"); + toRNAssState.put("d", "D"); + toRNAssState.put("1", "1"); + toRNAssState.put("e", "1"); + toRNAssState.put("F", "F"); + toRNAssState.put("f", "F"); + toRNAssState.put("G", "G"); + toRNAssState.put("g", "G"); + toRNAssState.put("2", "2"); + toRNAssState.put("h", "2"); + toRNAssState.put("I", "I"); + toRNAssState.put("i", "I"); + toRNAssState.put("J", "J"); + toRNAssState.put("j", "J"); + toRNAssState.put("K", "K"); + toRNAssState.put("k", "K"); + toRNAssState.put("L", "L"); + toRNAssState.put("l", "L"); + toRNAssState.put("M", "M"); + toRNAssState.put("m", "M"); + toRNAssState.put("N", "N"); + toRNAssState.put("n", "N"); + toRNAssState.put("O", "O"); + toRNAssState.put("o", "O"); + toRNAssState.put("P", "P"); + toRNAssState.put("p", "P"); + toRNAssState.put("Q", "Q"); + toRNAssState.put("q", "Q"); + toRNAssState.put("R", "R"); + toRNAssState.put("r", "R"); + toRNAssState.put("S", "S"); + toRNAssState.put("s", "S"); + toRNAssState.put("T", "T"); + toRNAssState.put("t", "T"); + toRNAssState.put("U", "U"); + toRNAssState.put("u", "U"); + toRNAssState.put("V", "V"); + toRNAssState.put("v", "V"); + toRNAssState.put("W", "W"); + toRNAssState.put("w", "W"); + toRNAssState.put("X", "X"); + toRNAssState.put("x", "X"); + toRNAssState.put("Y", "Y"); + toRNAssState.put("y", "Y"); + toRNAssState.put("Z", "Z"); + toRNAssState.put("z", "Z"); + } /**