use of dr.evolution.tree.FlexibleTree in project beast-mcmc by beast-dev.
the class TempestFrame method writeTimeTreeFile.
protected void writeTimeTreeFile(PrintStream ps) throws IOException {
FlexibleTree tree = new FlexibleTree(tempestPanel.getTreeAsViewed());
Regression r = tempestPanel.getTemporalRooting().getRootToTipRegression(tempestPanel.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);
}
use of dr.evolution.tree.FlexibleTree in project beast-mcmc by beast-dev.
the class WithinCaseCoalescent method debugTreelet.
public void debugTreelet(Tree treelet, String fileName) {
try {
FlexibleTree treeCopy = new FlexibleTree(treelet);
for (int j = 0; j < treeCopy.getNodeCount(); j++) {
FlexibleNode node = (FlexibleNode) treeCopy.getNode(j);
node.setAttribute("Number", node.getNumber());
}
NexusExporter testTreesOut = new NexusExporter(new PrintStream(fileName));
testTreesOut.exportTree(treeCopy);
} catch (IOException ignored) {
System.out.println("IOException");
}
}
Aggregations