various case sensitivity bugs fixed in residue comparison functions.
authorjprocter <Jim Procter>
Thu, 18 Aug 2005 09:33:29 +0000 (09:33 +0000)
committerjprocter <Jim Procter>
Thu, 18 Aug 2005 09:33:29 +0000 (09:33 +0000)
src/jalview/analysis/AAFrequency.java
src/jalview/analysis/Conservation.java
src/jalview/util/Comparison.java

index 0841bf2..55447d3 100755 (executable)
@@ -66,7 +66,7 @@ public class AAFrequency
 \r
                     if (sequence.length() > i)\r
                     {\r
-                        res = sequence.substring(i,i+1);\r
+                        res = Character.toString(Character.toUpperCase(sequence.charAt(i)));\r
 \r
                         if (jalview.util.Comparison.isGap(res.charAt(0)))\r
                         {\r
index d814abb..0bfb636 100755 (executable)
@@ -123,8 +123,8 @@ public class Conservation
 \r
                 for (j = 1; j <= len; j++)\r
                 {\r
-                    sqnum[j] = ((Integer) jalview.schemes.ResidueProperties.aaHash.get(new String(\r
-                                sq.substring(j - 1, j)))).intValue(); // yuk\r
+                    sqnum[j] = ((Integer) jalview.schemes.ResidueProperties.aaHash.get(Character.toString(\r
+                                sq.charAt(j - 1)))).intValue(); // yuk - JBPNote - case taken care of in aaHash\r
                 }\r
 \r
                 seqNums.setElementAt(sqnum, i);\r
@@ -163,7 +163,7 @@ public class Conservation
 \r
                     if (sequence.length() > i)\r
                     {\r
-                        res = sequence.substring(i, i + 1);\r
+                        res = Character.toString(Character.toUpperCase(sequence.charAt(i)));\r
 \r
                         if (residueHash.containsKey(res))\r
                         {\r
@@ -260,7 +260,7 @@ public class Conservation
                 continue;\r
             }\r
 \r
-            c = ((Sequence) sequences.elementAt(i)).getCharAt(j);\r
+            c = ((Sequence) sequences.elementAt(i)).getCharAt(j); // gaps do not have upper/lower case\r
 \r
             if (jalview.util.Comparison.isGap((c)))\r
             {\r
index 9b61798..9a86696 100755 (executable)
@@ -138,7 +138,7 @@ public class Comparison
 \r
             if (i < s1.getSequence().length())\r
             {\r
-                chr1 = s1.getSequence().charAt(i);\r
+                chr1 = Character.toUpperCase(s1.getSequence().charAt(i));\r
             }\r
             else\r
             {\r
@@ -147,7 +147,7 @@ public class Comparison
 \r
             if (i < s2.getSequence().length())\r
             {\r
-                chr2 = s2.getSequence().charAt(i);\r
+                chr2 = Character.toUpperCase(s2.getSequence().charAt(i));\r
             }\r
             else\r
             {\r
@@ -200,7 +200,7 @@ public class Comparison
 \r
             if (i < s1.getSequence().length())\r
             {\r
-                chr1 = s1.getSequence().charAt(i);\r
+                chr1 = Character.toUpperCase(s1.getSequence().charAt(i));\r
             }\r
             else\r
             {\r
@@ -209,7 +209,7 @@ public class Comparison
 \r
             if (i < s2.getSequence().length())\r
             {\r
-                chr2 = s2.getSequence().charAt(i);\r
+                chr2 = Character.toUpperCase(s2.getSequence().charAt(i));\r
             }\r
             else\r
             {\r