Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

coanc_admix

Construct the coancestry matrix of an admixture model


Description

The n-by-n coancestry matrix Theta of admixed individuals is determined by the n-by-k admixture proportion matrix Q and the k-by-k intermediate subpopulation coancestry matrix Psi, given by Theta = Q %*% Psi %*% t(Q) In the more restricted BN-PSD model, Psi is a diagonal matrix (with FST values for the intermediate subpopulations along the diagonal, zero values off-diagonal).

Usage

coanc_admix(admix_proportions, coanc_subpops)

Arguments

admix_proportions

The n-by-k admixture proportion matrix

coanc_subpops

The intermediate subpopulation coancestry, given either as a k-by-k matrix (for the complete admixture model), or the length-k vector of intermediate subpopulation FST values (for the BN-PSD model; implies zero coancestry between subpopulations), or a scalar FST value shared by all intermediate subpopulations (also implies zero coancestry between subpopulations).

Value

The n-by-n coancestry matrix.

Examples

# a trivial case: unadmixed individuals from independent subpopulations
# number of individuals and subpops
n_ind <- 5
# unadmixed individuals
admix_proportions <- diag(rep.int(1, n_ind))
# equal Fst for all subpops
coanc_subpops <- 0.2
# diagonal coancestry matryx
coancestry <- coanc_admix(admix_proportions, coanc_subpops)

# a more complicated admixture model
# number of individuals
n_ind <- 5
# number of intermediate subpops
k_subpops <- 2
# non-trivial admixture proportions
admix_proportions <- admix_prop_1d_linear(n_ind, k_subpops, sigma = 1)
# different Fst for each of the k_subpops
coanc_subpops <- c(0.1, 0.3)
# non-trivial coancestry matrix
coancestry <- coanc_admix(admix_proportions, coanc_subpops)

bnpsd

Simulate Genotypes from the BN-PSD Admixture Model

v1.2.3
GPL-3
Authors
Alejandro Ochoa [aut, cre] (<https://orcid.org/0000-0003-4928-3403>), John D. Storey [aut] (<https://orcid.org/0000-0001-5992-402X>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.