}
return mostLikely;
}
+
+ /**
+ * Maps the nodes of the hidden Markov model to the reference annotation.
+ */
+ public void mapToReferenceAnnotation(AlignmentAnnotation alAnnotation)
+ {
+ Annotation[] annots = alAnnotation.annotations;
+ {
+ int nodeIndex = 0;
+ for (int col = 0; col < annots.length; col++)
+ {
+ String character = annots[col].displayCharacter;
+ if ("x".equals(character) || "X".equals(character))
+ {
+ nodeIndex++;
+ if (nodeIndex <= nodes.size())
+ {
+ nodes.get(nodeIndex).setAlignmentColumn(col + 1);
+ nodeLookup.put(col + 1, nodeIndex);
+ }
+ else
+ {
+ System.out.println(
+ "The reference annotation contains more consensus columns than the hidden Markov model");
+ break;
+ }
+ }
+ else
+ {
+ nodeLookup.remove(col + 1);
+ }
+ }
+
+ }
+ }
}