link_freq: Frequency of host-symbiont association

link_freqR Documentation

Description

Determines the frequency (or residual/corrected frequency) of each host-symbiont association in a given percentile of cases that maximize phylogenetic (in)congruence.

Usage

link_freq(
  x,
  fx,
  HS,
  percentile = 0.01,
  sep = "-",
  below.p = TRUE,
  res.fq = TRUE
)

Arguments

x

List of trimmed matrices produced by trimHS_maxC() or trimHS_maxI().

fx

Vector of statistics produced with geo_D(), paco_ss() or paraF()

HS

Host-symbiont association matrix.

percentile

Percentile to evaluate (p). Default is 0.01 (1\%).

sep

Character that separates host and symbiont labels.

below.p

Determines whether frequencies are to be computed below or above the percentile set. Default is TRUE.

res.fq

Determines whether a correction to avoid one-to-one associations being overrepresented in the percentile evaluated. If TRUE (default) a residual frequency value (observed - expected frequency) is computed for each host-symbiont association.

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. If res.fq = TRUE, column 5 displays the corrected frequencies as a residual.

NOTE

The res.fq = TRUE correction is recommended in tanglegrams with large portion of multiple (as opposed to one-to-one) host-symbiont associations. For future usage, frequencies of host-symbiont associations above a given percentile values can also be computed setting below.p = FALSE.

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)
LFPACO <- link_freq(TAM, PACO, am_matrix, percentile = 0.01,
                    below.p = TRUE, res.fq = TRUE)



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