outbreak: Outbreak data

Description Usage Format Examples

Description

Simulated outbreak data and genomic samples. An SIR outbreak was simulated with an infective individual entering a population of thirty susceptibles. Ten genomes were sampled from each infected individual every 500 generations.

Usage

1

Format

Consists of epidemiological data and genomic sample data.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
data(outbreak)
sampledata <- outbreak$sampledata
epidata <- outbreak$epidata

distmat <- gd(sampledata[,3], outbreak$libr, outbreak$nuc, outbreak$librstrains)

# Now pick colors for sampled isolates
colvec <- rainbow(1200)[1:1000] # Color palette
refnode <- 1 # Compare distance to which isolate?
colv <- NULL # Vector of colors for samples
maxD <- max(distmat[,refnode])

for (i in 1:nrow(sampledata)) {
  	colv <- c(colv, 
            colvec[floor((length(colvec)-1)*(distmat[refnode,i])/maxD)+1])
}

plotoutbreak(epidata, sampledata, col=colv, stack=TRUE, arr.len=0.1, 
             blockheight=0.5, hspace=500, label.pos="left", block.col="grey",
             jitter=0.004, xlab="Time", pch=1) 
		

Example output



seedy documentation built on May 29, 2017, 10:58 a.m.