Find branches that are non-overlapping with specified branches in a tree
Source:R/tree_findExcl.R
findExcl.Rd
Find all branches whose leaves do not overlap with those of the specified branches.
Examples
suppressPackageStartupMessages({
library(ggtree)
library(TreeSummarizedExperiment)
})
data(tinyTree)
ggtree(tinyTree, branch.length = "none") +
geom_text2(aes(label = node)) +
geom_hilight(node = 17, fill = "blue", alpha = 0.3) +
geom_hilight(node = 13, fill = "orange", alpha = 0.3)
## Find branches whose leaves do not overlap with the two colored branches.
## The returned branches are represented at the highest tree level
## possible without including any of the forbidden branches.
findExcl(tree = tinyTree, node = c(17, 13))
#> Node_19 t5 t3
#> 19 9 10