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 // testing method to be removed
62 public Phylogeny buildAptxTree(SequenceI[] sequences)
65 for (SequenceI sequence : sequences)
67 PhylogenyNode treeNode = new PhylogenyNode(sequence.getName());
68 rootNode.addAsChild(treeNode);
72 aptxTree.setRoot(rootNode);
79 * Formats a localised title for the tree panel, like
81 * Neighbour Joining Using BLOSUM62
83 * For a tree loaded from file, just uses the file name
87 // public String getPanelTitle()
89 // if (treeTitle != null)
96 // * i18n description of Neighbour Joining or Average Distance method
98 // String treecalcnm = MessageManager
99 // .getString("label.tree_calc_" + treeType.toLowerCase());
102 // * short score model name (long description can be too long)
104 // String smn = substitutionMatrix;
107 // * put them together as <method> Using <model>
109 // final String ttl = MessageManager
110 // .formatMessage("label.treecalc_title", treecalcnm, smn);