collapse_locus_subtree: Collapse a clade into a single tip

Description Usage Arguments Details Value Examples

View source: R/sim_multilocus.R

Description

Collapse a clade into a single tip

Usage

1
2
3
collapse_locus_subtree(list_of_subtrees, locus_to_collapse)

collapse_clade(list_of_subtrees, locus_to_collapse)

Arguments

list_of_subtrees

a list of type 'multiPhylo'

locus_to_collapse

a subtree found within a subst of 'list_of_subtrees'

Details

Takes a clade as input and collapses that clade to one tip in all trees in 'list_of_subtrees'.

Value

multiPhy (list of trees) with the subtree in question collapse

Examples

1
2
3
4
5
6
7
lambda <- 1.0
mu <- 0.2
nt <- 10
trees <- sim_stBD(sbr = lambda, sdr = mu, numbsim = 1, n_tips = nt)
subtrees_of_trees <- ape::subtrees(trees[[1]])
st_of_interest <- subtrees_of_trees[[1]]
collapse_st_of_interest <- collapse_locus_subtree(trees, st_of_interest)

treeducken documentation built on March 3, 2021, 1:11 a.m.