Computes Pearson correlation between pairwise phylogenetic distances in host and symbiont trees. Tests the null hypothesis of no association between host and symbiont topology (Hommola et al. 2011).
Arguments
- i_host_subtree_dist
A distance matrix (e.g., from
dist()oradephylo::distTips()) for the host subtree tips- i_symbiont_subtree_dist
A distance matrix for the symbiont subtree tips
- i_host_to_symbiont_df
A data frame with "Host" and "Symbiont" columns linking each symbiont to its host
Value
A numeric correlation coefficient (Pearson's r) ranging from -1 to 1. Higher positive values indicate symbiont topology more closely matches host topology. Returns 0 if all host distances are identical (degenerate case).
Examples
# \donttest{
library(adephylo)
#> Loading required package: ade4
h_tree <- ape::rtree(5)
s_tree <- ape::rtree(15)
hs_df <- data.frame(
Host = rep(h_tree$tip.label, 3),
Symbiont = s_tree$tip.label
)
h_dist <- distTips(h_tree, method = "patristic")
s_dist <- distTips(s_tree, method = "patristic")
r <- hommola(h_dist, s_dist, hs_df)
# }
