The rotateConstr() function does not give me any errors - Here is how I was trying to use it:
With a 200 taxon tree (tree A), I rotated ~50 nodes using rotate() to get it how I wanted. With a mostly similar (topologically identical, but different branch lengths, so node numbers are not exactly the same as in tree A) 200 taxon tree (tree B), I tried: newtree <- rotateConstr(treeB, treeA$tip.label) this produced a newtree but the ordering looks nothing like treeA - it’s mostly jumbled. The root is changed etc… Is this the incorrect use of rotateConstr()? Jake > On Apr 8, 2015, at 10:57 AM, Emmanuel Paradis <emmanuel.para...@ird.fr> wrote: > > Hi Jacob, > > Can you send an example of your output with rotateConstr()? Thanks. > > Best, > > Emmanuel > > Le 08/04/2015 06:41, Jacob Berv a écrit : >> Hi all, >> >> Is there an easy way to get R to automatically rotate the nodes of a >> phylogeny to match an arbitrary ordering of the tips? >> >> Consider the following two situations - >> >> Situation 1: >> >> Say I have a particular taxonomic order, such as >> >> SpeciesA, SpeciesC, SpeciesB >> >> And I want to rotate the nodes of ((C,B),A) to match it - ie to >> automatically rotate the nodes to give (A(C,B)) >> >> >> Situation 2: >> >> Say I have tree 1 ((C,B),A) and I want to rotate it’s nodes to match the >> order of tree 2 (A,(B,C)) >> >> Currently the only way I know how to accomplish either scenario is to use >> the ape function rotate() on each relevant node, but this quickly becomes a >> very tedious task when you have hundreds of nodes to go through and want to >> achieve a particular ordering. >> >> Any thoughts or tips on how to accomplish either of the two scenarios I >> describe above in a generalizable way that scales to hundreds of tips/nodes? >> >> There is an example in the rotate() documenatation using rotateConstr(): >> # a simple example for rotateConstr: >> A <- read.tree(text = "((A,B),(C,D));") >> B <- read.tree(text = "(((D,C),B),A);") >> B <- rotateConstr(B, A$tip.label) >> plot(A); plot(B, d = "l") >> >> But this doesn’t seem to work when I try it on my larger trees. Not sure >> where I’m going wrong… >> >> Best, >> >> Jacob Berv >> >> Ph.D. Student >> Lovette Lab >> Cornell Laboratory of Ornithology >> >> >> [[alternative HTML version deleted]] >> >> _______________________________________________ >> 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/ >> _______________________________________________ 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/