Version: | 2.0.1 |
Title: | Quantify the Balance of Phylogenetic Trees |
Maintainer: | Martin R. Smith <martin.smith@durham.ac.uk> |
Description: | Measures the degree of balance for a given phylogenetic tree by calculating the Total Cophenetic Index. Reference: A. Mir, F. Rossello, L. A. Rotger (2013). A new balance index for phylogenetic trees. Math. Biosci. 241, 125-136 <doi:10.1016/j.mbs.2012.10.005>. |
URL: | https://github.com/ms609/tci/ |
BugReports: | https://github.com/ms609/TreeTools/issues/ |
Depends: | R (≥ 3.4.0) |
Imports: | TreeTools (≥ 1.4.5) |
Suggests: | ape, testthat |
License: | Unlimited |
Language: | en-GB |
Encoding: | UTF-8 |
ByteCompile: | true |
RoxygenNote: | 7.1.1 |
NeedsCompilation: | no |
Packaged: | 2021-06-23 07:08:10 UTC; ms609 |
Author: | Martin R. Smith |
Repository: | CRAN |
Date/Publication: | 2021-06-23 13:20:01 UTC |
List ancestors
Description
Reports the ancestors of a given node. Now simply a wrapper for TreeTools::ListAncestors()
.
Usage
list.ancestors(parent, child, node)
Arguments
parent |
the 'parent' column of the edges property of a tree of class |
child |
the 'child' column of the edges property of a tree of class |
node |
the number of the node or tip whose ancestors are required. |
Details
To observe the number of a node or tip, use
plot(tree); nodelabels(); tiplabels();
Value
Returns a vector of the numbers of the nodes ancestral to the given node
, including the root node.
Author(s)
Martin R. Smith
See Also
phangorn:::Ancestors
, a less efficient implementation on which this code is based.
Examples
tree <- ape::read.tree(text='(1, (2, (3, (4, 5))));')
edge <- tree$edge
parent <- tree$edge[, 1]
child <- tree$edge[, 2]
list.ancestors(parent, child, 4)
Total Cophenetic Index
Description
Calculate the Total Cophenetic Index for any tree. Now simply a wrapper for TreeTools::TotalCopheneticIndex()
.
Usage
tci(tree)
Arguments
tree |
a tree of class |
Details
The Total Cophenetic Index is a measure of tree balance - i.e. whether a (phylogenetic) tree comprises symmetric pairs of nodes, or has a pectinate 'caterpillar' shape. The index has a greater resolution power than Sackin's and Colless' indices, and can be applied to trees that are not perfectly resolved. Full details are provided by Mir et al. (2013).
Value
Returns the Total Cophenetic Index, a measure of the balance of the tree.
Author(s)
Martin R. Smith
References
A. Mir, F. Rossello, L. A. Rotger, A new balance index for phylogenetic trees. Math. Biosci. 241, 125-136 (2013).
See Also
The 'CollessLike' package (https://github.com/LuciaRotger/CollessLike)
provides an alternative implementation of this index, and its predecessors.
See its function cophen.index
.
The range of possible values for a tree with n tips,
and the values expected under simple models of evolution,
is provided by tci.context(tree)
Examples
tree12 <- ape::read.tree(text='(1, (2, (3, (4, 5))));') #Fig. 4, tree 12
tci(tree12) # 10
tree8 <- ape::read.tree(text='((1, 2, 3, 4), 5);') #Fig. 4, tree 8
tci(tree8) # 6
Contextualize Total Cophenetic Index value
Description
Calculate the range of values that the Total Cophenetic Index can take, and expected values under the Yule and Uniform models of evolution. Now simply a wrapper for TreeTools::TCIContext()
.
Usage
tci.context(tree)
tci.context.n(n)
Arguments
tree |
a tree of class |
n |
integer specifying the number of tips in a tree. |
Details
For a tree with n tips, the Total Cophenetic Index can take values of 0 to choose(nTips, 3)
The minimum value is higher for a perfectly resolved (i.e. dichotomous) tree (see Lemma 14)
Formulae to calculate the expected values under the Yule and Uniform models of evolution are given in Theorems 17 and 23.
Value
A data frame detailing the maximum and minimum value obtainable for the Total Cophenetic Index for dichotomous trees with the number of tips of the given tree, and the expected value under the Yule and Uniform models. The variance of the expected value is given under the Yule model, but cannot be obtained by calculation for the Uniform model.
Author(s)
Martin R. Smith
References
A. Mir, F. Rossello, L. A. Rotger, A new balance index for phylogenetic trees. Math. Biosci. 241, 125-136 (2013).
See Also
tci
, the Total Cophenetic Index for a given tree
Examples
tree12 <- ape::read.tree(text='(1, (2, (3, (4, 5))));') #Fig. 4, tree 12
tci(tree12)
tci.context(tree12)
tci.context.n(5) # For any tree with 5 tips