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

fst_admix

Calculate FST for the admixed individuals


Description

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 \link{coanc_admix}). Below there are n individuals and k intermediate subpopulations.

Usage

fst_admix(admix_proportions, coanc_subpops, weights = NULL)

Arguments

admix_proportions

The n-by-k admixture proportion matrix

coanc_subpops

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

weights

Optional length-n vector of weights for individuals that define their generalized FST (default uniform weights)

Value

The generalized FST of the admixed individuals

Examples

# 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)

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.