simulate_admixture_until: Simulate admixture until reaching threshold divergence

Description Usage Arguments Value Author(s)

Description

Individual based simulation of the breakdown of contiguous ancestry blocks, with or without selection. Two populations are simulated, and upon userdefined timepoints, genetic divergence between the populations is checked. If the divergence exceeds a certain threshold, simulation is stopped.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
simulate_admixture_until(pop_size = 100,
                         number_of_founders = 2,
                         total_runtime = 100,
                         morgan = 1,
                         seed,
                         select_matrix = NA,
                         generations_between_update = 100,
                         critical_fst = 0.1,
                         sampled_individuals = 10,
                         number_of_markers = 100,
                         random_markers = TRUE,
                         overlap = 0,
                         multiplicative_selection = TRUE)

Arguments

pop_size

Number of individuals per population

number_of_founders

Number of unique ancestors

total_runtime

Maximum number of generations allowed to obtain level of genetic divergence

morgan

Length of the chromosome in Morgan (e.g. the number of crossovers during meiosis)

seed

Seed of the pseudo-random number generator

select_matrix

Selection matrix indicating the markers which are under selection. If not provided by the user, the simulation proceeds neutrally. If provided, each row in the matrix should contain five entries: location location of the marker under selection (in Morgan) fitness of wildtype (aa) fitness of heterozygote (aA) fitness of homozygote mutant (AA) Ancestral type that representes the mutant allele A

generations_between_update

Time interval used after which the FST is calculated again. Lower values increase accuracy, but also increase computation time

critical_fst

As long as the Fst between the two populations is lower than this fst, simulations continue

sampled_individuals

The number of individuals randomly sampled from the population to calculate the fst

number_of_markers

Number of markers used to calculate the Fst

random_markers

If TRUE, markers are randomly spaced along the chromosome, if FALSE, markers are equidistantly spaced along the chromosome.

overlap

Shared ancestry between the two populations. This is rounded to an integer, such that the number of shared ancestors is round(number_of_founders * overlap)

multiplicative_selection

Default: TRUE. If TRUE, fitness is calculated for multiple markers by multiplying fitness values for each marker. If FALSE, fitness is calculated by adding fitness values for each marker.

Value

A list with: Population_1 a population object containing all individuals in population 1,Population_2 a population object containing all individuals in population 2, Number_of_generations total number of generations required to obtain the cricital fst value, FST final FST value.

Author(s)

Thijs Janzen


thijsjanzen/isoSIM documentation built on May 29, 2019, 10:39 a.m.