JAL-2023 JAL-1681 fixed bug in computing '+' for co-modal codons
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Wed, 20 Jul 2016 08:05:29 +0000 (09:05 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Wed, 20 Jul 2016 08:05:29 +0000 (09:05 +0100)
src/jalview/analysis/AAFrequency.java

index 3d61b11..fb49541 100755 (executable)
@@ -624,8 +624,11 @@ public class AAFrequency
       String modalCodon = String.valueOf(CodingUtils
               .decodeCodon(modalCodonEncoded));
       if (sortedCodonCounts.length > 1
-              && sortedCodonCounts[codons.length - 2] == modalCodonEncoded)
+              && sortedCodonCounts[codons.length - 2] == sortedCodonCounts[codons.length - 1])
       {
+        /*
+         * two or more codons share the modal count
+         */
         modalCodon = "+";
       }
       float pid = sortedCodonCounts[sortedCodonCounts.length - 1] * 100