Learn R Programming

seedy (version 1.3)

diversity.range: Range of genetic diversity over time

Description

Generates multiple populations stochastically from an identical source, and measures the resulting diversity over time in each.

Usage

diversity.range(m.rate, runtime, equi.pop, iterations = 10, n.points = 100, 
genomelength = 1e+05, bottle.times=0, bottle.size=1, feedback = 1000, 
makeplot = TRUE, area = TRUE, colline = "blue", colarea = rgb(0, 0, 1, 0.4), 
ref.strain = NULL, init.freq = 1, libr=NULL, nuc=NULL, ...)

Arguments

m.rate
Mutation rate (per genome per generation).
runtime
Number of bacterial generations over which to simulate.
equi.pop
Equilibrium effective population size.
iterations
Number of populations to simulate.
n.points
Number of equidistant points to sample diversity during runtime.
genomelength
Genome length.
bottle.times
Vector of population bottleneck times.
bottle.size
Size of population bottleneck.
feedback
Number of generations between each simulation report.
makeplot
Should resulting diversity be plotted?
area
Should 95% central quantile of genetic diversity be shaded? If FALSE, then individual diversity trajectories are plotted.
colline
Colour of lines (if makeplot=TRUE).
colarea
Colour of shaded area (if makeplot=TRUE and area=TRUE).
ref.strain
Reference strain, if required.
init.freq
Initial frequency of strains in starting population (if libr and nuc specified)
libr
Library of initial sequences.
nuc
Nucleotides at polymorphic sites, corresponding to libr.
...
Additional arguments to be passed to plot.

Value

  • A iterations by n.points matrix with diversity over time for each simulation.

Details

Provides an empirical estimate of the expected genetic diversity (pairwise SNP distance) over time, with associated uncertainty. Initial population can be specified using the libr, nuc and init.freq arguments, otherwise population is grown from a single genotype. Resolution can be improved by increasing n.points, and accuracy by increasing iterations (at the expense of accuracy).

See Also

plotdiversity

Examples

Run this code
iterations <- 10
K <- diversity.range(m.rate=0.0005, runtime=1000, equi.pop=1000,
iterations=iterations, n.points=100, genomelength=100000, feedback=100, 
makeplot=TRUE, area=TRUE, colline="blue", colarea=rgb(0,0,1,0.4))

Run the code above in your browser using DataLab