Description Usage Arguments Value Author(s) Examples
The S3 class tTree
is used for storing simplified transmission trees,
obtained from outbreaker's ouptput (functions outbreaker
and
outbreaker.parallel
) using get.tTree
. Some additional features
are available for tTree
objects, including plotting (plot
),
conversion to igraph
graphs (as.igraph
), and identification of
mutations on the branches of the tree (findMutations
).
1 2 3 4 5 6 7 8 9 10 11 12 13 | get.tTree(x, burnin = 20000, best = c("ancestries", "tree"))
## S3 method for class 'tTree'
as.igraph(x, edge.col = "black", col.edge.by = "prob",
col.pal = NULL, annot = c("dist", "n.gen", "prob"), sep = "/", ...)
## S3 method for class 'tTree'
findMutations(x, dna, ...)
## S3 method for class 'tTree'
plot(x, y = NULL, edge.col = "black",
col.edge.by = "prob", col.pal = NULL, annot = c("dist", "n.gen",
"prob"), sep = "/", ...)
|
x |
for |
burnin |
an integer indicating the number of steps of the MCMC to be discarded as burnin period. Defaults to 20,000. |
best |
a character string matching "ancestries" or "tree", indicating which criterion is used to define the consensus tree; "ancestries" retains, for each case, the most supported ancestor; "tree" retains the most supported tree; note that the latter may exist only in the case of very small epidemics. |
edge.col |
the color used for the edges; overriden if
|
col.edge.by |
a character string indicating how edges should be colored. Can be "dist" (by number of mutations), "n.gen" (by number of generations), or "prob" (by posterior support for the ancestries). |
col.pal |
the palette of colors to be used for edges; if NULL, a grey palette is used, with larger values in darker shades. |
annot |
same as |
sep |
a character indicating the separator for different field (see
|
... |
further arguments to be passed to other functions. |
dna |
a DNAbin object containing the aligned sequences of the isolates in the tree. |
y |
unused - there for compatibility with the generic of |
tTree
objects are lists with the following components:
idx: integer, the index of the cases
collec.dates: the collection dates of the isolates
idx.dna: the index of the cases to which each DNA sequence corresponds
ances: the index of the inferred ancestor, for each case
inf.dates: the inferred infection date, for each case
p.ances: the posterior probability of the inferred ancestor (i.e., proportion in the posterior distribution of ancestors)
nb.mut: the number of mutations between isolates and their inferred ancestor, for each isolate
n.gen: the number of generations between isolates and their inferred ancestor, for each isolate
p.gen: the posterior probability of the inferred number of generations between each case and its inferred ancestor
inf.curves: the infectivity curves for each case
The plot function invisibly returns the conversion of the tTree
object into a igraph
graph.
Thibaut Jombart t.jombart@imperial.ac.uk
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | data(fakeOutbreak)
attach(fakeOutbreak)
## represent posterior ancestries
if(require(adegenet)){
transGraph(res, annot="", main="Posterior ancestries - support > 0.01",
threshold=0.01, col.pal=spectral)
}
## get consensus ancestries
tre <- get.tTree(res)
plot(tre, annot="", main="Consensus ancestries")
## show match data/consensus ancestries
col <- rep("lightgrey", 30)
col[which(dat$ances != tre$ances)] <- "pink"
plot(tre, annot="", vertex.color=col, main="Consensus ancestries")
mtext(side=3, text="cases with erroneous ancestries in pink")
detach(fakeOutbreak)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.