Question: How to make a rooted tree ultrametric
gravatar for nancydong20
19 months ago by
nancydong2080 wrote:

Hello all!

I have used OrthoFinder to identify orthogroups among five species. Part of the output is a rooted phylogenetic tree, but I think it is not ultrametric?

I would like to use the tree as part of the input for a CAFE analysis. The CAFE tutorial described using the program r8s to make a tree ultrametric, but I don't know the number of sites in the alignment used to estimate the species tree. TimeTree has approximate divergence time for some of the species in my tree, which I can use to calibrate the tree?

Any suggestions on how I can create an ultrametric phylogenetic tree would be greatly appreciated!


ADD COMMENTlink modified 19 months ago by a.zielezinski8.5k • written 19 months ago by nancydong2080
gravatar for a.zielezinski
19 months ago by
a.zielezinski8.5k wrote:

If you are familiar with Python you can convert a rooted tree into ultrametric topology (all leaves will have the same distance to root) using ETE Toolkit 2-3.

from ete2 import Tree

t = Tree('(A:1,(B:1,(C:1,D:1):0.5):0.5);')
# Root tree at B node.

print('Non-ultrametric rooted tree:')

print('Ultrametric rooted tree:')


Non-ultrametric rooted tree:

Ultrametric rooted tree:
ADD COMMENTlink modified 19 months ago • written 19 months ago by a.zielezinski8.5k

Thank you very much for your response!

This toolkit looks very helpful! I will study up on it.

ADD REPLYlink written 19 months ago by nancydong2080


Thank you for this solution. However, is there also a way to scale the branch lengths into time units (similar to what the r8S or pathD8 program does). If for example the divergence time ("cal" in pathD8, see example below) between B and D (e.g. 50 MYA) and the number of sites of the alignment ("seql" in pathD8, see example below) that was used to create the tree is known, then rescale the branch lengths to time units (see example below with pathD8 (which I can no longer run on OSX))?




pathD8 example in R at :

cal <- rbind(cal1 = c("Rat", "Ostrich", "minage", 260), 
             cal2 = c("Human", "Platypus", "fixage", 125),
             cal3 = c("Alligator", "Ostrich", "minage", 150))
colnames(cal) = c("tax1", "tax2", "age_type", "age")
phy <- read.tree(text = "((((Rat:0.007148,Human:0.001808):0.024345,Platypus:0.016588):0.012920,(Ostrich:0.018119,Alligator:0. 006232):0.004708):0.028037,Frog:0);")
seql <- 1823
pathd8(phy, exec = "/Applications/PATHd8", seql = seql, calibration = cal)
ADD REPLYlink modified 13 months ago • written 13 months ago by wd0
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 799 users visited in the last hour