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<String, String> 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';
}
/**