paco_ss: Procrustes Approach to Cophylogeny (PACo) of the host and...

paco_ssR Documentation

Procrustes Approach to Cophylogeny (PACo) of the host and symbiont configurations

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 Procruste Approach to Cophylogeny (PACo) to produce the squared sum of residuals of the Procrustes superimposition of the host and symbiont configurations in Euclidean space.

Usage

paco_ss(
  ths,
  treeH,
  treeS,
  symmetric = FALSE,
  proc.warns = FALSE,
  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".

symmetric

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).

proc.warns

Switches on/off trivial warnings returned when treeH and treeS differ in size (number of tips). Default is FALSE.

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 sum of squared residuals.

Source

Balbuena J.A., Perez-Escobar O.A., Llopis-Belenguer C., Blasco-Costa I. (2022). User’s Guide Random Tanglegram Partitions V.1.0.0. Zenodo.

References

Balbuena J.A., Miguez-Lozano R., Blasco-Costa I. (2013). PACo: A Novel Procrustes Application to Cophylogenetic Analysis. PLOS ONE. 8:e61048.

Balbuena J.A., Perez-Escobar Ó.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)
PACO <- paco_ss(TAM, amphipod, trematode, symmetric = TRUE,
                ei.correct = "sqrt.D", strat = "parallel", cl = 8)



Rtapas documentation built on June 22, 2024, 10:47 a.m.