JAL-1395 do not calculate non-gap consensus when no symbols present in column (regres...
authorJim Procter <jprocter@compbio.dundee.ac.uk>
Wed, 16 Oct 2013 16:40:16 +0000 (17:40 +0100)
committerJim Procter <jprocter@compbio.dundee.ac.uk>
Wed, 16 Oct 2013 16:40:16 +0000 (17:40 +0100)
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;
     }
   }