# NOT RUN {
# admixture matrix for 1000 individuals drawing alleles from 10 subpops
# simple version: spread of about 2 standard deviations along the circular 1D geography
# (just set sigma)
admix_proportions <- admix_prop_1d_circular(n_ind = 1000, k_subpops = 10, sigma = 2)
# advanced version: a similar model but with a bias coefficient of exactly 1/2
# (must provide bias_coeff, coanc_subpops, and fst in lieu of sigma)
k_subpops <- 10
# FST vector for intermediate independent subpops, up to a factor (will be rescaled below)
coanc_subpops <- 1 : k_subpops
obj <- admix_prop_1d_circular(
n_ind = 1000,
k_subpops = k_subpops,
bias_coeff = 0.5,
coanc_subpops = coanc_subpops,
fst = 0.1 # desired final FST of admixed individuals
)
# in this case return value is a named list with three items:
admix_proportions <- obj$admix_proportions
# rescaled coancestry data (matrix or vector) for intermediate subpops
coanc_subpops <- obj$coanc_subpops
# and the sigma that gives the desired bias_coeff and final FST
sigma <- obj$sigma
# }
Run the code above in your browser using DataLab