fst.pairwise.dioecious: Calculates Fst between two groups of dioecious individuals

Usage Arguments Value Examples

View source: R/fst.pairwise.dioecious.R

Usage

1
2
fst.pairwise.dioecious(N,i,j,xi,xj,ti,tj,si,sj)
fst.pairwise.dioecious(folder.name,i,j,xi,xj,ti,tj,si,sj)

Arguments

N

A 4-D array (ex: N[k,i,x,t]) of length c(m,n,z,T_max) giving the number of individuals of genotype k, age x in deme i at time t. Typically, the output of the function sim.metapopgen.dioecious

folder.name

Character string giving the name of the folder where the results of sim.metapopgen.dioecious are saved, when this function is used with the argument save.res set to TRUE.

i, xi, ti

Identifiers of the first group of individuals: it specifies the individuals of deme i, age xi at time ti

i, xi, ti

Identifiers of the second group of individuals: as above.

si, sj

Identifiers of the sex of the first and second group of individuals. Character string: "M" for males and "F" for females.

Value

Pairwise genetic differentiation index Fst calculated as ratio of heterozygosities: (Ht - Hs) / Ht. Ht is the expected heterozygosity over the population formed by the two groups. Hs is the average expected heterozygosity over the two groups. The average is weighted by the number of individuals in each group: Hs = (n_i * H_S_i + n_j * H_S_j)/(n_i + n_j) where n_i and n_j are the number of individuals in the first and second group, respectively, and H_s_i and H_s_j are the expected heterozygosities in the first and second group, respectively.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# Load the example data and simulates metapopulation genetics
data(FourPopDioecious)
N <- sim.metapopgen.dioecious(input.type="array", N1_M=N1_M, N1_F=N1_F, sigma_M=sigma_M, sigma_F=sigma_F, phi_F=phi_F, phi_M=phi_M, mu=mu, delta=delta, settler.surv=settler.surv)

# Calculates fst between various pairs of groups of individuals
fst.pairwise.dioecious(N,1,2,1,1,5,5,"M","M") # Between one-year old male individuals of deme 1 and 2 at time 5
fst.pairwise.dioecious(N,1,1,1,1,5,5,"M","F") # Between male and female one-year old individuals of deme 1 at time 5


# Example with results from sim.metapopgen.dioecious saved on disk
data(FourPopDioecious)
N <- sim.metapopgen.dioecious(input.type="array", N1_M=N1_M, N1_F=N1_F, sigma_M=sigma_M, sigma_F=sigma_F, phi_F=phi_F, phi_M=phi_M, mu=mu, delta=delta, settler.surv=settler.surv, save.res=T)
# Let us assume that results are stored in a folder named "2014-avr.-11-12.53"
fst.pairwise.dioecious("2014-avr.-11-12.53",1,1,1,1,5,5,"M","F") # Between male and female one-year old individuals of deme 1 at time 5

MarcoAndrello/MetaPopGen_0.0.8 documentation built on May 25, 2019, 12:23 p.m.