Dear Guangchuang & Emmanuel, it seems ladderize assumes that trees are in "cladewise" order, but midpoint returns a tree in "postorder". Emmanuel can you include a phy <- reorder(phy) in ladderize. That should solve the problem.
x<-rtree(10) x2 <- reorder(x, "postorder") plot(ladderize(x2)) # error message y<-phangorn::midpoint(x) y <- reorder(y) plot(ladderize(y)) # works!!! Cheers, Klaus On Sun, Oct 4, 2015 at 10:22 AM, Yu, Guangchuang <[email protected]> wrote: > Dear all, > > In the issue, https://github.com/GuangchuangYu/ggtree/issues/15, we found > that midpoint() is not compatible with ladderize(). > > x<-rtree(10) > y<-phangorn::midpoint(x) > > > y > Phylogenetic tree with 10 tips and 9 internal nodes. > Tip labels: > t8, t1, t4, t6, t10, t3, ... > Rooted; includes branch lengths.> y$edge > [,1] [,2] > [1,] 15 3 > [2,] 15 4 > [3,] 14 2 > [4,] 14 15 > [5,] 13 14 > [6,] 13 5 > [7,] 12 13 > [8,] 12 6 > [9,] 18 1 > [10,] 18 12 > [11,] 19 8 > [12,] 19 9 > [13,] 17 10 > [14,] 17 19 > [15,] 16 7 > [16,] 16 17 > [17,] 11 16 > [18,] 11 18> ape::ladderize(y) > Phylogenetic tree with 10 tips and 9 internal nodes. > Tip labels: > t8, t1, t4, t6, t10, t3, ... > Rooted; includes branch lengths.> ape::ladderize(y)$edge > [,1] [,2] > [1,] 11 18 > [2,] 18 12 > [3,] 16 17 > [4,] 17 19 > [5,] 19 8 > [6,] 19 9 > [7,] 15 4 > [8,] 17 10 > [9,] 18 1 > > any idea? > > > Bests, > Guangchuang > > -- > --~--~---------~--~----~------------~-------~--~----~ > Guangchuang Yu, PhD Candidate > State Key Laboratory of Emerging Infectious Diseases > School of Public Health > The University of Hong Kong > Hong Kong SAR, China > www: http://ygc.name > -~----------~----~----~----~------~----~------~--~--- > > [[alternative HTML version deleted]] > > _______________________________________________ > R-sig-phylo mailing list - [email protected] > https://stat.ethz.ch/mailman/listinfo/r-sig-phylo > Searchable archive at > http://www.mail-archive.com/[email protected]/ > -- Klaus Schliep Postdoctoral Fellow Revell Lab, University of Massachusetts Boston [[alternative HTML version deleted]] _______________________________________________ R-sig-phylo mailing list - [email protected] https://stat.ethz.ch/mailman/listinfo/r-sig-phylo Searchable archive at http://www.mail-archive.com/[email protected]/
