Hi Knud, in phangorn I try to take care that the node labels are assigned to the right nodes after using midpoint, see attached code and pic. It seems to work quite nicely. It would be useful if you could supply a reproducible example or the tree you have problems with and open otherwise an issue on github. Regards, Klaus
On Thu, Dec 15, 2016 at 9:14 AM, Todd Knutson <knut0...@umn.edu> wrote: > Hi, > > Is there any way to use the updated root() function in ape ver 4.0 to find > and set the midpoint root in a tree? I greatly appreciate the updated > root() function to include the “edgelabel = TRUE” option, so that when I > have bootstrapping support values listed as node labels, they get assigned > to the proper edge of the tree after re-rooting. > > However, using the midpoint.root() function from phytools or midpoint() > from the phangorn packages alter the node labels after rooting, and the > bootstrapping values get assigned to the wrong edges. > > Thus, I would love to use the new root() function, with “edgelabel = TRUE” > option enabled, to midpoint a tree. I would appreciate any suggestions. > > Thanks, > Todd > _______________________________________________ > R-sig-phylo mailing list - R-sig-phylo@r-project.org > https://stat.ethz.ch/mailman/listinfo/r-sig-phylo > Searchable archive at http://www.mail-archive.com/r- > sig-ph...@r-project.org/ -- Klaus Schliep Postdoctoral Fellow Revell Lab, University of Massachusetts Boston http://www.phangorn.org/
library(phangorn) library(ape) data("Laurasiatherian") tree <- nj(dist.ml(Laurasiatherian)) set.seed(42) trees <- bootstrap.phyDat(Laurasiatherian, function(x)nj(dist.ml(x))) tree1 <- plotBS(tree, trees, "phylogram") pdf("Bootstrap.pdf") par(mar=c(1,1,1,1)) par(mfrow=c(3,1)) plot(tree1, show.node.label = TRUE) tree2 <- midpoint(tree1) plot(tree2, show.node.label = TRUE) tree$tip.label[43] tree3 = tree1 # make edge to Cat large ind = which(tree1$edge[,2]==43) tree3$edge.length[ind]=.5 tree3 = midpoint(tree3) plot(tree3, show.node.label = TRUE) dev.off()
Bootstrap.pdf
Description: Adobe PDF document
_______________________________________________ R-sig-phylo mailing list - R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/