max_cong {Rtapas} | R Documentation |
Algortihm for maximizing congruence between two phylogenies
Description
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.
Usage
max_cong(
HS,
treeH,
treeS,
n,
N,
method = "paco",
symmetric = FALSE,
ei.correct = "none",
percentile = 0.01,
res.fq = TRUE,
strat = "sequential",
cl = 1
)
Arguments
HS |
Host-Symbiont association matrix. |
treeH |
Host phyolgeny. An object of class "phylo". |
treeS |
Symbiont phylogeny. An object of class "phylo". |
n |
Number of unique associations. |
N |
Number of runs. |
method |
Specifies the desired global-fit method (GD, PACo or ParaFit).
The default is |
symmetric |
Specifies the type of Procrustes superimposition. Default
is |
ei.correct |
Specifies how to correct potential negative eigenvalues
from the conversion of phylogenetic distances into Principal
Coordinates: |
percentile |
Percentile to evaluate (p). Default is
|
res.fq |
Determines whether a correction to avoid one-to-one
associations being overrepresented in the percentile evaluated.
If |
strat |
Flag indicating whether execution is to be |
cl |
Number of cluster to be used for parallel computing.
|
Value
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.
NOTE
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()
Examples
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)