visualizing a list of trees

164 views
Skip to first unread message

Weijian Guo

unread,
May 17, 2019, 4:06:36 AM5/17/19
to ggtree
Hi!
I'm using ggtree to visualise a phylogeny in R, and I've followed the guide for visualizing a list of trees.
However, when I add a layer of the best tree on the top of the density tree, the tiplabel was wrong. I want to know why and how to fix it. 
Here are my trees.

best_tree.png

trees.png



And here are my code.
library(ggtree)
btrees <- read.tree('samll.tre')
best_tree <- read.tree('best.tre')
df <- fortify(best_tree, branch.length='none')
ggtree(btrees, layout="slanted", color="lightblue", alpha=.3) +
  geom_tree(data=df, layout="slanted", size=3, color='firebrick')+
  geom_tiplab(size=10, color="purple")+ggtitle("trees")

ggtree(best_tree,layout="slanted")+geom_tiplab(size=5, color="purple")+ggtitle("best_tree")

Thank you.
Best wishes,
Weijian Guo

Yu, Guangchuang

unread,
May 17, 2019, 4:29:45 AM5/17/19
to Weijian Guo, ggtree
what you need is a ggdensitree function, see https://github.com/GuangchuangYu/ggtree/issues/221.

--
1. 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. doi: 10.1093/molbev/msy194
2. 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. doi:10.1111/2041-210X.12628
3. Book: https://yulab-smu.github.io/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 post to this group, send email to bioc-...@googlegroups.com.
Visit this group at https://groups.google.com/group/bioc-ggtree.
To view this discussion on the web visit https://groups.google.com/d/msgid/bioc-ggtree/125b572b-5e30-4519-bf6f-a216417830f7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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