Last data update: 2014.03.03

R: Draw an annotated phylogenetic tree.
prettyTreeR Documentation

Draw an annotated phylogenetic tree.

Description

Extends plot.phylo to draw a phylogenetic tree with additional annotation.

Usage


prettyTree(x, groups, fill,
           X, O, indices, labels,
           show = rep(TRUE, length(x)),
           largs = list(cex = 0.75, bty = "n", yjust = 0.5),
           parargs = list(mar = c(bottom = 5, left = 2, top = 2,
                              right = ifelse(is.null(largs), 2, 8)),
               xpd = NA),
           pointargs = list(), glyphs,
           shuffleGlyphs = NA, ...)

Arguments

x

an object of class phylo, eg x <- nj(ddist)

groups

a factor (or object coercible) to a factor assigning group identity to leaf nodes in x

fill

vector (logical or indices) of points to fill

X

vector of points to mark with an X

O

vector of points to mark with a circle

indices

label points with indices (all points if 'yes', or a subset indicated by a vector)

labels

character vector of tip labels in the same order as x$tip.label

show

boolean vector of points to show

largs

arguments controlling appearance of the legend or NULL for no legend

parargs

arguments to pass par()

pointargs

arguments to pass points() (other than pch, col, bg)

glyphs

a data.frame with columns named 'col' and 'pch' corresponding to elements of unique(groups)

shuffleGlyphs

NA or an integer (argument to set.seed)

...

passed to plot.phylo

Details

prettyTree adds to a plot drawn by plot.phylo

Vectors specifying annotation should be in the order of row or column labels of the distance matrix used to generate x.

Value

Plots to the active device; no return value.

Note

See package vignette for additional examples.

Author(s)

Noah Hoffman

See Also

plot.phylo

Examples

library(ape)
data(seqs)
data(seqdat)
prettyTree(nj(dist.dna(seqs)), groups=seqdat$tax_name)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(clstutils)
Loading required package: clst
Loading required package: rjson
Loading required package: ape
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/clstutils/prettyTree.Rd_%03d_medium.png", width=480, height=480)
> ### Name: prettyTree
> ### Title: Draw an annotated phylogenetic tree.
> ### Aliases: prettyTree
> ### Keywords: aplot
> 
> ### ** Examples
> 
> library(ape)
> data(seqs)
> data(seqdat)
> prettyTree(nj(dist.dna(seqs)), groups=seqdat$tax_name)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>