}
/**
+ * Derive the gap count annotation row.
+ *
+ * @param consensus
+ * the annotation row to add annotations to
+ * @param profiles
+ * the source consensus data
+ * @param startCol
+ * start column (inclusive)
+ * @param endCol
+ * end column (exclusive)
+ */
+ public static void completeGapAnnot(AlignmentAnnotation consensus,
+ ProfilesI profiles, int startCol, int endCol, long nseq)
+ {
+ // long now = System.currentTimeMillis();
+ if (consensus == null || consensus.annotations == null
+ || consensus.annotations.length < endCol)
+ {
+ /*
+ * called with a bad alignment annotation row
+ * wait for it to be initialised properly
+ */
+ return;
+ }
+
+ for (int i = startCol; i < endCol; i++)
+ {
+ ProfileI profile = profiles.get(i);
+ if (profile == null)
+ {
+ /*
+ * happens if sequences calculated over were
+ * shorter than alignment width
+ */
+ consensus.annotations[i] = null;
+ return;
+ }
+
+ final int gapped = profile.getGapped();
+
+ String description = "" + gapped;
+
+ consensus.annotations[i] = new Annotation(gapped);
+ }
+ // long elapsed = System.currentTimeMillis() - now;
+ // System.out.println(-elapsed);
+ }
+
+ /**
* Returns a tooltip showing either
* <ul>
* <li>the full profile (percentages of all residues present), if