Read blocked f2 statistics from disk
f2_from_precomp(
dir,
inds = NULL,
pops = NULL,
pops2 = NULL,
afprod = FALSE,
fst = FALSE,
return_array = TRUE,
apply_corr = TRUE,
remove_na = TRUE,
verbose = TRUE
)
Directory with precomputed f2 statistics, or precomputed individual pair data
Individuals for which data should be read. Defaults to all individuals, which may require a lot of memory.
Populations for which data should be read. Defaults to all populations, which may require a lot of memory.
Optional second vector of populations. Useful if a f4 statistics of a few against many populations should be computed. pops2
should not be specified in other cases, as most functions depend on f2-statistics for all population pairs in pops
.
Return negative average allele frequency products instead of f2 estimates. This will result in more precise f4-statistics when the original data had large amounts of missingness, and should be used in that case for qpdstat
and qpadm
. It can also be used for outgroup f3-statistics with a fixed outgroup (for example for qpgraph
); values will be shifted by a constant amount compared to regular f3-statistics. This shift affects the fit of a graph only by small amounts, possibly less than bias in regular f3-statistics introduced by large amounts of missing data.
This option is currently ineffective when reading data extracted with extract_counts
.
Return a 3d array (default). If false, a data frame will be returned.
Subtract the f2 correction factor. Setting this to FALSE
can occasionally be useful
Remove blocks with missing values
Print progress updates
A 3d array of f2 statistics
if (FALSE) {
dir = 'my/f2/dir/'
f2_blocks = f2_from_precomp(dir, pops = c('pop1', 'pop2', 'pop3'))
}