PACo: Performs PACo analysis.

Description Usage Arguments Value Note Examples

View source: R/PACo.r

Description

Two sets of Principal Coordinates are superimposed by Procrustes superimposition. The sum of squared residuals of this superimposition give an indication of how congruent the two datasets are. For example, in a biological system the two sets of Principal Coordinates can be composed from the phylogenetic distance matrices of two interacting groups. The congruence measured by PACo indicates how concordant the two phylogenies are based on observed ecological interactions between them.

Usage

1
2
3
4
5
6
7
8
9
PACo(
  D,
  nperm = 1000,
  seed = NA,
  method = "r0",
  symmetric = FALSE,
  proc.warnings = TRUE,
  shuffled = FALSE
)

Arguments

D

A list of class paco as returned by paco::add_pcoord which includes Principal Coordinates for both phylogenetic distance matrices.

nperm

The number of permutations to run. In each permutation, the network is randomized following the method argument and phylogenetic congruence between phylogenies is reassessed.

seed

An integer with which to begin the randomizations. If the same seed is used the randomizations will be the same and results reproducible. If NA a random seed is chosen.

method

The method with which to permute association matrices: "r0", "r1", "r2", "c0", "swap", "quasiswap", "backtrack", "tswap", "r00". Briefly, "r00" produces the least conservative null model as it only maintains total fill (i.e., total number of interactions). "r0" and "c0" maintain the row sums and column sums, respectively, as well as the total number of interactions. "backtracking" and any of the "swap" algorithms conserve the total number of interactions in the matrix, as well as both row and column sums. Finally, "r1" and "r2" conserve the row sums, the total number of interactions, and randomize based on observed interaction frequency. See vegan::commsim for more details.

symmetric

Logical. Whether or not to use the symmetric Procrustes statistic, or not. When TRUE, the symmetric statistic is used. When FALSE, the asymmetric is used. A decision on which to use is based on whether one group is assumed to track the evolution of the other, or not.

proc.warnings

Logical. Make any warnings from the Procrustes superimposition callable. If TRUE, any warnings are viewable with the warnings() command. If FALSE, warnings are internally suppressed. Default is TRUE

shuffled

Logical. Return the Procrustes sum of squared residuals for every permutation of the network. When TRUE, the Procrustes statistic of all permutations is returned as a vector. When FALSE, they are not returned.

Value

A paco object that now includes (alongside the Principal Coordinates and input distance matrices) the PACo sum of sqaured residuals, a p-value for this statistic, and the PACo statistics for each randomisation of the network if shuffled=TRUE in the PACo call.

Note

Any call of PACo in which the distance matrices have differing dimensions (i.e., different numbers of tips of the two phylogenies) will produce warnings from the vegan::procrustes function. These warnings require no action by the user but are merely letting the user know that, as the distance matrices had differing dimensions, their Principal Coordinates have differing numbers of columns. vegan::procrustes deals with this internally by adding columns of zeros to the smaller of the two until the are the same size.

Examples

1
2
3
4
5
6
7
8
data(gopherlice)
require(ape)
gdist <- cophenetic(gophertree)
ldist <- cophenetic(licetree)
D <- prepare_paco_data(gdist, ldist, gl_links)
D <- add_pcoord(D)
D <- PACo(D, nperm=10, seed=42, method="r0")
print(D$gof)

Example output

Loading required package: ape
There were 11 warnings (use warnings() to see them)
$p
[1] 0

$ss
[1] 0.07310926

$n
[1] 10

paco documentation built on Aug. 26, 2020, 1:06 a.m.

Related to PACo in paco...