link_freq {Rtapas} | R Documentation |
Frequency of host-symbiont association
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
|
fx |
Vector of statistics produced with |
HS |
Host-symbiont association matrix. |
percentile |
Percentile to evaluate (p). Default is
|
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 |
res.fq |
Determines whether a correction to avoid one-to-one
associations being overrepresented in the percentile evaluated.
If |
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)