}
+ /**
+ * 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++;
+ }
+ }
+ }
+ }
+
@Override
public boolean isHMMConsensusSequence()
{
import jalview.api.FeaturesSourceI;
import jalview.bin.Cache;
import jalview.bin.Jalview;
+import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.HiddenColumns;
import jalview.datamodel.PDBEntry;
SequenceI seq = alignment
.getSequenceAt(alignment.getAbsoluteHeight() - 1);
seq.setIsHMMConsensusSequence(true);
+ AlignmentAnnotation[] annots = viewport.getAlignment()
+ .getAlignmentAnnotation();
+ for (AlignmentAnnotation annot : annots)
+ {
+ if ("RF".equals(annot.label)
+ || annot.label.contains("Reference"))
+ {
+ seq.mapToReference(annot);
+ break;
+ }
+ }
alignment.deleteSequence(alignment.getAbsoluteHeight() - 1);
alignment.insertSequenceAt(0, seq);
viewport.getAlignPanel().adjustAnnotationHeight();