HierFst: Function for calculating hierarchical genetic differentiation (Fst) (Weir B.S., 1996; Yang R.C.,1998)
Description
This function calculates hierarchical genetic differentiation (Fst) based on Weir B.S., 1996 and Yang R.C., 1998). The hierarchy that set in the input arguments (nreg, r) will automatically generate your hierarchical structure. Based on the parameters you set, the result returns to a F-statistics matrix displaying one level (rows) of Fst within a higher level hierarchy (columns).
Usage
HierFst(x, nreg, r, ncode)
Arguments
x
The name of the data file, or the string giving the path to the file. The file should be a genepop object, with the appropriate extension.
nreg
The number of aggregate in the hierarchy.
r
A vector specifying number of subaggregate (eg.subpopulations) within each aggregate.
ncode
An integer indicating the number of characters used to code an allele.
Value
The result returns a matrix of hierarchical F-statistics type-coefficients at different levels.
Details
This function was modified and improved from the varcomp.glob function from the hierfstat package (Jerome Goudet & Thibaut Jombart 2015). It was optimized to easily set the hierarchical structure while varcom.glob requires the structure data should be already correctly formated in accordance with hierfstat data. In this function, you can input your genetic file (x) and set the structure (nreg, r) of your data in the arguments. The result will return a matrix of hierarchical Fst.
References
Weir, B.S. (1996) Genetic Data Analysis II. Sinauer Associates.