+ /**
+ * Maps the HMM sequence to the reference annotation.
+ *
+ * @param rf
+ */
+ @Override
+ public void mapToReference(AlignmentAnnotation rf)
+ {
+ if (this.isHMMConsensusSequence)
+ {
+ int node = 1;
+ hmm.emptyNodeLookup();
+ for (int i = 0; i < getLength(); i++)
+ {
+ if (rf.annotations[i].displayCharacter.equals("x")
+ || rf.annotations[i].displayCharacter.equals("X"))
+ {
+ if (i < hmm.getNodeAlignmentColumn(node))
+ {
+ this.deleteChars(i, hmm.getNodeAlignmentColumn(node));
+ updateHMMMapping();
+ }
+ else if (i > hmm.getNodeAlignmentColumn(node))
+ {
+ int length = i - hmm.getNodeAlignmentColumn(node);
+ this.insertCharAt(hmm.getNodeAlignmentColumn(node), length,
+ '-');
+ updateHMMMapping();
+ }
+ node++;
+ }
+ }
+ }
+ }
+