Пример #1
0
  protected void writeTimeTreeFile(PrintStream ps) throws IOException {

    FlexibleTree tree = new FlexibleTree(treesPanel.getTreeAsViewed());

    Regression r =
        treesPanel.getTemporalRooting().getRootToTipRegression(treesPanel.getTreeAsViewed());

    for (int i = 0; i < tree.getInternalNodeCount(); i++) {
      NodeRef node = tree.getInternalNode(i);
      double height = tree.getNodeHeight(node);
      tree.setNodeHeight(node, height / r.getGradient());
    }

    TreeUtils.setHeightsFromDates(tree);

    NexusExporter nexusExporter = new NexusExporter(new PrintStream(ps));
    nexusExporter.exportTree(tree);
  }
Пример #2
0
  protected void writeTreeFile(PrintStream ps, boolean newickFormat) throws IOException {

    Tree tree = treesPanel.getTreeAsViewed();

    //        if (newickFormat) {
    //            NewickExporter newickExporter = new NewickExporter(ps);
    //            newickExporter.exportTree(tree);
    //        } else {
    NexusExporter nexusExporter = new NexusExporter(new PrintStream(ps));
    nexusExporter.exportTree(tree);
    //        }
  }