Hardy-Weinberg {genepop} | R Documentation |
Tests of Hardy-Weinberg genotypic proportions
Description
Compute variants of the exact conditional test for Hardy-Weinberg genotypic proportions. The tests differ by their test statistics. HWtable_analysis
handles a single table of genotype counts, and test_HW
requires a standard genepop input file. See this section of the Genepop-executable documentation for more information on the statistical methods.
Usage
test_HW(
inputFile,
which = "Proba",
outputFile = "",
settingsFile = "",
enumeration = FALSE,
dememorization = 10000,
batches = 20,
iterations = 5000,
verbose = interactive()
)
HWtable_analysis(
inputFile,
which = "Proba",
settingsFile = "",
enumeration = FALSE,
dememorization = 10000,
batches = 20,
iterations = 5000,
verbose = interactive()
)
Arguments
inputFile |
character: The path of the input file. For |
which |
character: |
outputFile |
character: The path of the output file |
settingsFile |
character: The path of the settings file |
enumeration |
logical: whether to compute the complete enumeration test for samples with less than 5 alleles |
dememorization |
integer: length of dememorization step of Markov chain algorithm |
batches |
integer: Number of batches |
iterations |
integer: Iterations per batch |
verbose |
logical: whether to print some information |
Value
The path of the output file is returned invisibly.
Examples
locinfile <- genepopExample('sample.txt')
test_HW(locinfile, which='deficit', 'sample.txt.D')
if ( ! interactive()) clean_workdir(otherfiles='sample.txt')
# Example in Guo & Thompson 1992 Table 5
locinfile <- genepopExample('Rhesus.txt')
outfile <- HWtable_analysis(locinfile,which='Proba',batches = 1000,iterations = 1000)
readLines(outfile)[21]
#clean_workdir(otherfiles='Rhesus.txt')