Computes f2 statistics from f2 blocks of the form \(f2(A, B)\)
f2(
data,
pop1 = NULL,
pop2 = NULL,
boot = FALSE,
sure = FALSE,
unique_only = TRUE,
verbose = FALSE,
...
)
Input data in one of three forms:
A 3d array of blocked f2 statistics, output of f2_from_precomp
or f2_from_geno
(fastest option)
A directory which contains pre-computed f2-statistics
The prefix of genotype files (slowest option)
One of the following four:
NULL
: all possible population combinations will be returned
A vector of population labels. All combinations with the other pop
arguments will be returned
A matrix with population combinations to be tested, with one population per column and one
combination per row. Other pop
arguments will be ignored.
the location of a file (poplistname
or popfilename
) which specifies the populations or
population combinations to be tested. Other pop
arguments will be ignored.
A vector of population labels
If FALSE
(the default), block-jackknife resampling will be used to compute standard errors.
Otherwise, block-bootstrap resampling will be used to compute standard errors. If boot
is an integer, that number
will specify the number of bootstrap resamplings. If boot = TRUE
, the number of bootstrap resamplings will be
equal to the number of SNP blocks.
The number of population combinations can get very large. This is a safety option that stops you from accidently computing all combinations if that number is large.
If TRUE
(the default), redundant combinations will be excluded
Print progress updates
Additional arguments passed to f2_from_geno
when data
is a genotype prefix
f2
returns a data frame with f2 statistics
Patterson, N. et al. (2012) Ancient admixture in human history Genetics
Peter, B. (2016) Admixture, Population Structure, and F-Statistics Genetics
pop1 = 'Denisova.DG'
pop2 = c('Altai_Neanderthal.DG', 'Vindija.DG')
f2(example_f2_blocks, pop1, pop2)
#> # A tibble: 2 × 4
#> pop1 pop2 est se
#> <chr> <chr> <dbl> <dbl>
#> 1 Denisova.DG Altai_Neanderthal.DG 0.141 0.00115
#> 2 Denisova.DG Vindija.DG 0.145 0.00115
if (FALSE) {
f2(f2_dir, pop1, pop2)
}