From: jprocter Date: Thu, 18 Aug 2005 09:33:29 +0000 (+0000) Subject: various case sensitivity bugs fixed in residue comparison functions. X-Git-Tag: Release_2_03~1 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=92f38d98051bc64405b16873ba33c8331afeeb1f;p=jalview.git various case sensitivity bugs fixed in residue comparison functions. --- diff --git a/src/jalview/analysis/AAFrequency.java b/src/jalview/analysis/AAFrequency.java index 0841bf2..55447d3 100755 --- a/src/jalview/analysis/AAFrequency.java +++ b/src/jalview/analysis/AAFrequency.java @@ -66,7 +66,7 @@ public class AAFrequency if (sequence.length() > i) { - res = sequence.substring(i,i+1); + res = Character.toString(Character.toUpperCase(sequence.charAt(i))); if (jalview.util.Comparison.isGap(res.charAt(0))) { diff --git a/src/jalview/analysis/Conservation.java b/src/jalview/analysis/Conservation.java index d814abb..0bfb636 100755 --- a/src/jalview/analysis/Conservation.java +++ b/src/jalview/analysis/Conservation.java @@ -123,8 +123,8 @@ public class Conservation for (j = 1; j <= len; j++) { - sqnum[j] = ((Integer) jalview.schemes.ResidueProperties.aaHash.get(new String( - sq.substring(j - 1, j)))).intValue(); // yuk + sqnum[j] = ((Integer) jalview.schemes.ResidueProperties.aaHash.get(Character.toString( + sq.charAt(j - 1)))).intValue(); // yuk - JBPNote - case taken care of in aaHash } seqNums.setElementAt(sqnum, i); @@ -163,7 +163,7 @@ public class Conservation if (sequence.length() > i) { - res = sequence.substring(i, i + 1); + res = Character.toString(Character.toUpperCase(sequence.charAt(i))); if (residueHash.containsKey(res)) { @@ -260,7 +260,7 @@ public class Conservation continue; } - c = ((Sequence) sequences.elementAt(i)).getCharAt(j); + c = ((Sequence) sequences.elementAt(i)).getCharAt(j); // gaps do not have upper/lower case if (jalview.util.Comparison.isGap((c))) { diff --git a/src/jalview/util/Comparison.java b/src/jalview/util/Comparison.java index 9b61798..9a86696 100755 --- a/src/jalview/util/Comparison.java +++ b/src/jalview/util/Comparison.java @@ -138,7 +138,7 @@ public class Comparison if (i < s1.getSequence().length()) { - chr1 = s1.getSequence().charAt(i); + chr1 = Character.toUpperCase(s1.getSequence().charAt(i)); } else { @@ -147,7 +147,7 @@ public class Comparison if (i < s2.getSequence().length()) { - chr2 = s2.getSequence().charAt(i); + chr2 = Character.toUpperCase(s2.getSequence().charAt(i)); } else { @@ -200,7 +200,7 @@ public class Comparison if (i < s1.getSequence().length()) { - chr1 = s1.getSequence().charAt(i); + chr1 = Character.toUpperCase(s1.getSequence().charAt(i)); } else { @@ -209,7 +209,7 @@ public class Comparison if (i < s2.getSequence().length()) { - chr2 = s2.getSequence().charAt(i); + chr2 = Character.toUpperCase(s2.getSequence().charAt(i)); } else {