Force same scale on different phylogenetic trees
1
0
Entering edit mode
2.3 years ago

I am using R and ggtree to create phylogenetic trees. I would like to force the same treescale on two different trees to make it easier to compare them (As of now, one scale is at 0.001 while the other is at 0.003).

Is there a function to change this, so that the branch lengths are adjusted to a similar scale in both trees? geom_treescale in ggtree only place the treescale on the tree and doesn't change the branch lengths. Maybe it is possible to normalize the branch lengths somehow?

R • 1.0k views
ADD COMMENT
0
Entering edit mode

Have you find a way to do this?

ADD REPLY
0
Entering edit mode

Please post the code, example data and expected output.

ADD REPLY
3
Entering edit mode
11 weeks ago
rohnerm ▴ 30

I just read your question as I am having the same problem at the moment. Assuming we are really having the same trouble and I am not still totally lost. Anyway, I could find a way to do it.

I directly imported my trees into R in the nwk format. Now you need to make a list of your tree files as followed;

trees=list(tree1, tree2, tree3) class(trees) = "multiPhylo"

And you are done. You can just use facet_wrap with scales fixed and can define the tree scale with geom_treescale

ggtree(trees) + facet_wrap(~.id, scales="fixed") + geom_treescale(width = 0.1)

I hope my answer will help another total beginner like me with R who is struggling:)

Cheers

ADD COMMENT

Login before adding your answer.

Traffic: 1585 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6