JAL-2629 add multiple options for running hmmbuild on alignment/groups
[jalview.git] / src / jalview / datamodel / HiddenMarkovModel.java
index 2f58d3f..a837b4f 100644 (file)
@@ -748,10 +748,22 @@ public class HiddenMarkovModel
    */
   public void setAlignmentColumn(int nodeIndex, int column)
   {
+    int currentCol = getNodeAlignmentColumn(nodeIndex);
+    nodeLookup.remove(currentCol);
     nodes.get(nodeIndex).setAlignmentColumn(column);
+    nodeLookup.put(column, nodeIndex);
   }
 
   /**
+   * Clears all data in the node lookup map
+   */
+  public void emptyNodeLookup()
+  {
+    nodeLookup = new HashMap<>();
+  }
+
+
+  /**
    * Sets the reference annotation at a given node.
    * 
    * @param nodeIndex