qpadm | R Documentation |
qpadm
models a target population as a mixture of left (source) populations, given a set of right (outgroup) populations.
It can be used to estimate whether the left populations explain all genetic variation in the target population, relative to the right populations, and to estimate admixture proportions of the left populations to the target population.
qpadm(
data,
left,
right,
target,
f4blocks = NULL,
fudge = 1e-04,
fudge_twice = FALSE,
boot = FALSE,
getcov = TRUE,
constrained = FALSE,
return_f4 = FALSE,
cpp = TRUE,
verbose = TRUE,
...
)
data |
The input data in the form of:
|
left |
Left populations (sources) |
right |
Right populations (outgroups) |
target |
Target population |
f4blocks |
Instead of f2 blocks, f4 blocks can be supplied. This is used by |
fudge |
Value added to diagonal matrix elements before inverting |
fudge_twice |
Setting this to |
boot |
If |
getcov |
Compute weights covariance. Setting |
constrained |
Constrain admixture weights to be non-negative |
return_f4 |
Return f4-statistics |
cpp |
Use C++ functions. Setting this to |
verbose |
Print progress updates |
... |
If |
qpadm
returns a list with up to four data frames describing the model fit:
weights
: A data frame with estimated admixture proportions where each row is a left population.
f4
: A data frame with estimated and fitted f4-statistics
rankdrop
: A data frame describing model fits with different ranks, including p-values for the overall fit
and for nested models (comparing two models with rank difference of one). A model with L
left populations and R
right populations has an f4-matrix of dimensions (L-1)*(R-1)
. If no two left population form a clade with respect to all right populations, this model will have rank (L-1)*(R-1)
.
f4rank
: Tested rank
dof
: Degrees of freedom of the chi-squared null distribution: (L-1-f4rank)*(R-1-f4rank)
chisq
: Chi-sqaured statistic, obtained as E'QE
, where E
is the difference between estimated and fitted f4-statistics, and Q
is the f4-statistic covariance matrix.
p
: p-value obtained from chisq
as pchisq(chisq, df = dof, lower.tail = FALSE)
dofdiff
: Difference in degrees of freedom between this model and the model with one less rank
chisqdiff
: Difference in chi-squared statistics
p_nested
: p-value testing whether the difference between two models of rank difference 1 is significant
popdrop
: A data frame describing model fits with different populations. Note that all models with fewer populations use the same set of SNPs as the first model.
pat
: A binary code indicating which populations are present in this model. A 1
represents dropped populations. The full model is all zeros.
wt
: Number of populations dropped
dof
: Degrees of freedom of the chi-squared null distribution: (L-1-f4rank)*(R-1-f4rank)
chisq
: Chi-sqaured statistic, obtained as E'QE
, where E
is the difference between estimated and fitted f4-statistics, and Q
is the f4-statistic covariance matrix.
p
: p-value obtained from chisq
as pchisq(chisq, df = dof, lower.tail = FALSE)
f4rank
: Tested rank
feasible
: A model is feasible if all weights fall between 0 and 1
<population name>
: The weights for each population in this model
Haak, W. et al. (2015) Massive migration from the steppe was a source for Indo-European languages in Europe. Nature (SI 10)
qpwave
, lazadm
left = c('Altai_Neanderthal.DG', 'Vindija.DG')
right = c('Chimp.REF', 'Mbuti.DG', 'Russia_Ust_Ishim.DG', 'Switzerland_Bichon.SG')
target = 'Denisova.DG'
qpadm(example_f2_blocks, left, right, target)
## Not run:
# The original ADMIXTOOLS qpAadm program has an option called "allsnps"
# that selects different SNPs for each f4-statistic, which is
# useful when working with sparse genotype data.
# To get the same behavior in ADMIXTOOLS 2, supply the genotype data prefix
# and set `allsnps = TRUE`
qpadm("/my/geno/prefix", left, right, target, allsnps = TRUE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.