Description Usage Arguments Value Author(s) See Also Examples
Functions to calculate the observed and expected heterozygosities per locus. The input is the vector of numbers of individuals at each multilocus genotype.
1 2 |
N |
Vector (1-D array) giving the number of individuals of each multilocus genotype. Typically this is obtained from the output of a multilocus simulation by subsetting a single deme / age class / time step. See the example. |
init.par |
A list of arguments necessary to initialize the simulations and obtained with the function initialize.monoecious.multilocus. It must be the same list that has been used to simulate |
fG |
The genotype frequencies that will be used to the calculate allele frequencies: the output of |
fA |
The allele frequencies that will be used to the calculate the expected heterozygosity: the output of |
For het_obs
, a vector of observed heterozygosities (ratio of number of heterozygotes to total number of individuals) per locus.
For het_exp
, a vector of expected heterozygosities per locus, calculated as 1 - sum(p^2), where p is the allele frequency and the sum is taken over all alleles at a locus.
Marco Andrello
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ## Not run:
data(MultilocusMonoecious)
N <- sim.metapopgen.monoecious.multilocus(init.par=init.par,
sigma=sigma,
phi_F=phi_F, phi_M=phi_M,
delta.prop=delta.prop, delta.ad=delta.ad,
T_max=T_max)
# Subsetting to get results from deme 1, age class 1 at time 3
N_deme1_age1_time3 <- N[,1,1,3]
# Observed heterozygosity
Ho <- het_obs(N_deme1_age1_time3, init.par)
# Expected heterozygosity
He <- het_exp(N_deme1_age1_time3, init.par)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.