A bed.matrix similar to x, with a new variable x@snps$hwe
containing the $p$-values for each SNP.
Details
Two tests of Hardy-Weinberg Equilibrium are proposed:
ifmethod = "chisquare", the good old Chi-square test
ifmethod = "exact", Haldane's exact test (see Wigginton et al)
The function set.stats will be called first if necessary.
References
Wigginton, J. E., Cutler, D. J., & Abecasis, G. R. (2005). A note on exact tests of Hardy-Weinberg equilibrium. The American Journal of Human Genetics, 76(5), 887-893