From 13b2b876b5bc46693d881b4551842279158311f5 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Wed, 6 Jul 2005 12:16:42 +0000 Subject: [PATCH] Sequence to Uppercase before checksum --- src/jalview/io/PileUpfile.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/jalview/io/PileUpfile.java b/src/jalview/io/PileUpfile.java index 1cb5b43..c200c5e 100755 --- a/src/jalview/io/PileUpfile.java +++ b/src/jalview/io/PileUpfile.java @@ -175,18 +175,20 @@ public class PileUpfile //String chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.*~&@"; int check = 0; + String sequence = seq.toUpperCase(); + String index = "--------------------------------------&---*---.-----------------@ABCDEFGHIJKLMNOPQRSTUVWXYZ------ABCDEFGHIJKLMNOPQRSTUVWXYZ----@"; index += "--------------------------------------------------------------------------------------------------------------------------------"; - for (int i = 0; i < seq.length(); i++) + for (int i = 0; i < sequence.length(); i++) { try { - if (i < seq.length()) + if (i < sequence.length()) { - int pos = index.indexOf(seq.substring(i, i + 1)); + int pos = index.indexOf(sequence.charAt(i)); - if (!index.substring(pos, pos + 1).equals("_")) + if (index.charAt(pos)!='_') { check += ( ( (i % 57) + 1) * pos); } -- 1.7.10.2