Annotations move when full alignment edited
[jalview.git] / src / jalview / analysis / AAFrequency.java
index f409f8c..3d91080 100755 (executable)
@@ -53,6 +53,11 @@ public class AAFrequency
 \r
      Hashtable [] reply = new Hashtable[width];\r
 \r
+     if(end>=width)\r
+     {\r
+       end = width;\r
+     }\r
+\r
      calculate(seqs, start, end, reply);\r
 \r
      return reply;\r
@@ -70,7 +75,7 @@ public static final void calculate(SequenceI[] sequences,
 \r
   int[] values = new int[132];\r
 \r
-  String seq;\r
+  char [] seq;\r
 \r
   for (i = start; i < end; i++)\r
   {\r
@@ -83,9 +88,9 @@ public static final void calculate(SequenceI[] sequences,
     for (j = 0; j < jSize; j++)\r
     {\r
       seq = sequences[j].getSequence();\r
-      if (seq.length() > i)\r
+      if (seq.length > i)\r
       {\r
-        c = seq.charAt(i);\r
+        c = seq[i];\r
 \r
         if(c == '.' || c==' ')\r
           c = '-';\r