Plot two trees to check congruency?

574 views
Skip to first unread message

Daniel Lundin

unread,
Apr 8, 2021, 2:42:00 PM4/8/21
to ggtree
Hi,

I'd like to plot two trees with the same labels side by side to check to what extent they're congruent. An example of what I'd like to achieve: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3724504/figure/F3/?report=objectonly

I have tried the ggdensitree() function, but the result is messy, probably because clades and taxa are ordered differently in the two trees. I've looked through chapter 6 ("Visual exploration of phylogenetic tree") in the handbook but I fail to come up with a good strategy for how to loop through the two trees and ensure they are as similarly sorted as possible.

Does anyone have any ideas I could explore?

/D

Leonardo Borges

unread,
Apr 8, 2021, 4:11:13 PM4/8/21
to Daniel Lundin, ggtree
Daniel,

I have never tried it, but if I am not mistaken you could try dendextend's tanglegram function

https://www.rdocumentation.org/packages/dendextend/versions/1.14.0/topics/tanglegram


Cheers,

Leo






--
1. G Yu*. Using ggtree to visualize data on tree-like structures. Current Protocols in Bioinformatics. 2020, 69:e96. https://doi.org/10.1002/cpbi.96
2. LG Wang, TTY Lam, S Xu, Z Dai, L Zhou, T Feng, P Guo, CW Dunn, BR Jones, T Bradley, H Zhu, Y Guan, Y Jiang, G Yu*. treeio: an R package for phylogenetic tree input and output with richly annotated and associated data. Molecular Biology and Evolution. 2020, 37(2):599-603. http://dx.doi.org/10.1093/molbev/msz240
3. G Yu*, TTY Lam, H Zhu, Y Guan*. Two methods for mapping and visualizing associated data on phylogeny using ggtree. Molecular Biology and Evolution, 2018, 35(2):3041-3043. https://doi.org/10.1093/molbev/msy194
4. G Yu, DK Smith, H Zhu, Y Guan, TTY Lam*. ggtree: an R package for visualization and annotation of phylogenetic trees with their covariates and other associated data, Methods in Ecology and Evolution, 2017, 8(1):28-36. https://doi.org/10.1111/2041-210X.12628
5. Book: https://yulab-smu.top/treedata-book/
---
You received this message because you are subscribed to the Google Groups "ggtree" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bioc-ggtree...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bioc-ggtree/2dabd58b-3a74-48b2-a403-a070101c6cban%40googlegroups.com.

Daniel Lundin

unread,
Apr 9, 2021, 12:53:37 AM4/9/21
to ggtree
torsdag 8 april 2021 kl. 22:11:13 UTC+2 skrev aquite...@gmail.com:
Looks promising, thanks Leo!

Cheers,

Leo

/D

xush...@gmail.com

unread,
May 7, 2021, 9:31:52 AM5/7/21
to ggtree

I think you also can refer to this

Reply all
Reply to author
Forward
0 new messages