SplitStatus {Quartet} | R Documentation |
Matching partitions
Description
Calculates how many of the partitions present in tree 1 are also present in
tree 2 (s
),
how many of the partitions in tree 1 are absent in tree 2 (d1
),
and how many of the partitions in tree 2 are absent in tree 1 (d2
).
The Robinson-Foulds (symmetric partition) distance is the sum of the
latter two quantities, i.e. d1
+ d2
.
Usage
SplitStatus(trees, cf = trees[[1]])
SharedSplitStatus(trees, cf)
Arguments
trees |
A list of trees of class |
cf |
Comparison tree of class |
Value
Returns a two dimensional array. Rows correspond to the input trees, and are named if names were present. Columns report:
N: The total number of partitions present in the two trees, i.e. P1 + P2.
P1: The number of partitions present in tree 1.
P2: The number of partitions present in tree 2.
s: The number of partitions present in both trees.
d1: The number of partitions present in tree 1, but contradicted by tree 2.
d2: The number of partitions present in tree 2, but contradicted by tree 1.
r1: The number of partitions present in tree 1, and neither present nor contradicted in tree 2.
r2: The number of partitions present in tree 2, and neither present nor contradicted in tree 1.
Functions
-
SharedSplitStatus()
: Reports split statistics obtained after removing all tips that do not occur in both trees being compared.
Author(s)
Martin R. Smith (martin.smith@durham.ac.uk)
References
-
Robinson DF, Foulds LR (1981). “Comparison of phylogenetic trees.” Mathematical Biosciences, 53(1-2), 131–147. doi:10.1016/0025-5564(81)90043-2.
-
Penny D, Hendy MD (1985). “The use of tree comparison metrics.” Systematic Zoology, 34(1), 75–82. doi:10.2307/2413347.
See Also
Other element-by-element comparisons:
CompareQuartetsMulti()
,
CompareQuartets()
,
CompareSplits()
,
PairSharedQuartetStatus()
,
QuartetState()
,
SharedQuartetStatus()
Examples
data("sq_trees")
# Calculate the status of each quartet
splitStatuses <- SplitStatus(sq_trees)
# Calculate the raw symmetric difference (i.e. Robinson–Foulds distance)
RawSymmetricDifference(splitStatuses)
# Normalize the Robinson Foulds distance by dividing by the number of
# splits present in the two trees:
RawSymmetricDifference(splitStatuses) / splitStatuses[, "N"]
# Normalize the Robinson Foulds distance by dividing by the total number of
# splits that it is possible to resolve for `n` tips:
nTip <- length(sq_trees[[1]]$tip.label)
nPartitions <- 2 * (nTip - 3L) # Does not include the nTip partitions that
# comprise but a single tip
RawSymmetricDifference(splitStatuses) / nPartitions