View source: R/tree_distance_transfer.R
| TransferDist | R Documentation |
Compute the transfer dissimilarity between phylogenetic trees, as defined by \insertCiteTakazawa2026;textualTreeDist. The transfer dissimilarity uses the transfer distance \insertCiteLemoine2018TreeDist to compare bipartitions, providing a finer-grained measure than the Robinson–Foulds distance. Each split in each tree is scored by how many taxa must be moved to match its closest counterpart in the other tree, and these scores are summed.
TransferDist(
tree1,
tree2 = NULL,
scale = TRUE,
normalize = FALSE,
reportMatching = FALSE
)
TransferDistance(
tree1,
tree2 = NULL,
scale = TRUE,
normalize = FALSE,
reportMatching = FALSE
)
TransferDistSplits(
splits1,
splits2,
nTip = attr(splits1, "nTip"),
scale = TRUE,
reportMatching = FALSE
)
tree1, tree2 |
Trees of class |
scale |
Logical; if |
normalize |
If a numeric value is provided, this will be used as a
maximum value against which to rescale results.
If |
reportMatching |
Logical specifying whether to return the clade matchings as an attribute of the score. |
splits1, splits2 |
Logical matrices where each row corresponds to a leaf,
either listed in the same order or bearing identical names (in any sequence),
and each column corresponds to a split, such that each leaf is identified as
a member of the ingroup ( |
nTip |
(Optional) Integer specifying the number of leaves in each split. |
The scaled variant divides each split's contribution by its depth minus
one, giving equal weight to all splits regardless of their depth (analogous
to the Robinson–Foulds distance). The unscaled variant uses raw transfer
distances, giving more weight to deep splits. Neither variant satisfies
the triangle inequality for trees with six or more tips.
TransferDist() returns an object of class dist (if tree2 is
NULL), a numeric matrix (if both tree1 and tree2 are lists), or a
numeric value (for a single pair). If reportMatching = TRUE, the
return value carries matching and pairScores attributes.
When normalize = TRUE, the scaled transfer dissimilarity is divided by
2 * (n - 3), placing it in the range [0, 1]. The unscaled version is
divided by the maximum possible unscaled dissimilarity
(following \insertCiteTakazawa2026;textualTreeDist).
Other tree distances:
HierarchicalMutualInfo(),
JaccardRobinsonFoulds(),
KendallColijn(),
MASTSize(),
MatchingSplitDistance(),
NNIDist(),
NyeSimilarity(),
PathDist(),
Robinson-Foulds,
SPRDist(),
TreeDistance()
library(TreeTools)
TransferDist(BalancedTree(8), PectinateTree(8))
TransferDist(BalancedTree(8), PectinateTree(8), scale = FALSE)
# All-pairs
TransferDist(as.phylo(0:5, 8))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.