1 package jalview.ext.archaeopteryx;
3 import jalview.analysis.TreeBuilder;
4 import jalview.datamodel.SequenceI;
5 import jalview.math.MatrixI;
7 import org.forester.io.parsers.SymmetricalDistanceMatrixParser;
8 import org.forester.msa.Msa;
9 import org.forester.phylogeny.Phylogeny;
10 import org.forester.phylogeny.PhylogenyNode;
12 public class ArchaeopteryxTreeBuilder // cannot inherit
13 // TreeBuilder as that
15 // SequenceNode (instead
18 protected SequenceI[] sequences;
20 private Phylogeny aptxTree;
22 private PhylogenyNode rootNode;
24 protected MatrixI distances;
28 protected SymmetricalDistanceMatrixParser distanceParser = SymmetricalDistanceMatrixParser
32 public ArchaeopteryxTreeBuilder()
35 this.rootNode = new PhylogenyNode();
36 this.aptxTree = new Phylogeny();
40 public ArchaeopteryxTreeBuilder(PhylogenyNode treeRoot)
43 this.rootNode = treeRoot;
44 this.aptxTree = new Phylogeny();
48 public Phylogeny buildAptxTree(TreeBuilder tree)
50 this.sequences= tree.getSequences();
51 return buildAptxTree(sequences);
55 public Phylogeny buildAptxTree(SequenceI[] sequences)
58 for (SequenceI sequence : sequences)
60 PhylogenyNode treeNode = new PhylogenyNode();
61 treeNode.setName(sequence.getName());
62 rootNode.addAsChild(treeNode);
65 aptxTree.setRoot(rootNode);