Dear Kamila, plotBS checks if trees are rooted or not and if not midpoint roots the tree nrooted <- root(nj(dist),outgroup=x) is.rooted(nrooted) # returns FALSE however the ape function does not pick up that the tree is rooted. Add the argument resolve.root=TRUE: nrooted <- root(nj(dist),outgroup=x, resolve.root=TRUE) is.rooted(nrooted) # returns TRUE This should solve your problem.
Regards, Klaus On Mon, Aug 31, 2015 at 8:56 AM, Kamila Naxerova <knaxer...@partners.org> wrote: > Hi all, > > I have a (almost certainly trivial) question about plotting a rooted tree > with bootstrap values using ape and phangorn. I am using a simple script > that looks like this: > > dist <- daisy(matrix,metric="gower") > nrooted <- root(nj(dist),outgroup=x) > > plot(nrooted) ## this plots the tree with the correct root, just the way I > want it > > # now I would like to put some bootstrap values on this tree > f <- function (xx) root(nj(daisy(xx,metric="gower")),outgroup=x) > b <- boot.phylo(nrooted,matrix,FUN = f, B=1000, trees=T) > tree <- plotBS(nrooted,b$trees,type="phylogram”) > > The tree that is produced by plotBS has lost the root I assigned it. I > would be really grateful is somebody could point out to me how to do this > right! > > Thanks so much. > Kamila > > > The information in this e-mail is intended only for th...{{dropped:28}} _______________________________________________ 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/