Question: How to make a rooted tree ultrametric
0
gravatar for nancydong20
6 months ago by
nancydong2060
nancydong2060 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!

Nancy

ADD COMMENTlink modified 6 months ago by a.zielezinski7.4k • written 6 months ago by nancydong2060
3
gravatar for a.zielezinski
6 months ago by
a.zielezinski7.4k
a.zielezinski7.4k 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.
t.set_outgroup('B')  

print('Non-ultrametric rooted tree:')
print(t.write())

t.convert_to_ultrametric()
print('Ultrametric rooted tree:')
print(t.write())

Output:

Non-ultrametric rooted tree:
(B:0.5,((C:1,D:1)1:0.5,A:1.5)1:0.5);

Ultrametric rooted tree:
(B:2,((C:0.666667,D:0.666667)1:0.666667,A:1.33333)1:0.666667);
ADD COMMENTlink modified 6 months ago • written 6 months ago by a.zielezinski7.4k

Thank you very much for your response!

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

ADD REPLYlink written 6 months ago by nancydong2060

Hi

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))?

Regards

Wannes

#

pathD8 example in R at https://rdrr.io/github/heibl/ips/man/pathd8.html :

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 16 days ago • written 16 days ago by wd0
Please log in to add an answer.

Help
Access

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