Jalview 2.6 source licence
[jalview.git] / src / jalview / analysis / AAFrequency.java
index 46264d6..11e7a3d 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6)
  * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
@@ -211,6 +211,11 @@ public class AAFrequency
     }
     for (int i = iStart; i < width; i++)
     {
+      if (i>=hconsensus.length) {
+        // happens if sequences calculated over were shorter than alignment width
+        consensus.annotations[i]=null;
+        continue;
+      }
       value = 0;
       if (ignoreGapsInConsensusCalculation)
       {