1 package jalview.ext.archaeopteryx;
3 import jalview.analysis.TreeBuilder;
4 import jalview.datamodel.SequenceI;
5 import jalview.math.MatrixI;
7 import org.forester.phylogeny.Phylogeny;
8 import org.forester.phylogeny.PhylogenyNode;
10 public class ArchaeopteryxTreeBuilder // cannot inherit
11 // TreeBuilder as that
13 // SequenceNode (instead
16 protected SequenceI[] sequences;
18 private Phylogeny aptxTree;
20 private PhylogenyNode rootNode;
22 protected MatrixI distances;
25 this.aptxTree = new Phylogeny();
29 public ArchaeopteryxTreeBuilder()
32 this.rootNode = new PhylogenyNode();
36 public ArchaeopteryxTreeBuilder(PhylogenyNode treeRoot)
39 this.rootNode = treeRoot;
43 public Phylogeny buildAptxTree(TreeBuilder tree)
45 this.sequences = tree.getSequences();
46 this.distances = tree.getDistances();
49 "PLEASE FIX ME reheaheth35yheqhb3q5hyq3bt3q5u4jwqjwuh6");
51 // final NeighborJoiningF nj = NeighborJoiningF.createInstance(false, 5);
54 // final Phylogeny phy = nj.execute(JalviewMatrixToForesterMatrix
55 // .convertJalviewToForester(distances));
57 return buildAptxTree(sequences);
61 public Phylogeny buildAptxTree(SequenceI[] sequences)
64 for (SequenceI sequence : sequences)
66 PhylogenyNode treeNode = new PhylogenyNode(sequence.getName());
67 rootNode.addAsChild(treeNode);
71 aptxTree.setRoot(rootNode);
78 * Formats a localised title for the tree panel, like
80 * Neighbour Joining Using BLOSUM62
82 * For a tree loaded from file, just uses the file name
86 // public String getPanelTitle()
88 // if (treeTitle != null)
95 // * i18n description of Neighbour Joining or Average Distance method
97 // String treecalcnm = MessageManager
98 // .getString("label.tree_calc_" + treeType.toLowerCase());
101 // * short score model name (long description can be too long)
103 // String smn = substitutionMatrix;
106 // * put them together as <method> Using <model>
108 // final String ttl = MessageManager
109 // .formatMessage("label.treecalc_title", treecalcnm, smn);