get_prob_array {ldsep} | R Documentation |
Obtain the distribution of genotypes given haplotype frequencies under HWE
Description
This function will calculate the (log) probabilities for all genotype combinations at two loci given just the haplotype frequencies. This is under the assumptions of HWE.
Usage
get_prob_array(K, prob, log_p = TRUE)
Arguments
K |
The ploidy of the species. |
prob |
Haplotype frequencies in the order of (ab, Ab, aB, AB). |
log_p |
A logical. Should we return the log-probabilities ( |
Value
Element (i, j) is the (log) probability of genotype i-1 at locus 1 and genotype j-1 at locus 2.
Author(s)
David Gerard
Examples
get_prob_array(K = 6, prob = c(0.1, 0.2, 0.3, 0.4), log_p = FALSE)
[Package ldsep version 2.1.5 Index]