Description Usage Arguments Details Value Examples
This function returns the generalized FST of the admixed individuals given their admixture proportion matrix, the coancestry matrix of intermediate subpopulations (or its special cases, see coanc_subpops
parameter below), and optional weights for individuals.
This FST equals the weighted mean of the diagonal of the coancestry matrix (see coanc_admix()
).
Below there are n
individuals and k
intermediate subpopulations.
1 |
admix_proportions |
The |
coanc_subpops |
Either the |
weights |
Optional length- |
As a precaution, function stops if both inputs have names and the column names of admix_proportions
and the names in coanc_subpops
disagree, which might be because these two matrices are not aligned or there is some other inconsistency.
The generalized FST of the admixed individuals
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | # set desired parameters
# number of individuals
n_ind <- 1000
# number of intermediate subpopulations
k_subpops <- 10
# differentiation of intermediate subpopulations
coanc_subpops <- ( 1 : k_subpops ) / k_subpops
# construct admixture proportions
admix_proportions <- admix_prop_1d_linear(n_ind, k_subpops, sigma = 1)
# lastly, calculate Fst!!! (uniform weights in this case)
fst_admix(admix_proportions, coanc_subpops)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.