+ completeConsensus(consensus, hconsensus, iStart, width,
+ ignoreGapsInConsensusCalculation, includeAllConsSymbols, null,
+ nseq); // new
+ // char[]
+ // { 'A', 'C', 'G', 'T', 'U' });
+ }
+
+ public static void completeConsensus(AlignmentAnnotation consensus,
+ Hashtable[] hconsensus, int iStart, int width,
+ boolean ignoreGapsInConsensusCalculation,
+ boolean includeAllConsSymbols, char[] alphabet, long nseq)
+ {
+ float tval, value;
+ if (consensus == null || consensus.annotations == null
+ || consensus.annotations.length < width)
+ {
+ // called with a bad alignment annotation row - wait for it to be
+ // initialised properly
+ return;
+ }
+ String fmtstr = "%3.1f";
+ int precision = 0;
+ while (nseq >= 10)
+ {
+ precision++;
+ nseq /= 10;
+ }
+ final Format fmt;
+ if (precision > 1)
+ {
+ // if (precision>2)
+ {
+ fmtstr = "%" + (2 + precision) + "." + (precision) + "f";
+ }
+ fmt = new Format(fmtstr);
+ }
+ else
+ {
+ fmt = null;
+ }