[Phylobase-devl] On the ordering of tips...

Thibaut Jombart jombart at biomserv.univ-lyon1.fr
Thu Feb 28 17:19:21 CET 2008


Hi again,

I may write about something that is obvious to certain, but at least it 
was not to me and could be an issue for some users.
Tip labels are not ordered as I thought. I first believed that tip 
labels were given from the bottom to the top of the tree, but this is 
not the case.
I found this simulating trees in apTreeshape and then exporting trees 
back to phylo4:

library(ape)
library(apTreeshape)
library(phylobase)

tre=rtreeshape(1,8,model="yule")[[1]] # one random tree, Yule model
plot(tre) # note that tips are not numbered from the 'bottom' to the 'top'

## conversion to phylo4
tre=as.phylo.treeshape(tre)
tre=as(tre,"phylo4")
plot(tre) # same ordering as previously

But labels() always gives:
 > labels(tre)
[1] "tip 1" "tip 2" "tip 3" "tip 4" "tip 5" "tip 6" "tip 7" "tip 8"

So, *the first tip label is not the label of the first tip, as defined 
by the topology*. (I know that theoretically, there are many graphical 
representation of a tree, so no such 'ordering of tips', but my 
statement is supported by the fact that 'plot' always plots a given tree 
in the same way.)
The first tip label is the label of the first tip appearing in $edge 
(see edges(tre)).
This is not obvious as in ape, by default, tips are numbered in the 
topological order.
For instance, try:
toto=rtree(8)
plot(toto)
toto$tip.label
toto$edge

In addition to complicating the representation of phylo4/phylo4d 
objects, it currently gets the plot of phylo4d confused (the function 
expects data to be ordred according to the topology).

What shall we do? We could:
1) Assume this is how it should be, document it somewhere, correct the 
plot method
2) Make sure that tips are numbered "according to the topology", that 
is, that the first tip in edge in indeed tip #1, etc.
3) Do something else?

Best,

Thibaut.

ps: BTW, sorry for emailing that much these times. I need to use 
phylobase a lot, so I'm going through a bunch of troubles...
-- 
######################################
Thibaut JOMBART
CNRS UMR 5558 - Laboratoire de Biométrie et Biologie Evolutive
Universite Lyon 1
43 bd du 11 novembre 1918
69622 Villeurbanne Cedex
Tél. : 04.72.43.29.35
Fax : 04.72.43.13.88
jombart at biomserv.univ-lyon1.fr
http://lbbe.univ-lyon1.fr/-Jombart-Thibaut-.html?lang=en
http://adegenet.r-forge.r-project.org/


More information about the Phylobase-devl mailing list