geo_D: Geodesic distance between trees

View source: R/geo_D.R

geo_DR Documentation

Geodesic distance between trees

Description

For any trimmed matrix produced with trimHS_maxC() it prunes the host-symbiont phylogenies to conform with the trimmed matrix and computes geodesic distance between the pruned trees. NOTE: This function can only be used with strictly bifurcating trees.

Usage

geo_D(ths, treeH, treeS, strat = "sequential", cl = 1)

Arguments

ths

A trimmed matrix.

treeH

Host phylogeny. An object of class "phylo".

treeS

Symbiont phylogeny. An object of class "phylo".

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

Geodesic distance

NOTE

The node.label object in both trees can not contain NAs or null 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().

  This function can not be used with the trimmed matrices produced
  with \code{\link[=trimHS_maxI]{trimHS_maxI()}} or with the algorithm
  \code{\link[=max_incong]{max_incong()}} in datasets with
  multiple host-symbiont associations.

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

Schardl C.L., Craven K.D., Speakman S., Stromberg A., Lindstrom A., Yoshida R. (2008). A Novel Test for Host-Symbiont Codivergence Indicates Ancient Origin of Fungal Endophytes in Grasses. Systematic Biology. 57:483–498.

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)
GD <- geo_D(TAM, amphipod, trematode, strat = "sequential", cl = 1)



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