check that we're not off the end of a sequence
authoramwaterhouse <Andrew Waterhouse>
Thu, 10 Feb 2005 13:26:25 +0000 (13:26 +0000)
committeramwaterhouse <Andrew Waterhouse>
Thu, 10 Feb 2005 13:26:25 +0000 (13:26 +0000)
src/jalview/schemes/ClustalxColourScheme.java

index b28ac76..d4789e6 100755 (executable)
@@ -63,7 +63,10 @@ public class ClustalxColourScheme implements ColourSchemeI
         seq = ( (SequenceI) seqs.get(j)).getSequence();\r
         for (i = start; i <= end; i++)\r
         {\r
-          res = ( (Integer) ResidueProperties.aaHash.get(seq.charAt(i) + "")).intValue();\r
+          if(seq.length()-1<i)\r
+            res = 23;\r
+          else\r
+            res = ( (Integer) ResidueProperties.aaHash.get(seq.charAt(i) + "")).intValue();\r
           cons2[i][res]++;\r
         }\r
         j++;\r