paraF {Rtapas}R Documentation

Test of host-symbiont coevolution

Description

For any trimmed matrix produced with trimHS_maxC() or trimHS_maxI(), it prunes the host (H) and symbiont (S) phylogenies to conform with the trimmed matrix and runs ape::parafit() (Legendre et al. 2002) to calculate the ParaFitGlobal Statistic.

Usage

paraF(ths, treeH, treeS, ei.correct = "none", strat = "sequential", cl = 1)

Arguments

ths

Trimmed matrix.

treeH

Host phylogeny. An object of class "phylo".

treeS

Symbiont phylogeny. An object of class "phylo".

ei.correct

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.

strat

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.

cl

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.

Value

A number object with the ParaFitGlobal Statistic of host-symbiont test for the N trimmed matrix.

References

Legendre P., Desdevises Y., Bazin E. (2002). A Statistical Test for Host–Parasite Coevolution. Systematic Biology. 51:217–234.

Balbuena J.A., Perez-Escobar O.A., Llopis-Belenguer C., Blasco-Costa I. (2020). Random Tanglegram Partitions (Random TaPas): An Alexandrian Approach to the Cophylogenetic Gordian Knot. Systematic Biology. 69:1212–1230.

Examples


data(amph_trem)
N = 10 #for the example, we recommend 1e+4 value
n = 8

TAM <- trimHS_maxC(N, am_matrix, n, check.unique = TRUE)
PF <- paraF(TAM, amphipod, trematode, ei.correct = "sqrt.D",
           strat = "parallel", cl = 8)




[Package Rtapas version 1.2 Index]