X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fschemes%2FResidueProperties.java;fp=src%2Fjalview%2Fschemes%2FResidueProperties.java;h=209fe122dbc886e4d7930186af86e1119d198b2f;hb=da3a1b89b39a9b7b328e08f622d8f5aa1f6358e4;hp=662a77e4ba0bf1c49d88f558fa14f81bbb533e24;hpb=46371d4ca5cf65bf625cb98a09817a84ebf869c0;p=jalview.git diff --git a/src/jalview/schemes/ResidueProperties.java b/src/jalview/schemes/ResidueProperties.java index 662a77e..209fe12 100755 --- a/src/jalview/schemes/ResidueProperties.java +++ b/src/jalview/schemes/ResidueProperties.java @@ -20,6 +20,10 @@ */ 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.Enumeration; @@ -29,10 +33,6 @@ import java.util.List; import java.util.Map; import java.util.Vector; -import jalview.analysis.scoremodels.FeatureScoreModel; -import jalview.analysis.scoremodels.PIDScoreModel; -import jalview.api.analysis.ScoreModelI; - public class ResidueProperties { public static Hashtable scoreMatrices = new Hashtable(); @@ -50,6 +50,9 @@ public class ResidueProperties public static final Map nucleotideName = new HashMap(); + // lookup from modified amino acid (e.g. MSE) to canonical form (e.g. MET) + public static final Map modifications = new HashMap(); + static { aaIndex = new int[255]; @@ -1703,6 +1706,26 @@ public class ResidueProperties } } + static + { + modifications.put("MSE", "MET"); // Selenomethionine + // the rest tbc; from + // http://sourceforge.net/p/jmol/mailman/message/12833570/ + // modifications.put("CSE", "CYS"); // Selenocysteine + // modifications.put("PTR", "TYR"); // Phosphotyrosine + // modifications.put("SEP", "SER"); // Phosphoserine + // modifications.put("HYP", "PRO"); // 4-hydroxyproline + // modifications.put("5HP", "GLU"); // Pyroglutamic acid; 5-hydroxyproline + // modifications.put("PCA", "GLU"); // Pyroglutamic acid + // modifications.put("LYZ", "LYS"); // 5-hydroxylysine + } + + public static String getCanonicalAminoAcid(String aa) + { + String canonical = modifications.get(aa); + return canonical == null ? aa : canonical; + } + /** * translate to RNA secondary structure representation * @@ -1835,4 +1858,21 @@ public class ResidueProperties return result; } + /** + * Returns the single letter code for a three letter code, or '0' if not known + * + * @param threeLetterCode + * not case sensitive + * @return + */ + public static char getSingleCharacterCode(String threeLetterCode) + { + if (threeLetterCode == null) + { + return '0'; + } + Integer index = ResidueProperties.aa3Hash.get(threeLetterCode + .toUpperCase()); + return index == null ? '0' : aa[index].charAt(0); + } }