tTree: Simple transmission tree from outreaber's output

Description Usage Arguments Value Author(s) Examples

Description

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).

Usage

 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 = "/", ...)

Arguments

x

for get.tTree, the output of outbreaker or outbreaker.parallel. For other functions, a tTree object.

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 is provided.

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 col.edge.by, but specifies the information used to annotated the edges; several values can be provided, in which case different fields will be concatenated to generate the annotation.

sep

a character indicating the separator for different field (see annot).

...

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 plot.

Value

tTree objects are lists with the following components:

The plot function invisibly returns the conversion of the tTree object into a igraph graph.

Author(s)

Thibaut Jombart t.jombart@imperial.ac.uk

Examples

 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)

outbreaker documentation built on May 1, 2019, 10:23 p.m.