Description Usage Arguments Details Value See Also Examples

View source: R/diversity.range.R

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

1 2 3 4 |

`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 |

`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 |

`colline` |
Colour of lines (if |

`colarea` |
Colour of shaded area (if |

`ref.strain` |
Reference strain, if required. |

`init.freq` |
Initial frequency of strains in starting population (if |

`libr` |
Library of initial sequences. |

`nuc` |
Nucleotides at polymorphic sites, corresponding to |

`...` |
Additional arguments to be passed to |

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

A `iterations`

by `n.points`

matrix with diversity over time for each simulation.

1 2 3 4 | ```
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))
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.