Description Usage Arguments Value Examples
This is simply a wrapper around stats::runif()
or stats::rbeta()
(depending on parameters) with different defaults and additional validations.
1 | draw_p_anc(m_loci, p_min = 0.01, p_max = 0.5, beta = NA)
|
m_loci |
Number of loci to draw. |
p_min |
Minimum allele frequency to draw (Uniform case only). |
p_max |
Maximum allele frequency to draw (Uniform case only). |
beta |
Shape parameter for a symmetric Beta.
If |
A length-m
vector of random ancestral allele frequencies
1 2 3 4 5 6 7 | # Default is uniform with range between 0.01 and 0.5
p_anc <- draw_p_anc(m_loci = 10)
# Use of `beta` triggers a symmetric Beta distribution.
# This parameter has increased density for rare minor allele frequencies,
# resembling the 1000 Genomes allele frequency distribution
p_anc <- draw_p_anc(m_loci = 10, beta = 0.03)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.