tips_by_clade: Retrieve tree tips by clade (node) number from a phylogenetic...

Description Usage Arguments Value Examples

Description

You can subset tree tips by node / clade number from a given tree.

Usage

1

Arguments

x

an object of a class phylo.

y

a numerical vector denoting tree nodes.

Value

a tibble with two columns 1) tips 2) clade_id

Examples

1
2
3
4
5
6
7
## Not run: 
tree_text <- "((XP_005187699_1__Musca_domestica:0.070627277,(XP_019893806_1__Musca_domestica:0.071069674,((XP_013113221_1__Stomoxys_calcitrans:0.1494662042,ACB98719_1__Glossina_morsitans_morsitans:0.3489851076)67.4/100:0.0470213767,XP_013102958_1__Stomoxys_calcitrans:0.1794878827)98.1/100:0.0959227604)88.2/99:0.0323598861)93/99:0.0435291148,((XP_017472861_1__Rhagoletis_zephyria:0.0049337059,XP_017472862_1__Rhagoletis_zephyria:0.0112391294)97.3/100:0.0860969479,(XP_020713236_1__Ceratitis_capitata:0.2642805176,(XP_014102010_1__Bactrocera_oleae:0.1183517872,XP_018784523_1__Bactrocera_latifrons:0.1137567198)29.6/88:0.0758551876)99.9/100:0.247740081)92/100:0.0716529011)34.3/66:2.487103817;"
tr <- treeio::read.tree(text = tree_text)
ggtree::ggtree(tr) + ggtree::geom_nodelab(ggplot2::aes(label = node)) + ggtree::geom_tiplab()
tips_subset <- tips_by_clade(tr, c(15, 18))

## End(Not run)

cparsania/phyloR documentation built on Aug. 6, 2020, 7:28 a.m.