[R-sig-phylo] edge representation of trees produced by birthdeath.tree() in geiger

Liam J. Revell liam.revell at umb.edu
Fri Sep 9 14:08:32 CEST 2011


Hi Andrew.

This is because the numbers in tre$edge are node & tip numbers, not tip 
labels (which also can be numbers).  The translation between tip numbers 
and tip labels is given by tre$tip.label.  Here, tip labels are indexed 
by their numbers in tre$edge.

For instance, in your case we have:

 > tre$edge
       [,1] [,2]
  [1,]   10   11
  [2,]   11   12
  [3,]   12   13
  [4,]   13    1
  [5,]   13    2
... (some rows excluded)

and:

 > tre$tip.label
[1] "8" "9" "3" "1" "6" "7" "2" "4" "5"

This tells us, to take your example, that node 13 should be connected to 
tips 1 & 2, which tre$tip.label tells us have labels "8" & "9", just as 
we see with:

 > plot(tre); nodelabels()

I hope this clears things up somewhat.

All the best, Liam

-- 
Liam J. Revell
University of Massachusetts Boston
web: http://faculty.umb.edu/liam.revell/
email: liam.revell at umb.edu
blog: http://phytools.blogspot.com

On 9/9/2011 7:51 AM, Andrew Barr wrote:
> library(ape)
> tre<-read.tree(text="((((8:2.850732306,9:0.1789410068):1.147884602,3:0.8848821048):1.411242805,(1:3.869881809,((6:0.6904865854,7:0.02044458561):1.984259398,2:0.04497273798):0.3022512176):0.09298177296):0.3029547699,(4:0.8015431218,5:1.467916249):2.117025776);")



More information about the R-sig-phylo mailing list