Description Usage Arguments Value Author(s) See Also Examples
The function make.phylo
is used to obtain phylogenies for each
of the genes sequenced in an obkData
object. Phylogenetic trees can optionally be plotted before being
returned. Colors are used to distinguish samples, individuals, dates,
or any other requested information. make.phylo
is a wrapper for
functions from the ape
package: dist.dna
for
computing genetic distances, and specific methods for getting trees
such as nj
.
1 2 3 4 5 6 7 | make.phylo(x, ...)
## S4 method for signature 'obkData'
make.phylo(x, locus=NULL,
result=c("obkData","multiPhylo"), model = "N",
pairwise.deletion = FALSE, method=nj,
plot=FALSE, ask=TRUE,...)
|
x |
an obkData object. |
result |
a character string indicating the type of result to be
returned; if |
locus |
a character or integer vector indicating the loci to be
used; if NULL, all loci are used, producing one phylogeny each; see
|
model, pairwise.deletion |
arguments passed to |
method |
a function producing phylogenetic trees with the class
|
plot |
a logical indicating whether plots of the trees should be produced. |
ask |
a logical indicating whether user input must be waited for before drawing new plots. |
... |
further graphical arguments to be passed to |
A obkData
with new phylogenies, or a list with class
multiPhylo
.
Thibaut Jombart t.jombart@imperial.ac.uk
read.annotated.tree
and read.annotated.nexus
to
read annotated phylogenies into phylo objects.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ## Example using simulate outbreak ##
set.seed(3)
x <- simuEpi(N = 200, D = 20, beta = 0.002, nu = 0.1, mu = 0.002)$x
get.trees(x) # no tree here
## GET TREE AND DISPLAY IT
x <- make.phylo(x, plot=TRUE)
get.trees(x) # newly created trees
## DISPLAY TREE USING PLOTGGPHY
## root tree to first case ##
if(require(ape)){
tre <- root(get.trees(x)[[1]],1)
}
## plot tree, use color for dates ##
par(mar=c(1,1,4,1))
plot(tre, edge.width=2, type="fan", show.tip=FALSE)
title("NJ tree of a simulated outbreak")
mtext("each disk indicates 1 mutation from the root")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.