# Extended haplotype homozygosity¶

Extended haplotype homozygosity (EHH) is a method designed to detect
unusually long haplotypes resulting from recent selective sweeps. A
dedicated class, `stats.EHH`

, is provided to compute those
statistics.

The statistics listed in the table below are available as methods or attributes of this class. The documentation provides more information regarding the usage.

Accessor |
Description |
Equation |
Reference |
---|---|---|---|

EHH |
1 |
||

Complementary EHH |
1 |
||

Relative EHH |
1 |
||

Integrated EHH |
2 |
||

Integrated EHHc |
2 |
||

Integrated haplotype score (unstandardized) |
2 |
||

Site-level EHH |
3 |
||

Integrated EHHS |
3 |
||

EHHS for genotypic data |
3 |
||

Integrated EHHG |
3 |

**References**

Sabeti

*et al.*(*Nature*2002**419**:832-837).Voight

*et al.*(*PLoS Biol.*2006**4**:e772).Tang

*et al.*(*PLoS Biol.*2007**5**:e171).

## Raw EHH statistics¶

If haplotype \(i\) is present in \(n_{i, 0}\) copies at the core site, and if this haplotype has been split in \(k\) haplotypes at distant site \(s\), each present in \(n_{j, 0}\) copies, the EHH for haplotype \(i\) at distant site \(s\) is given by:

\(EHHc_{i,s}\) is computed like \(EHH_{i,s}\) but considering the complement of haplotype \(i\) instead of haplotype \(i\) itself.

\(rEHH_{i,s}\) is computed as:

## Integrated EHH statistics¶

Denoting the core site as \(s=0\) and the first site for which \(EHH_{i,s}\) is below the threshold \(EHH_t\) as \(s=s^*\), and \(d_s\) the distance of site \(s\) to the core, the integrated statistic \(iHH_{i,s^*}\) is computed as:

As long as no site has an EHH value below the threshold, the statistic is computed without the last term.

The complementary \(iHHc\) is computed using \(EHHc\) instead of \(EHH\).

The integrated haplotype score iHS is not standardized:

## Site-level EHH statistics¶

If \(n\) is the total number of available samples at the core sites, the whole-site \(EHH\) is computed as:

The integrated \(EHHS\) (\(iES\)) is computed similarly as \(iHH\) based on a given threshold \(EHHS_t\) and \(s^*\) being the first site for which \(EHHS\) is below this threshold (see above):

## EHHS for genotypic data¶

Defining \(H_s\) as the proportion of heterozygote individuals at site \(s\), and \(H_{0s}\) the proportion of individuals heterozygote as the core site among those which are non-missing at site \(s\), \(EHHG\) is computed as:

The integrated \(EHHG\), \(iEG\), is computed just as \(iHH\) and \(iES\), based on a given threshold \(EHHG_t\):