expectedHomozygosity: Expected homozygosity and heterozygosity

View source: R/marker_stats.R

expectedHomozygosityR Documentation

Expected homozygosity and heterozygosity

Description

Computes the expected homozygosity and heterozygosity for a marker from its allele frequencies. The homozygosity is \sum_i p_i^2 and the heterozygosity is one minus this.

Usage

expectedHomozygosity(p)

expectedHeterozygosity(p)

Arguments

p

A numeric vector of allele frequencies, or a marker object (from which the frequencies are extracted with afreq()).

Value

A numeric value giving the expected homozygosity or heterozygosity.

Examples

p = c(0.2, 0.5, 0.3)
expectedHomozygosity(p)
expectedHeterozygosity(p)


pedtools documentation built on Feb. 1, 2026, 5:06 p.m.