Description Usage Arguments Value Author(s) Examples
F_ST for a single locus (fst
) or for multiple loci (fst_multilocus
).
1 2 |
N |
A 2-D array. It gives the number of individuals of each genotype (first dimension) in each group (second dimension). Typically this is obtained from the output of a single-locus (for |
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 |
The functions calculate the genetic differentiation index F_ST among the groups contained in N
as ratio of heterozygosities: (Ht - Hs) / Ht
. Ht
is the expected heterozygosity over the population formed by pooling the groups together. Hs
is the average expected heterozygosity over the groups. The average is weighted by the number of individuals in each group.
The multilocus function fst_multilocus
returns F_ST for each locus and mean F_ST over all loci, calculated by taking the means of Ht
and Hs
over all loci.
Marco Andrello
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | # Generic single-locus version
# Three groups with two alleles
N1 <- c(18, 299, 277)
N2 <- c(284, 14, 145)
N3 <- c(115, 228, 254)
N <- array(c(N1,N2,N3),dim=c(3,3),dimnames=list(genotype=c("A1A1","A1A2","A2A2"),group=c(1:3)))
fst(N)
# Multi-locus version
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 all demes, age class 1 at time 3
N_age1_time3 <- N[,,1,3]
fst_multilocus(N_age1_time3, init.par)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.