different plots from ape plot.phylo and ggtree based on the same NJ tree

389 views
Skip to first unread message

Haixiao Hu

unread,
Apr 30, 2021, 4:16:52 PM4/30/21
to ggtree
Dear Dr. Yu,

I like the circular plot from the ggtree package very much. 

I made NJ tree using the ape package and then plotted the tree with ape plot.phylo (type="fan") and ggtree circular layout, respectively. Personally, I like the ggtree circular plot better than fan plot with ape. I would like to color the edges of the tree according to groups. However, I found that ape and ggtree displayed clusters of the same NJ tree very differently. Because I started from the same NJ tree, I would expect the two plots should be identical to each other in terms of clusters and colors for each group. 

I attached my code for both plots, could you please give me some hints on what's wrong with it? If possible, could you please correct my code for ggplot? (I guess my code for ape should be correct).

Thank you very much in advance and look forward to your reply!

Best,
Haixiao
ape-plot.phylo_vs_ggtree.pdf

Yu, Guangchuang

unread,
Oct 15, 2021, 2:34:55 AM10/15/21
to Haixiao Hu, ggtree

--
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/5d6519de-37d5-4894-bee0-8e95050852d7n%40googlegroups.com.


--
--~--~---------~--~----~------------~-------~--~----~
Guangchuang Yu PhD
Professor, Director
Department of Bioinformatics
School of Basic Medical Sciences
Southern Medical University
Guangzhou, China
-~----------~----~----~----~------~----~------~--~---
Reply all
Reply to author
Forward
0 new messages