fst | R Documentation |
This function reads Fst from a directory with precomputed f2-statistics, and turns per-block data
into estimates and standard errors for each population pair. See details
for how Fst is computed.
fst(data, pop1 = NULL, pop2 = NULL, boot = FALSE, verbose = FALSE, ...)
data |
Input data in one of three forms:
|
pop1 |
One of the following four:
|
pop2 |
A vector of population labels |
boot |
If |
verbose |
Print progress updates |
... |
Additional arguments passed to |
The Hudson Fst estimator used here is described in the two publications below.
For two populations with estimated allele frequency vectors p1
and p2
,
and allele count vectors n1
and n2
, it is calculated as follows:
num = (p1 - p2)^2 - p1*(1-p1)/(n1-1) - p2*(1-p2)/(n2-1)
denom = p1 + p2 - 2*p1*p2
fst = mean(num)/mean(denom)
This is done independently for each SNP block, and is stored on disk for each population pair.
Jackknifing or bootstrapping across these per-block estimates yields the overall estimates and standard errors.
Reich, D. (2009) Reconstructing Indian population history Nature
Bhatia, G. (2013) Estimating and interpreting Fst: the impact of rare variants Genome Research
## Not run:
pop1 = 'Denisova.DG'
pop2 = c('Altai_Neanderthal.DG', 'Vindija.DG')
fst(f2_dir, pop1, pop2)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.