finite_selection: Simulating single locus, two allele Mendelian populations...

Description Usage Arguments Details Examples

View source: R/finite_selection.R

Description

finite_selection simulates finite Mendelian populations with selection over many generations. Specify initial allele frequencies, population size, number of generations, selection coefficient, dominance coefficient, and number of replicates. The simulation produces each generation of the population by randomly selecting 2N (ND) alleles for N (ND) individuals from a gamete pool based on the allele frequencies as determined by the relative fitnesses of the genotypes.

Usage

1
finite_selection(s, h, p1g2_nr, p2g2_nr, alleles, ND_nr, generations_nr, n_rep)

Arguments

s

Selection coefficient

h

Dominance coefficient

p1g2_nr

Allele 1 frequency

p2g2_nr

Allele 2 frequency

alleles

Allele types (use 1 and 2)

ND_nr

Population size

generations_nr

Number of generations

n_reps

Number simulation replicates

Details

finite_selection returns three plots: 1) Allele 1 frequency versus number of generations, 2) Observed and expected heterozygosity (expected based on allele frequencies and drift) versus number of generations, and 3) Wright's F with a loess regression best fit line. It also returns Fisher's exact tests (fisher.test) comparing the observed genotype counts to the expected and initial values.

Examples

1
finite_selection(0.5,0.5,0.3,0.7,c(1,2),25,100,100)

doublearon83/pop.gen.sims2 documentation built on Dec. 20, 2021, 1:10 a.m.