This function runs multiple qpadm models, re-using f4-statistics where possible. Supports parallel evaluation of models, which can be turned on with future::plan('multisession')
or similar, and turned off with future::plan('sequential')
.
qpadm_multi(
data,
models,
allsnps = FALSE,
full_results = TRUE,
verbose = TRUE,
...
)
The input data in the form of:
A 3d array of blocked f2 statistics, output of f2_from_precomp
or extract_f2
A directory with f2 statistics
The prefix of a genotype file
A nested list (or data frame) with qpadm models. It should consist of two or three other named lists (or columns) containing left
, right
, (and target
) populations.
Use all SNPs with allele frequency estimates in every population of any given population quadruple. If FALSE
(the default) only SNPs which are present in all populations in popcombs
(or any given model in it) will be used. When there are populations with lots of (non-randomly) missing data, allsnps = TRUE
can lead to false positive results. This option only has an effect if data
is the prefix of a genotype file. If data
are f2-statistics, the behavior will be determined by the options that were used in computing the f2-statistics.
Print progress updates
Further arguments passed to qpadm
A list where each element is the output of one qpadm model.
if (FALSE) {
# the following specifies two models: one with 2/3/1 and one with 1/2/1 left/right/target populations
models = tibble(
left = list(c('pop1', 'pop2'), c('pop3')),
right = list(c('pop5', 'pop6', 'pop7'), c('pop7', 'pop8')),
target = c('pop10', 'pop10'))
results = qpadm_multi('/my/geno/prefix', models)
}