plotAnc
plots a phylogeny and adds character to the nodes. Either
takes output from ancestral.pars
or ancestral.pml
or from an
alignment where there are node labels in the tree match the constructed
sequences in the alignment.
Usage
# S3 method for ancestral
plot(x, which = c("pie", "seqlogo"), site = 1,
node = getRoot(x$tree), col = NULL, cex.pie = 0.5,
pos = "bottomright", scheme = NULL, start = 1, end = 10, ...)
plotAnc(x, i = 1, col = NULL, cex.pie = 0.5, pos = "bottomright",
scheme = NULL, ...)
plotSeqLogo(x, node = getRoot(x$tree), start = 1, end = 10,
scheme = "Ape_NT", ...)
Arguments
- x
an object of class
ancestral
.- which
either "pie" or "seqlogo"
- node
to plot for which the probabilities should be plotted.
- col
a vector containing the colors for all possible states.
- cex.pie
a numeric defining the size of the pie graphs.
- pos
a character string defining the position of the legend.
- scheme
a predefined color scheme. For amino acid options are "Ape_AA", "Zappo_AA", "Clustal", "Polarity" and "Transmembrane_tendency", for nucleotides "Ape_NT" and"RY_NT". Names can be abbreviated.
- start
start position to plot.
- end
end position to plot.
- ...
Further arguments passed to or from other methods.
- i, site
plots the i-th site.
Author
Klaus Schliep klaus.schliep@gmail.com
Examples
example(NJ)
#>
#> NJ> data(Laurasiatherian)
#>
#> NJ> dm <- dist.ml(Laurasiatherian)
#>
#> NJ> tree <- NJ(dm)
#>
#> NJ> plot(tree)
# generate node labels to ensure plotting will work
tree <- makeNodeLabel(tree)
anc.p <- ancestral.pars(tree, Laurasiatherian)
# plot the third character
plotAnc(anc.p, 3, pos="topright")
plotSeqLogo(anc.p, node="Node10", 1, 25)
#> Scale for x is already present.
#> Adding another scale for x, which will replace the existing scale.
data(chloroplast)
tree <- pratchet(chloroplast, maxit=10, trace=0)
tree <- makeNodeLabel(tree)
anc.ch <- ancestral.pars(tree, chloroplast)
image(as.phyDat(anc.ch)[, 1:25])
plotAnc(anc.ch, 21, scheme="Ape_AA", pos="topleft")
plotAnc(anc.ch, 21, scheme="Clustal", pos="topleft")
plotSeqLogo(anc.ch, node="Node1", 1, 25, scheme="Clustal")
#> Scale for x is already present.
#> Adding another scale for x, which will replace the existing scale.