JAL-4386 JAL-4435 TODO and refactored TreeViewer constructor with added alignmentanno...
authorJim Procter <jprocter@dundee.ac.uk>
Thu, 15 Aug 2024 08:22:17 +0000 (09:22 +0100)
committerJim Procter <jprocter@dundee.ac.uk>
Thu, 15 Aug 2024 08:27:35 +0000 (09:27 +0100)
src/jalview/analysis/TreeModel.java
src/jalview/appletgui/TreePanel.java
src/jalview/io/packed/JalviewDataset.java
test/jalview/io/NewickFileTests.java

index 2d2248d..b04aa97 100644 (file)
@@ -77,6 +77,8 @@ public class TreeModel
    *          Cigar[]
    * @param treefile
    *          NewickFile
+   * @param leafAnnotations
+   *          Set of annotations that might also be mappable to leaves of the tree
    */
   public TreeModel(SequenceI[] seqs, AlignmentView odata,
           NewickFile treefile, AlignmentAnnotation[] leafAnnotations)
@@ -86,6 +88,7 @@ public class TreeModel
     seqData = odata;
     if (leafAnnotations != null)
     {
+      // TODO
       // leaf names are seuqence ID + annotation for display
       // leaf links are annotationId <> annotation object for import from
       // project
index 0316e0b..cfaa314 100644 (file)
@@ -187,7 +187,7 @@ public class TreePanel extends EmbmenuFrame
       if (newtree != null)
       {
         tree = new TreeModel(av.getAlignment().getSequencesArray(), odata,
-                newtree);
+                newtree,null);
       }
       else
       {
index 5248a16..6565b12 100644 (file)
@@ -152,7 +152,7 @@ public class JalviewDataset
       {
         // the following works because all trees are already had node/SequenceI
         // associations created.
-        TreeModel njt = new TreeModel(al.getSequencesArray(), null, nf);
+        TreeModel njt = new TreeModel(al.getSequencesArray(), null, nf,null);
         // this just updates the displayed leaf name on the tree according to
         // the SequenceIs.
         njt.renameAssociatedNodes();
index 466f218..ab9424c 100644 (file)
@@ -125,7 +125,7 @@ public class NewickFileTests
       stage = "Compare original and generated tree" + treename;
 
       Vector<BinaryNode> oseqs, nseqs;
-      oseqs = new TreeModel(new SequenceI[0], null, nf)
+      oseqs = new TreeModel(new SequenceI[0], null, nf,null)
               .findLeaves(nf.getTree());
       AssertJUnit.assertTrue(stage + "No nodes in original tree.",
               oseqs.size() > 0);
@@ -134,7 +134,7 @@ public class NewickFileTests
       {
         olsqs[i] = (SequenceI) oseqs.get(i).element();
       }
-      nseqs = new TreeModel(new SequenceI[0], null, nf_regen)
+      nseqs = new TreeModel(new SequenceI[0], null, nf_regen,null)
               .findLeaves(nf_regen.getTree());
       AssertJUnit.assertTrue(stage + "No nodes in regerated tree.",
               nseqs.size() > 0);