From: Jim Procter Date: Sun, 23 Nov 2014 16:37:33 +0000 (+0000) Subject: JAL-1569 test for open/close RNA parenthesis character X-Git-Tag: Jalview_2_9~148^2~3 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=3675be7b3939700f06c9fedac7e746f7becf3d1a;p=jalview.git JAL-1569 test for open/close RNA parenthesis character --- diff --git a/src/jalview/schemes/ResidueProperties.java b/src/jalview/schemes/ResidueProperties.java index aca75b7..8acf1f2 100755 --- a/src/jalview/schemes/ResidueProperties.java +++ b/src/jalview/schemes/ResidueProperties.java @@ -1699,7 +1699,9 @@ public class ResidueProperties * Used by getRNASecStrucState * */ - public static Hashtable toRNAssState; + public static Hashtable toRNAssState; + + public static boolean RNAcloseParen[] = new boolean[255]; static { toRNAssState = new Hashtable(); @@ -1763,7 +1765,15 @@ public class ResidueProperties toRNAssState.put("y", "Y"); toRNAssState.put("Z", "Z"); toRNAssState.put("z", "Z"); - + for (int p = 0; p < RNAcloseParen.length; p++) + { + RNAcloseParen[p] = false; + } + for (String k : toRNAssState.keySet()) + { + RNAcloseParen[k.charAt(0)] = k.charAt(0) != toRNAssState.get(k) + .charAt(0); + } } /** @@ -1784,7 +1794,8 @@ public class ResidueProperties String ssc = ssstring.substring(i, i + 1); if (toRNAssState.containsKey(ssc)) { - ss.append((String) toRNAssState.get(ssc)); + // valid ss character - so return it + ss.append(ssc); // (String) toRNAssState.get(ssc)); } else { @@ -1794,6 +1805,11 @@ public class ResidueProperties return ss.toString(); } + public static boolean isCloseParenRNA(char dc) + { + return RNAcloseParen[dc]; + } + // main method generates perl representation of residue property hash // / cut here public static void main(String[] args)