JAL-2805 check actually works now
[jalview.git] / src / jalview / ext / treeviewer / LoadedTreeSequenceAssociation.java
index 4229b50..479e450 100644 (file)
@@ -59,9 +59,25 @@ public class LoadedTreeSequenceAssociation
         nodeSequence = algnIds.findIdMatch(nodeSequenceName);
         if (nodeSequence != null)
         {
-
+          // is there already a sequence present for the node?
+          // If so, does it actually match Jalview's sequence?
+          if (treeNode.getSequence() != null)
+          {
+            if (!(treeNode.getSequence().getSequenceAsString()
+                    .equals(nodeSequence.getSequenceAsString())))
+            {
+              System.err.println(
+                      "Sequence detected in tree node that does not match corresponding Jalview sequence:"
+                              + nodeSequenceName);
+              // which sequence gets precedence?
+
+            }
+
+          }
+          else
+          {
           treeNode.setSequence(nodeSequence);
-
+          }
           MappingUtils.putWithDuplicationCheck(alignmentWithNodes,
                   nodeSequence, treeNode);
           MappingUtils.putWithDuplicationCheck(nodesWithAlignment, treeNode,