From: gmungoc Date: Tue, 5 Mar 2019 16:44:20 +0000 (+0000) Subject: Merge remote-tracking branch 'origin/features/JAL-2620alternativeCodeTables' into... X-Git-Tag: Release_2_11_0~17^2~64 X-Git-Url: http://source.jalview.org/gitweb/?p=jalview.git;a=commitdiff_plain;h=8956fdfd008d0d949814c4680a7b3a55969e39e1 Merge remote-tracking branch 'origin/features/JAL-2620alternativeCodeTables' into merge/JAL-2620 --- 8956fdfd008d0d949814c4680a7b3a55969e39e1 diff --cc src/jalview/schemes/ResidueProperties.java index 18b11c1,bf30ed6..d435065 --- a/src/jalview/schemes/ResidueProperties.java +++ b/src/jalview/schemes/ResidueProperties.java @@@ -1148,28 -896,28 +896,29 @@@ public class ResiduePropertie public static String codonTranslate(String lccodon) { - String cdn = codonHash2.get(lccodon.toUpperCase()); - if ("*".equals(cdn)) + String peptide = GeneticCodes.getInstance().getStandardCodeTable() + .translate(lccodon); + if ("*".equals(peptide)) { - return STOP; + return "STOP"; } - return cdn; + return peptide; } - public static Hashtable toDssp3State; + /* + * lookup of (A-Z) alternative secondary structure symbols' + * equivalents in DSSP3 notation + */ + private static char[] toDssp3State; static { - toDssp3State = new Hashtable<>(); - toDssp3State.put("H", "H"); - toDssp3State.put("E", "E"); - toDssp3State.put("C", " "); - toDssp3State.put(" ", " "); - toDssp3State.put("T", " "); - toDssp3State.put("B", "E"); - toDssp3State.put("G", "H"); - toDssp3State.put("I", "H"); - toDssp3State.put("X", " "); + toDssp3State = new char[9]; // for 'A'-'I'; extend if needed + Arrays.fill(toDssp3State, ' '); + toDssp3State['B' - 'A'] = 'E'; + toDssp3State['E' - 'A'] = 'E'; + toDssp3State['G' - 'A'] = 'H'; + toDssp3State['H' - 'A'] = 'H'; + toDssp3State['I' - 'A'] = 'H'; } /**