get.frequency.from.one.allele.frequency: This functions allows to generate genotypic frequency by...

Description Usage Arguments Examples

Description

This function is usefull mainly to start a simulation with one allele being rare. If no input frequency is given, it will be assumed that all genotype have equal frequency. However, it might be usefull to start with one allele being very rare. This function allows to do so by automatically computing a initial set of frequency. To do so, it produce a pool of gamete where the given allele appears with the specified allele, and then perform random mating (without taking into account fitness). This ensure that the allele is present at the correct level, and that there is no bias in the sex-ratio.

Usage

1
get.frequency.from.one.allele.frequency(genome, locus, allele, allele.frequency)

Arguments

genome

A S4 object of type genome

locus

the locus at which the allele should have a given frequency

allele

the allele which has a given frequency

allele.frequency

the initial frequency of the allele.

Examples

1
2
3
4
5
6
locus1 = create.locus(allele1=c(1,1),allele2 = c(1,2),sd = c(0,1))
locus2 = create.locus(allele1=  c(1,1,2),allele2 = c(1,2,2),fitness.female = c(1,0.9,0.8),fitness.male = c(0.6,0.8,1))
genome = create.genome(locus=list(locus1,locus2))
initial.frequency <- get.frequency.from.one.allele.frequency(genome,2,1,0.01)
freqs <- compute.frequency.evolution(genome,initial.frequency)
freqs.allele <- get.allele.frequency(genome, freqs)

frederic-michaud/hapex documentation built on May 15, 2019, 3:29 p.m.