+ * Derive the information annotations to be added to the alignment for
+ * display. This does not recompute the raw data, but may be called on a
+ * change in display options, such as 'ignore below background frequency',
+ * which may in turn result in a change in the derived values.
+ *
+ * @param information
+ * the annotation row to add annotations to
+ * @param profiles
+ * the source information data
+ * @param startCol
+ * start column (inclusive)
+ * @param endCol
+ * end column (exclusive)
+ * @param ignoreGaps
+ * if true, normalise residue percentages
+ * @param showSequenceLogo
+ * if true include all information symbols, else just show modal
+ * residue
+ * @param nseq
+ * number of sequences
+ */
+ public static void completeInformation(AlignmentAnnotation information,
+ ProfilesI profiles, int startCol, int endCol,
+ boolean ignoreBelowBackground,
+ boolean showSequenceLogo, long nseq)
+ {
+ // long now = System.currentTimeMillis();
+ if (information == null || information.annotations == null
+ || information.annotations.length < endCol)
+ {
+ /*
+ * called with a bad alignment annotation row
+ * wait for it to be initialised properly
+ */
+ return;
+ }
+
+ Float max = 0f;
+
+ 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
+ */
+ information.annotations[i] = null;
+ return;
+ }
+
+ HiddenMarkovModel hmm;
+
+ SequenceI hmmSeq = information.sequenceRef;
+
+ hmm = hmmSeq.getHMM();
+
+ Float value = getInformationContent(i, hmm);
+
+ if (value > max)
+ {
+ max = value;
+ }
+
+ String description = value + " bits";
+
+ information.annotations[i] = new Annotation(" ", description,
+ ' ', value);
+ }
+ information.graphMax = max;
+ // long elapsed = System.currentTimeMillis() - now;
+ // System.out.println(-elapsed);
+ }
+
+ /**