JAL-2794 Made HashMap with Nodes as keys and sequences as values as well
authorkjvdheide <kjvanderheide@dundee.ac.uk>
Thu, 9 Nov 2017 16:08:46 +0000 (16:08 +0000)
committerkjvdheide <kjvanderheide@dundee.ac.uk>
Thu, 9 Nov 2017 16:08:46 +0000 (16:08 +0000)
src/jalview/ext/archaeopteryx/ArchaeopteryxTreeConverter.java

index 58c5728..640c3ec 100644 (file)
@@ -31,6 +31,8 @@ public class ArchaeopteryxTreeConverter // implements PhylogenyFactory
 
   private final Map<SequenceI, PhylogenyNode> alignmentBoundNodes;
 
+  private final Map<PhylogenyNode, SequenceI> nodesBoundAlignment;
+
   public ArchaeopteryxTreeConverter(final TreeBuilder calculatedTree)
   {
     jalviewTree = calculatedTree;
@@ -39,8 +41,8 @@ public class ArchaeopteryxTreeConverter // implements PhylogenyFactory
             jalviewTree.getDistances(), sequences);
     aptxTree = new Phylogeny();
     rootNode = new PhylogenyNode();
-    alignmentBoundNodes = new HashMap<>(
-            distances.getSize());
+    alignmentBoundNodes = new HashMap<>(distances.getSize());
+    nodesBoundAlignment = new HashMap<>(distances.getSize());
 
 
   }
@@ -71,6 +73,7 @@ public class ArchaeopteryxTreeConverter // implements PhylogenyFactory
       NodeData nodeData = sequenceNode.getNodeData();
       nodeData.setSequence(seq);
 
+      nodesBoundAlignment.put(sequenceNode, sequence);
       alignmentBoundNodes.put(sequence, sequenceNode);
       rootNode.addAsChild(sequenceNode);
     }
@@ -90,6 +93,11 @@ public class ArchaeopteryxTreeConverter // implements PhylogenyFactory
     return alignmentBoundNodes;
   }
 
+  public Map<PhylogenyNode, SequenceI> getNodesBoundAlignment()
+  {
+    return nodesBoundAlignment;
+  }
+
   private Phylogeny clusterNodes()
   {
     return aptxTree;