simulate_admixture: Individual based simulation of the breakdown of contiguous...

Description Usage Arguments Value Author(s)

Description

Individual based simulation of the breakdown of contiguous ancestry blocks, with or without selection. Simulations can be started from scratch, or from a predefined input population.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
simulate_admixture(input_population = NA, pop_size,
                     number_of_founders,
                     total_runtime,
                     morgan,
                     seed,
                     select_matrix = NA,
                     progress_bar = TRUE,
                     track_junctions = FALSE,
                     track_frequency = FALSE,
                     multiplicative_selection = TRUE)

Arguments

input_population

Potential earlier simulated population used as starting point for the simulation. If not provided by the user, the simulation starts from scratch.

pop_size

Number of individuals in the population

number_of_founders

Number of unique ancestors

initial_frequencies

A vector describing the initial frequency of each ancestor. By default, equal frequencies are assumed. If a vector not summing to 1 is provided, the vector is normalized.

total_runtime

Number of generations allowed for inbreeding

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

progress_bar

Displays a progress_bar if TRUE. Default value is TRUE

track_junctions

Track the average number of junctions over time if TRUE

track_frequency

If TRUE, every generation the frequency of all ancestors at the marker under selection is tracked. Currently only supports one marker under selection. Alternatively, the user can provide a region for which a fixed number of markers is tracked. The user does this by providing a vector with three entries: start, end, number_of_markers.

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 a population object, and three tibbles with allele frequencies (if track_frequency = TRUE): frequencies (if track_frequency = TRUE), initial_frequencies and final_frequencies. Each tibble contains four columns, time, location, ancestor and frequency, which indicates the number of generations, the location along the chromosome of the marker, the ancestral allele at that location in that generation, and finally, the frequency of that allele.

Author(s)

Thijs Janzen


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