+ /**
+ * Used by getRNASecStrucState
+ *
+ */
+ public static Hashtable toRNAssState;
+ static
+ {
+ toRNAssState = new Hashtable<String,String>();
+ 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("E", "E");
+ toRNAssState.put("e", "E");
+ toRNAssState.put("F", "F");
+ toRNAssState.put("f", "F");
+ toRNAssState.put("G", "G");
+ toRNAssState.put("g", "G");
+ toRNAssState.put("H", "H");
+ toRNAssState.put("h", "H");
+ 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");
+
+ }
+
+ /**
+ * translate to RNA secondary structure representation
+ *
+ * @param ssstring
+ * @return ssstring as a RNA-state secondary structure assignment.
+ */
+ public static String getRNASecStrucState(String ssstring)
+ {
+ if (ssstring == null)
+ {
+ return null;
+ }
+ StringBuffer ss = new StringBuffer();
+ for (int i = 0; i < ssstring.length(); i++)
+ {
+ String ssc = ssstring.substring(i, i + 1);
+ if (toRNAssState.containsKey(ssc))
+ {
+ ss.append((String) toRNAssState.get(ssc));
+ }
+ else
+ {
+ ss.append(" ");
+ }
+ }
+ return ss.toString();
+ }
+