X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fanalysis%2FRna.java;h=94544e79b63ae34643ca01ac716a2e39e6240549;hb=3d0101179759ef157b088ea135423cd909512d9f;hp=7c077088af2c9ce76661c8e13dcf09c22069f9d9;hpb=9c1dd670f293d8f33de55133397b4cd2d4baf38e;p=jalview.git diff --git a/src/jalview/analysis/Rna.java b/src/jalview/analysis/Rna.java index 7c07708..94544e7 100644 --- a/src/jalview/analysis/Rna.java +++ b/src/jalview/analysis/Rna.java @@ -48,7 +48,8 @@ public class Rna */ public static boolean isOpeningParenthesis(char c) { - return ('A' <= c && c <= 'Z' || c == '(' || c == '[' || c == '{' || c == '<'); + return ('A' <= c && c <= 'Z' || c == '(' || c == '[' || c == '{' + || c == '<'); } /** @@ -73,7 +74,8 @@ public class Rna */ public static boolean isClosingParenthesis(char c) { - return ('a' <= c && c <= 'z' || c == ')' || c == ']' || c == '}' || c == '>'); + return ('a' <= c && c <= 'z' || c == ')' || c == ']' || c == '}' + || c == '>'); } /** @@ -159,8 +161,8 @@ public class Rna if (!stacks.containsKey(opening)) { throw new WUSSParseException(MessageManager.formatMessage( - "exception.mismatched_unseen_closing_char", - new String[] { String.valueOf(base) }), i); + "exception.mismatched_unseen_closing_char", new String[] + { String.valueOf(base) }), i); } Stack stack = stacks.get(opening); @@ -168,8 +170,8 @@ public class Rna { // error whilst parsing i'th position. pass back throw new WUSSParseException(MessageManager.formatMessage( - "exception.mismatched_closing_char", - new String[] { String.valueOf(base) }), i); + "exception.mismatched_closing_char", new String[] + { String.valueOf(base) }), i); } int temp = stack.pop(); @@ -187,9 +189,9 @@ public class Rna * i (length of input string) */ throw new WUSSParseException(MessageManager.formatMessage( - "exception.mismatched_opening_char", - new String[] { String.valueOf(opening), - String.valueOf(stack.pop()) }), i); + "exception.mismatched_opening_char", new String[] + { String.valueOf(opening), String.valueOf(stack.pop()) }), + i); } } return pairs; @@ -359,8 +361,8 @@ public class Rna } /** - * Answers true if the base-pair is either a canonical (A-T/U, C-G) or a - * wobble (G-T/U) pair (either way round), else false + * Answers true if the base-pair is either a Watson-Crick (A:T/U, C:G) or a + * wobble (G:T/U) pair (either way round), else false * * @param first * @param second @@ -376,7 +378,7 @@ public class Rna { second -= 32; } - + switch (first) { case 'A': @@ -416,6 +418,14 @@ public class Rna return false; } + /** + * Answers true if the base-pair is Watson-Crick - (A:T/U or C:G, either way + * round), else false + * + * @param first + * @param second + * @return + */ public static boolean isCanonicalPair(char first, char second) {