fst: F-statistics

Description Usage Arguments Value Author(s) Examples

View source: R/fst.R

Description

F_ST for a single locus (fst) or for multiple loci (fst_multilocus).

Usage

1
2
fst(N)
fst(N, init.par)

Arguments

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 fst) or multilocus (for fst_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 N.

Value

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.

Author(s)

Marco Andrello

Examples

 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)

MarcoAndrello/MetaPopGen-2.0 documentation built on Nov. 25, 2020, 11:20 p.m.