hwe_frequencies | R Documentation |
Alleles are assumed to be numerated from 1 and up with no missing label. Thus if the largest value in either allele1 or allele2 is K then we assume that there can be at least K possible alleles. Genotypes are sorted such the the smallest allele comes first, i.e., 2x1 -> 1x2, and 2x3 -> 2x3
hwe_frequencies(allele1, allele2, min_alleles = 0L)
allele1 |
An integer vector (starting with values 1 upwards) of first alleles |
allele2 |
An integer vector (starting with values 1 upwards) of second alleles |
min_alleles |
A minimum number of unique alleles available |
A list with three variables: allele_freq for estimated allele frequencies, genotype_freq for estimated genotype_frequencies (under HWE assumption), obs_genotype is the frequency of the genotypes, available_genotypes is the number of available genotypes used for the estimation, and unique_alleles is the number of unique alleles (matches the length of allele_freq)
Claus Ekstrom <claus@rprimer.dk>
al1 <- sample(1:5, size=1000, replace=TRUE, prob=c(.4, .2, .2, .1, .1))
al2 <- sample(1:5, size=1000, replace=TRUE, prob=c(.4, .2, .2, .1, .1))
hwe_frequencies(al1, al2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.