Prunes the host (H) and symbiont (S) phylogenies to conform with trimmed matrices and computes the given global fit method, Geodesic distances (GD), Procrustes Approach to Cophylogeny (PACo) or ParaFit (Legendre et al. 2002) between the pruned trees. Then, determines the frequency or corrected residual of each host-symbiont association occurring in a given percentile of cases that maximize phylogenetic congruence.
max_cong(
HS,
treeH,
treeS,
n,
N,
method = "paco",
symmetric = FALSE,
ei.correct = "none",
percentile = 0.01,
res.fq = TRUE,
strat = "sequential",
cl = 1
)
A dataframe with host-symbiont associations in rows. The first and
second columns display the names of the host and symbiont terminals,
respectively. The third column designates the host-symbiont
association by pasting the names of the terminals, and the fourth
column displays the frequency of occurrence of each host-symbiont
association in p. If res.fq = TRUE
, column 5 displays
the corrected frequencies as a residual.
Host-Symbiont association matrix.
Host phyolgeny. An object of class "phylo".
Symbiont phylogeny. An object of class "phylo".
Number of unique associations.
Number of runs.
Specifies the desired global-fit method (GD, PACo or ParaFit).
The default is PACo
. Options are "geoD"
(Geodesic
Distances), "paco"
(PACo) or "paraF"
(ParaFit).
Specifies the type of Procrustes superimposition. Default
is FALSE
, indicates that the superposition is applied
asymmetrically (S depends on H). If TRUE
, PACo is applied
symmetrically (dependency between S and H is reciprocal).
Specifies how to correct potential negative eigenvalues
from the conversion of phylogenetic distances into Principal
Coordinates: "none"
(the default) indicates that no correction
is applied, particularly if H and S are ultrametric; "sqrt.D"
takes the element-wise square-root of the phylogenetic distances;
"lingoes"
and "cailliez"
apply the classical Lingoes
and Cailliez corrections, respectively.
Percentile to evaluate (p). Default is
0.01
(1\%).
Determines whether a correction to avoid one-to-one
associations being overrepresented in the percentile evaluated.
If TRUE
(default) a residual frequency value (observed -
expected frequency) is computed for each host-symbiont association.
Flag indicating whether execution is to be "sequential"
or "parallel"
. Default is "sequential"
,
resolves R expressions sequentially in the current R
process. If "parallel"
resolves R expressions in parallel in
separate R sessions running in the background.
Number of cluster to be used for parallel computing.
parallelly::availableCores()
returns the number of clusters available.
Default is cl = 1
resulting in "sequential"
execution.
If the node.label
object in both trees contains NAs or empty
values (i.e. no numeric value). All nodes should have a value. Else
remove node labels within the "phylo"
class tree
with tree$node.label <- NULL
. For more details, see
distory::dist.multiPhylo()
data(nuc_pc)
N = 1 #for the example, we recommend 1e+4 value
n = 15
NPc <- max_cong(np_matrix, NUCtr, CPtr, n, N, method = "paco",
symmetric = FALSE, ei.correct = "sqrt.D",
percentile = 0.01, res.fq = FALSE)
Run the code above in your browser using DataLab