HierHe: Function for calculating hierarchical heterozygosity

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/HierHe_updated.R

Description

This function calculates and decomposes hierarchical heterozygosity into different levels. We can obtain allelic diversity (He) in any hierarchy.

Usage

1
HierHe(x, nreg, r, ncode)

Arguments

x

Genetic data, the format should be genepop file with proper extention.

nreg

Number of aggregate in the hierarchy.

r

The number of subaggregate in the hierarchy.

ncode

Coding type of genetic data, whether 3, or 2.

Details

In line with other genetic metrics, this function obtains hierarchical expected heterozygosity (He) for metapopulations. The result gives us hierarchical allelic diversity at different levels that you set in the input argument.

Value

HierHe_perloc

List of hierarchical allelic diversity (heterozygosity) at different levels per locus.

HierHr

Hierarchical allelic diversity (heterozygosity) at aggregate/regional levels.

Hrperloc

Hierarchical allelic diversity (heterozygosity) per locus at aggregate/regional levels.

HieHr_overall

Overall (mean) hierarchical allelic diversity (heterozygosity) at different levels.

Author(s)

qinxinghu@gmail.com

References

Goudet, J. (2005). Hierfstat, a package for R to compute and test hierarchical F-statistics. Molecular Ecology Notes, 5(1), 184-186.

Jombart, T. (2008). adegenet: a R package for the multivariate analysis of genetic markers. Bioinformatics, 24(11), 1403-1405.

Nei, M. (1977). F-statistics and analysis of gene diversity in subdivided populations. Annals of human genetics, 41(2), 225-233.

See Also

HierAr,HierD,HierFst

Examples

1
2
3
4
5
# example genepop file
f <- system.file('extdata',package='HierDpart')
infile <- file.path(f, "Island.gen")
HiHe=HierHe(infile,nreg=4,r=c(7,4,2,3),ncode=3)
print(HiHe)

HierDpart documentation built on March 31, 2021, 5:09 p.m.