Site-wise EHH curves over all chromosomes of each population
(Ehhdec ehhs) integrated outward from the core
by the same trapezoid rule as iHS; XP-EHH = ln(I_A / I_B)
(Sabeti et al. 2007, Methods). Local recombination cancels in the
ratio. Pass standardize = c(mean, sd) to normalize.
Usage
Xpehh1(hapA, hapB, core, positions = NULL, min_ehh = 0.05, standardize = NULL)
Arguments
- hapA, hapB
Phased 0/1 haplotype matrices over the SAME SNPs.
- core
Core SNP index (1-based).
- positions
Optional positions.
- min_ehh
Integration threshold.
- standardize
Optional c(mean, sd).
Value
List with estimate, xpehh_unstandardized,
I_A, I_B, truncated_a, truncated_b,
standardized, core, method.
References
Sabeti, P. C., Varilly, P. et al. (2007), Nature
449(7164), 913-918, Methods pp. 5-6.
Examples
set.seed(1)
hapA <- matrix(rbinom(40 * 21, 1, 0.4), 40, 21)
hapB <- matrix(rbinom(40 * 21, 1, 0.5), 40, 21)
hapA[, 11] <- rep(c(0, 1), each = 20)
hapB[, 11] <- rep(c(0, 1), each = 20)
r <- Xpehh1(hapA, hapB, core = 11, positions = 1:21)
is.list(r)
#> [1] TRUE