Description Usage Arguments Value Author(s) Examples
A population is forward simulation, given selection on genomic sections for specific ancestors.
1 2 3 4 | select_population(source_pop, select_matrix,
pop_size, total_runtime, morgan, seed,
track_frequency = FALSE, progress_bar = TRUE,
multiplicative_selection = TRUE)
|
source_pop |
Source population with which to start. |
select_matrix |
Selection matrix indicating the markers which are under selection. Each row in the matrix contains five entries:
|
pop_size |
Size of the population |
total_runtime |
Total number of generations |
morgan |
Length of the chromosome in Morgan (e.g. the number of crossovers during meiosis) |
seed |
Seed of the pseudo-random number generator |
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: |
progress_bar |
Displays a progress_bar if TRUE. Default value is TRUE |
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. |
A list with: population
a population object, and three tibbles with allele frequencies: 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.
Thijs Janzen
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ## Not run:
number_founders = 20
wildpop = create_population(pop_size = 100,
number_of_founders = number_founders,
total_runtime = 10,
morgan = 1,
seed = 666)
selection_matrix = matrix(ncol=5, nrow = 1)
selection_matrix[1,] = c(0.5, 1.0, 1.2, 1.0, 1)
selected_pop <- select_population(wildpop,
selection_matrix,
pop_size = 100,
total_runtime = 10,
morgan = 1,
seed = 12345)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.