Description Usage Arguments Details Examples
Provides a graphical representation of simulated outbreak and sampled genomes.
1 2 3 |
epidata |
Simulated epidemiological data - matrix consisting of person IDs, infection and recovery times, and infection source. |
sampledata |
Simulated genomic sample data - matrix of person IDs, sample times and genome ID. Genomic sample data simulated with |
col |
A vector of colors to represent increasing genetic distance. |
stack |
Should infectious periods be organized to minimize plot height? Alternatively, each period occupies one row. |
arr.len |
Arrow length. See |
blockheight |
The height of each bar representing infectious periods. Takes a value between 0 and 1. |
hspace |
Minimum horizontal space between two infectious period bars (in units of time). |
labels |
Labels for each infectious episode. First columns of |
label.pos |
Position of labels. Accepted values are "centre", "left" and "right". |
block.col |
Background color for each infectious period bar. |
jitter |
Amount of jitter to be applied to genome sample points (as a proportion of plot dimensions). |
pch |
Point type for genome samples (see |
... |
Additional arguments to be passed to |
Graphical representation of transmission dynamics and sampled genomes. For multiple genome samples per time point, set jitter>0
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.