Skip to contents

Extended haplotype homozygosity as a function of distance from a core site, computed separately for chromosomes carrying each core allele (Sabeti et al. 2002) and for all chromosomes together, the site-wise EHHS of Sabeti et al. (2007).

Usage

morie_ehhdec(hap, core, positions = NULL)

Arguments

hap

Haplotype matrix, chromosomes by sites, coded 0/1.

core

Core site index, 0-based.

positions

Optional physical positions of the sites; default is the site index.

Value

A list with estimate (= ehh1), ehh1, ehh0, ehhs, positions, core, n1, n0, n, method.

References

Sabeti, P. C. et al. (2002). Detecting recent positive selection in the human genome from haplotype structure. Nature, 419, 832-837.

Examples

set.seed(21)
hap <- matrix(rbinom(20 * 7, 1, 0.5), 20, 7)
morie_ehhdec(hap, core = 3)$ehh1
#> [1] 0.1166667 0.2833333 0.4666667 1.0000000 0.4750000 0.2750000 0.1166667