When I collapse the nodes 75 and 76 it does improve the appearance. but the out groups are still on a long branch.
Is it possible to produce a plot such as the one I created manually below where the branch lengths for the out groups is ignored
You can use groupClade
to group the 151
clade and use that info to set the linetype. For shortening 75
and 76
, you can manipulate their x
position.
library(ggtree)
x <- read.tree("long-branch-example.newick")
groupClade(x, 151) -> y
ggtree(y, aes(linetype=group)) + geom_tiplab(size = 2) -> p
p$data[tree$data$node %in% c(75, 76), "x"] = mean(p$data$x)
print(p)
To view this discussion on the web visit https://groups.google.com/d/msgid/bioc-ggtree/ec55f9af-afd2-400f-9b85-f66a8b4253a9%40googlegroups.com.--
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.
Sorry for typo. pls use the following code:
library(ggtree)
x <- read.tree("long-branch-example.newick")
groupClade(x, 151) -> y
ggtree(y, aes(linetype=group)) + geom_tiplab(size = 2
) -> p
p$data[p$data$node %in% c(75, 76), "x"] = mean(p$data$x)
print(p)