View source: R/extract_deep_frame.R
extract_deep_frame | R Documentation |
Given a rooted phylogenetic tree, extract a subset of tips representing the tree's deepest splits (nodes), thus obtaining a rough "frame" of the tree. For example, if Nsplits=1
and the tree is bifurcating, then two tips will be extracted representing the two clades splitting at the root.
extract_deep_frame(tree,
Nsplits = 1,
only_tips = FALSE)
tree |
A rooted tree of class "phylo". |
Nsplits |
Strictly positive integer, specifying the maximum number of splits to descend from the root. A larger value generally implies that more tips will be extracted, representing a larger number of splits. |
only_tips |
Boolean, specifying whether to only return the subset of extracted tips, rather than the subtree spanned by those tips. If |
The tree may include multi-furcations (i.e. nodes with more than 2 children) as well as mono-furcations (i.e. nodes with only one child). No guarantee is made as to the precise subset of tips extracted.
A named list with the following elements:
tips |
Integer vector with values from 1 to Ntips, listing the indices of the extracted tips. |
subtree |
A new tree of class "phylo", the subtree spanned by the extracted tips. Only included if |
Stilianos Louca
get_pairwise_mrcas
, get_tips_for_mrcas
# generate a random tree
Ntips = 100
tree = generate_random_tree(list(birth_rate_factor=0.1),Ntips)$tree
# extract a subtree representing the deep splits
subtree = extract_deep_frame(tree, Nsplits=3)$subtree
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.