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

Description Usage Arguments Details Examples

Description

finite_non_rand2 simulates finite Mendelian populations with non-random mating over many generations. Specify initial allele frequencies, population size, number of generations, outcrossing rate, 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.

Usage

1
2
3
4
5
6
7
8
9
finite_non_rand2(
  outcrossingrate_nr,
  p1g2_nr,
  p2g2_nr,
  alleles,
  ND_nr,
  generations_nr,
  n_rep
)

Arguments

outcrossingrate_nr

Outcrossing rate

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_non_rand 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_non_rand(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.