+ * 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)
+ {
+ 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;
+ }
+ // always set ranges again
+ consensus.graphMax = nseq;
+ consensus.graphMin = 0;
+ 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.getNonGapped();
+
+ String description = String.valueOf(gapped);
+
+ consensus.annotations[i] = new Annotation(description, description,
+ '\0',
+ gapped);
+ }
+ }
+
+ /**