From: Jim Procter Date: Thu, 15 Aug 2024 08:22:17 +0000 (+0100) Subject: JAL-4386 JAL-4435 TODO and refactored TreeViewer constructor with added alignmentanno... X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=5f218a6736e414b9a4035580db611c360887c872;p=jalview.git JAL-4386 JAL-4435 TODO and refactored TreeViewer constructor with added alignmentannotation[] --- diff --git a/src/jalview/analysis/TreeModel.java b/src/jalview/analysis/TreeModel.java index 2d2248d..b04aa97 100644 --- a/src/jalview/analysis/TreeModel.java +++ b/src/jalview/analysis/TreeModel.java @@ -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 diff --git a/src/jalview/appletgui/TreePanel.java b/src/jalview/appletgui/TreePanel.java index 0316e0b..cfaa314 100644 --- a/src/jalview/appletgui/TreePanel.java +++ b/src/jalview/appletgui/TreePanel.java @@ -187,7 +187,7 @@ public class TreePanel extends EmbmenuFrame if (newtree != null) { tree = new TreeModel(av.getAlignment().getSequencesArray(), odata, - newtree); + newtree,null); } else { diff --git a/src/jalview/io/packed/JalviewDataset.java b/src/jalview/io/packed/JalviewDataset.java index 5248a16..6565b12 100644 --- a/src/jalview/io/packed/JalviewDataset.java +++ b/src/jalview/io/packed/JalviewDataset.java @@ -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(); diff --git a/test/jalview/io/NewickFileTests.java b/test/jalview/io/NewickFileTests.java index 466f218..ab9424c 100644 --- a/test/jalview/io/NewickFileTests.java +++ b/test/jalview/io/NewickFileTests.java @@ -125,7 +125,7 @@ public class NewickFileTests stage = "Compare original and generated tree" + treename; Vector 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);