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();
33 this.rootNode.setName("root");
37 public ArchaeopteryxTreeBuilder(PhylogenyNode treeRoot)
40 this.rootNode = treeRoot;
44 public Phylogeny buildAptxTree(TreeBuilder tree)
46 this.sequences = tree.getSequences();
47 this.distances = tree.getDistances();
50 "PLEASE FIX ME reheaheth35yheqhb3q5hyq3bt3q5u4jwqjwuh6");
52 // final NeighborJoiningF nj = NeighborJoiningF.createInstance(false, 5);
55 // final Phylogeny phy = nj.execute(JalviewMatrixToForesterMatrix
56 // .convertJalviewToForester(distances));
58 return buildAptxTree(sequences);
62 // testing method to be removed
63 public Phylogeny buildAptxTree(SequenceI[] sequences)
66 for (SequenceI sequence : sequences)
68 PhylogenyNode treeNode = new PhylogenyNode(sequence.getName());
69 rootNode.addAsChild(treeNode);
73 aptxTree.setRoot(rootNode);
80 * Formats a localised title for the tree panel, like
82 * Neighbour Joining Using BLOSUM62
84 * For a tree loaded from file, just uses the file name
88 // public String getPanelTitle()
90 // if (treeTitle != null)
97 // * i18n description of Neighbour Joining or Average Distance method
99 // String treecalcnm = MessageManager
100 // .getString("label.tree_calc_" + treeType.toLowerCase());
103 // * short score model name (long description can be too long)
105 // String smn = substitutionMatrix;
108 // * put them together as <method> Using <model>
110 // final String ttl = MessageManager
111 // .formatMessage("label.treecalc_title", treecalcnm, smn);