View source: R/poolne_estim_boot_pi.R
poolne_estim_boot_pi | R Documentation |
poolne_estim
allele frequenciesTakes the results of poolne_estim
(Gautier et al. 2013) and
performs a parametric bootstrap of Ref allele frequencies based on their
pi (estimated Ref allele frequency) and sd (the standard deviation).
poolne_estim_boot_pi(dat, num.sims = 100)
dat |
Data table: the
|
num.sims |
Numeric, the number of simulations to generate. Default = |
The values of PI
and SD
in dat
are used to generate
the alpha and beta paramters of a beta distribution, where:
alpha = ((1 - Mu) / Var - 1 / Mu) * Mu ^ 2
beta = alpha * (1 / Mu - 1)
Here, values of dat$PI
take on the values of Mu
(the mean) and
(dat$SD)^2
take on the values of Var
(the variance).
From the resulting beta distribution, num.sims
values are drawn to create
a distribution of possible allele frequencies (for each locus) that might exist in the sampled
populations (given the associated mean and error estimated by poolne_estim
).
A data table, with the following columns:
$POOL
, the population pool ID.
$LOCUS
, the locus ID.
$BOOT.NUM
, the simulation number.
$BOOT.PI
, the simulated pi (Ref allele frequency).
# Create a link to raw external datasets in genomalicious
genomaliciousExtData <- paste0(find.package('genomalicious'), '/extdata')
# Get the poolne estimat pi estimates
pi.data <- poolne_estim_output(stat='pi', datDir=genomaliciousExtData, lociDir=genomaliciousExtData)
# Simulate potential distributions
pi.sims <- poolne_estim_boot_pi(pi.data, 100)
pi.sims
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.