expected_heterozygosity: Calculate the expected heterozygosity

Description Usage Arguments Value Source Examples

View source: R/population-stats.R

Description

This function calculates the expected heterozygosity of each of the markers in the given freqt object according to the formula

H_e = 1 - ∑_{i = 0}^n p_i^2,

where n is the number of alleles for the marker in question and p_i is the probability of allele i.

Usage

1

Arguments

x

a freqt object

ms

a list of markers for which the expected heterozygosities will be calculated. By default they are calculated for every marker in the given freqt object.

Value

a numeric vector containing the expected heterozygosities

Source

https://www.uwyo.edu/dbmcd/molmark/lect04/lect4.html

Examples

1
2
3
4
5
# calculate the expected heterozygosity for just one marker
expected_heterozygosity(ft_popstr_algeria_mzab_mozabite, "CSF1PO")

# calculate the expected heterozygosities for every marker
expected_heterozygosity(ft_popstr_algeria_mzab_mozabite)

knifecake/fafreqs documentation built on March 13, 2020, 11:53 p.m.