tangle_gram {Rtapas} | R Documentation |
Tanglegram of the host-symbiont frequencies
Description
Maps the estimated (in)congruence metrics of the individual host-symbiont associations as heatmap on a tanglegram. It also plots the average frequency (or residual/corrected frequency) of occurrence of each terminal and optionally, the fast maximum likelihood estimators of ancestral states of each node.
Usage
tangle_gram(
treeH,
treeS,
HS,
fqtab,
colscale = "diverging",
colgrad,
nbreaks = 50,
node.tag = TRUE,
cexpt = 1,
link.lwd = 1,
link.lty = 1,
fsize = 0.5,
pts = FALSE,
link.type = "straight",
ftype = "i",
...
)
Arguments
treeH |
Host phylogeny. An object of class |
treeS |
Symbiont phylogeny. An object of class |
HS |
Host-symbiont association matrix. |
fqtab |
Dataframe produced with |
colscale |
Choose between |
colgrad |
Vector of R specified colors defining the color gradient of the heatmap. |
nbreaks |
Number of discrete values along |
node.tag |
Specifies whether maximum likelihood estimators of ancestral
states are to be computed. Default is |
cexpt |
Size of color points at terminals and nodes. |
link.lwd |
Line width for plotting, default to 1. |
link.lty |
Line type. Coded as |
fsize |
Relative font size for tip labels. |
pts |
Logical value indicating whether or not to plot filled circles at
each vertex of the tree, as well as at transition points between
mapped states. Default is |
link.type |
If curved linking lines are desired, set to |
ftype |
Font type. Options are |
... |
Any graphical option admissible in
|
Value
A tanglegram with quantitative information displayed as heatmap.
NOTE
In order to calculate the ancestral states in the phylogenies, all nodes of the trees (node.label) must have a value (NA or empty values are not allowed). In addition, the trees must be time-calibrated and preferably rooted. If one of these elements is missing, an error will be generated and nodes and points of terminals will be displayed as black.
Examples
data(nuc_cp)
N = 10 #for the example, we recommend 1e+4 value
n = 8
NPc <- max_cong(np_matrix, NUCtr, CPtr, n, N, method = "paco",
symmetric = TRUE, ei.correct = "sqrt.D",
percentile = 0.01, res.fq = FALSE,
strat = "parallel", cl = 4)
col = c("darkorchid4", "gold")
tangle_gram(NUCtr, CPtr, np_matrix, NPc, colscale = "sequential",
colgrad = col, nbreaks = 50, node.tag = TRUE)