JAL-1395 do not calculate non-gap consensus when no symbols present in column (regres...
[jalview.git] / src / jalview / analysis / AAFrequency.java
index df5ca8d..08a3f52 100755 (executable)
@@ -181,8 +181,10 @@ public class AAFrequency
       percentage = ((float) maxCount * 100) / jSize;
       residueHash.put(PID_GAPS, new Float(percentage));
 
-      percentage = ((float) maxCount * 100) / nongap;
-      residueHash.put(PID_NOGAPS, new Float(percentage));
+      if (nongap>0) {
+        percentage = ((float) maxCount * 100) / nongap;
+        residueHash.put(PID_NOGAPS, new Float(percentage));
+      }
       result[i] = residueHash;
     }
   }