ggtree(tree1_midpointrooted, branch.length="none", layout="circular", aes(angle=angle)) +
+ geom_tiplab2(aes(label=label, subset=(grepl("Mqua",label)==TRUE)), color="green")
ggtree(tree1_midpointrooted, branch.length="none", layout="circular", aes(angle=angle)) +
+ geom_tiplab(aes(label=label, subset=(grepl("Mqua",label)==TRUE)), color="green")
In github version of ggtree, geom_tiplab2 can work with user define subsetting.
library(ggtree)
set.seed(20180224)
x = rtree(30)
ggtree(x, layout='circular') +
geom_tiplab2(aes(subset = node < 15))
--
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
Homepage: https://guangchuangyu.github.io/ggtree
---
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+unsubscribe@googlegroups.com.
To post to this group, send email to bioc-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bioc-ggtree/72e18c5b-0ce5-4c25-80fa-3e2dabda8f72%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
In github version of ggtree, geom_tiplab2
can work with user define subsetting.
library(ggtree)
set.seed(20180224)
x = rtree(30)
ggtree(x, layout='circular') +
geom_tiplab2(aes(subset = node < 15))
In github version of ggtree, geom_tiplab2 can work with user define subsetting.
library(ggtree) set.seed(20180224) x = rtree(30) ggtree(x, layout='circular') + geom_tiplab2(aes(subset = node < 15))
On Thu, Feb 22, 2018 at 3:59 PM, Ales Bucek <bucek...@gmail.com> wrote:
Hi!
I wan to draw a circular tree with only those tip labels shown which match a "Mqua" pattern. I want to use geom_tiplab2 to nicely orient the tip labels, but grepl apparently does not work and all tip labels are shown instead:
ggtree(tree1_midpointrooted, branch.length="none", layout="circular", aes(angle=angle)) +
+ geom_tiplab2(aes(label=label, subset=(grepl("Mqua",label)==TRUE)), color="green")
On the other side, when I use geom_tiplab, only the labels containing "Mqua" are shown according to my expectation:
ggtree(tree1_midpointrooted, branch.length="none", layout="circular", aes(angle=angle)) +
+ geom_tiplab(aes(label=label, subset=(grepl("Mqua",label)==TRUE)), color="green")
Do you have any hints how to get the nice orientation of labels as in geom_tiplab2() while also using subset and grepl to select particular labels?
Thanks in advance!
Ales
--
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
Homepage: https://guangchuangyu.github.io/ggtree
---
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/bioc-ggtree/72e18c5b-0ce5-4c25-80fa-3e2dabda8f72%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
aes(subset=(grepl("Mqua",label)
))To unsubscribe from this group and stop receiving emails from it, send an email to bioc-ggtree+unsubscribe@googlegroups.com.
To post to this group, send email to bioc-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bioc-ggtree/c800a6a7-0b39-4e55-ba3d-db5a688b169f%40googlegroups.com.
but I get an error while loading the package:
>library(ggtree)
Error: package or namespace load failed for ‘ggtree’:
object ‘groupClade’ is not exported by 'namespace:treeio'
aes(subset=(grepl("Mqua",label)
))
To view this discussion on the web visit https://groups.google.com/d/msgid/bioc-ggtree/c800a6a7-0b39-4e55-ba3d-db5a688b169f%40googlegroups.com.