Sequence to Uppercase before checksum
authoramwaterhouse <Andrew Waterhouse>
Wed, 6 Jul 2005 12:16:42 +0000 (12:16 +0000)
committeramwaterhouse <Andrew Waterhouse>
Wed, 6 Jul 2005 12:16:42 +0000 (12:16 +0000)
src/jalview/io/PileUpfile.java

index 1cb5b43..c200c5e 100755 (executable)
@@ -175,18 +175,20 @@ public class PileUpfile
     //String chars =  "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.*~&@";\r
     int check = 0;\r
 \r
+    String sequence = seq.toUpperCase();\r
+\r
     String index = "--------------------------------------&---*---.-----------------@ABCDEFGHIJKLMNOPQRSTUVWXYZ------ABCDEFGHIJKLMNOPQRSTUVWXYZ----@";\r
     index += "--------------------------------------------------------------------------------------------------------------------------------";\r
 \r
-    for (int i = 0; i < seq.length(); i++)\r
+    for (int i = 0; i < sequence.length(); i++)\r
     {\r
       try\r
       {\r
-        if (i < seq.length())\r
+        if (i < sequence.length())\r
         {\r
-          int pos = index.indexOf(seq.substring(i, i + 1));\r
+          int pos = index.indexOf(sequence.charAt(i));\r
 \r
-          if (!index.substring(pos, pos + 1).equals("_"))\r
+          if (index.charAt(pos)!='_')\r
           {\r
             check += ( ( (i % 57) + 1) * pos);\r
           }\r