View source: R/Frequency_sim.R
Frequency_sim | R Documentation |
Simulation of haplotype frequencies over time using a multinomial distribution. Simulations can be run with or without replicated populations, and for constant or changing selection over time. Frequencies are recorded at time points provided in the input data.
Frequency_sim( haplotype, t = 6, tdelta = 10, benef_sim, rand_start = FALSE, Ne = 500, sel_dec = FALSE, dec_strength = 0.7, dec_ne = 0, repli = 1 )
haplotype |
Binary numeric matrix containing information of haplotype structure. The columns corresponds to the haplotypes and the rows to the SNPs. |
t |
Numeric, number of time points of interest, excluding the initial time point |
rand_start |
Logical. rand_start = TRUE corresponds to random sampling of the starting haplotype frequency from a uniform distribution. If rand_start = FALSE the starting haplotype frequency is set to equal for all haplotypes. |
Ne |
Positive integer, the effective population size. |
sel_dec |
Logical. sel_dec = TRUE corresponds to decreasing selective strength (fitness of selected haplotype) over time |
dec_strength |
Numeric, strength by which selection decreases if sel_dec=TRUE. If sel_dec = FALSE this parameter is ignored. |
dec_ne |
Integer, strength by which Ne decreases over time. dec_ne = number of Ne decreased per generation. Contant Ne if equals to 0. |
repli |
Numeric, specifying the number of replicated populations. |
deltat |
Numeric, number of generations between each pair of time points of interests |
s |
Numeric vector of selection coefficients. s = 0 corresponds to neutral simulations. Can use first element of list from output of benef_sim() as input. |
benef_all |
Numeric vector of position of beneficial alleles. Can use second element of list from output of benef_sim() as input. |
Returns a list. The first item is the haplotype frequency matrix with row being the haplotypes and columns the chosen timepoints. If replicates are present, the column will be the time points of first replicate, followed by the timepoints of second replicates etc. Second item is the fitness of haplotypes.
haplotest()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.