founder.event: Simulation of a founder event or population bottleneck

View source: R/popgen.R

founder.eventR Documentation

Simulation of a founder event or population bottleneck

Description

This function simulates genetic drift with a founding event / population bottleneck at time etime.

Usage

	founder.event(p0=0.5, Ne=1000, Nf=10, ttime=100, etime=50, show="p", ...)

Arguments

p0

Starting frequency for the A allele.

Ne

Effective population size at the start of the simulation and after the founding event.

Nf

Size of the founding population.

ttime

Total time of the simulation.

etime

Time for the founding event. Can either be a single generation, or a sequence of generations (e.g., etime=40:50) for a prolonged founder event. Note that to simulate a prolonged bottleneck the user must supply the sequence of generations during which the population is to be bottlenecked and not merely the start and end times of the bottleneck.

show

Two different options for plotting. "p" shows the frequency of the A allele through time; "var" shows the genetic variation in the population, calculated as p*(1-p). The default is show="p".

...

optional arguments. Presently, the only optional argument in founder.event is ltype which specifies the line type and defaults to "s".

Value

The function creates one of two different plots, depending on the value of show.

The function also invisibly returns an object of class "founder.event" which can be printed or plotted using corresponding print and plot methods. (See examples.)

Author(s)

Liam Revell liam.revell@umb.edu

See Also

drift.selection, genetic.drift

Examples

	founder.event()
	p<-founder.event(show="variation")
	print(p)
	plot(p,show="p",ltype="l")

liamrevell/PopGen documentation built on Jan. 4, 2023, 10:02 p.m.