Hardy-Weinberg | R Documentation |
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.
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() )
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 |
The path of the output file is returned invisibly.
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')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.