Learn Data & AI Skills | 50% off
Get 50% off unlimited learning

HierDpart (version 1.5.0)

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.

Yang, R.C. (1998). Estimating hierarchical F-statistics. Evolution 52 (4):950-956

Goudet J. (2005). Hierfstat, a package for R to compute and test variance components and Fs-tatistics. Molecular Ecology Notes. 5:184-186

See Also

HierAr

Examples

Run this code
# NOT RUN {
#
# example genepop file
f <- system.file('extdata',package='HierDpart')
infile <- file.path(f, "Island.gen")
 hFst=HierFst(infile, nreg=4, r=c(7,4,2,3), ncode=3)
 print(hFst)
# }

Run the code above in your browser using DataLab