Skip to contents

EHH decay curves for the ancestral (0) and derived (1) core-allele carriers (Ehhdec), each integrated by the trapezoid rule outward from the core until EHH < min_ehh (0.05 in the paper), giving iHH_A and iHH_D; unstandardized iHS = ln(iHH_A / iHH_D) (Voight et al. 2006, eq. 1). Pass standardize = c(mean, sd) of a genome-wide reference for the frequency-bin z-score of their eq. 2.

Usage

Ihstst(hap, core, positions = NULL, min_ehh = 0.05, standardize = NULL)

Arguments

hap

Phased 0/1 haplotype matrix (chromosomes x SNPs); 1 = derived.

core

Core SNP index (1-based).

positions

Optional positions; index scale by default.

min_ehh

Integration threshold (default 0.05).

standardize

Optional c(mean, sd) for the z-score.

Value

List with estimate, ihs_unstandardized, ihh_a, ihh_d, daf, truncated_a, truncated_d, standardized, core, method.

References

Voight, B. F., Kudaravalli, S., Wen, X. and Pritchard, J. K. (2006), PLoS Biology 4(3), e72, eqs. (1)-(2) and Materials and Methods "Calculation of iHS". Sabeti, P. C. et al. (2002), Nature 419, 832-837.

Examples

set.seed(1)
hap <- matrix(rbinom(40 * 21, 1, 0.4), 40, 21)
hap[, 11] <- rep(c(0, 1), each = 20)
r <- Ihstst(hap, core = 11, positions = 1:21)
is.list(r)
#> [1] TRUE