[R-sig-phylo] ladderize + drop.tip = shuffled node labels

2012-10-02 Thread Rebecca Best
Hi all

I have been plotting some pruned trees recently, and have run into a
problem using drop.tip() after ladderize(). If you ladderize() and
then drop tips from the ladderized tree, then at least in my case the
node labels are no longer correct. This may be an unlikely sequence of
commands, but I thought I'd post this in case it is an easy fix, or it
helps anyone else avoid issues.
Thanks!

Rebecca

##

require(ape)

#read tree


mytree-read.tree()
((D,(E,G)1)1,((H,J)0.8,(K,(((L,M)0.5,(N,O)0.6)1,(P,(Q,R)1)1)0.7)1)1);

#ladderize tree

mytree.lad-ladderize(mytree)

#node labels display on both trees correctly

plot(mytree,show.node.label=TRUE)
plot(mytree.lad,show.node.label=TRUE)

#drop tips from both trees

drop.mytree-drop.tip(mytree,c(L,D,G))
drop.mytree.lad-drop.tip(mytree.lad,c(L,D,G))

#plot both trees, node labels are incorrect for ladderized tree

plot(drop.mytree,show.node.label=TRUE)
plot(drop.mytree.lad,show.node.label=TRUE)

___
R-sig-phylo mailing list
R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo


[R-sig-phylo] Add species branches to genus level tree

2012-10-02 Thread Davies, Thomas
Dear All

Sorry to mass email with what could be a very basic question.  I am trying to 
generate a tree for 1000 plus species.  To reduce the search effort I first 
generated a tree to genus level from NCBI Itol with the intention of adding 
species branches to each genus after.  Doing this manually has invariably 
proved challenging as it's difficult to locate and solve all the sources of 
human error that creep in when manual editing.  Is there a function in R that 
can do this?  Say something that matches the genus in the species name to the 
genus tip on the tree, and adds branches accordingly? It is not my intention 
that the tree be based on divergence times, this isn't feasible given the 
number and order of species I am working with, hence the reason for using the 
NCBI taxonomy.

Any help is much appreciated

cheers

Tom
___
R-sig-phylo mailing list
R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo


Re: [R-sig-phylo] Add species branches to genus level tree

2012-10-02 Thread David Bapst
Thomas-
I think your interests might be served by my function expandTaxonTree
in my library paleotree on CRAN. Given a genus-level tree with data on
the species within each genus, it will turn each genus into an
unresolved polytomy of the congeneric species.
-Dave

On Tue, Oct 2, 2012 at 3:08 AM, Davies, Thomas
thomas.dav...@exeter.ac.uk wrote:
 Dear All

 Sorry to mass email with what could be a very basic question.  I am trying to 
 generate a tree for 1000 plus species.  To reduce the search effort I first 
 generated a tree to genus level from NCBI Itol with the intention of adding 
 species branches to each genus after.  Doing this manually has invariably 
 proved challenging as it's difficult to locate and solve all the sources of 
 human error that creep in when manual editing.  Is there a function in R that 
 can do this?  Say something that matches the genus in the species name to the 
 genus tip on the tree, and adds branches accordingly? It is not my intention 
 that the tree be based on divergence times, this isn't feasible given the 
 number and order of species I am working with, hence the reason for using the 
 NCBI taxonomy.

 Any help is much appreciated

 cheers

 Tom
 ___
 R-sig-phylo mailing list
 R-sig-phylo@r-project.org
 https://stat.ethz.ch/mailman/listinfo/r-sig-phylo



-- 
David Bapst
Dept of Geophysical Sciences
University of Chicago
5734 S. Ellis
Chicago, IL 60637
http://home.uchicago.edu/~dwbapst/
http://cran.r-project.org/web/packages/paleotree/index.html

___
R-sig-phylo mailing list
R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo