sim_pop | R Documentation |
This function defines admixture and optionally family parameters establishing how individuals are related to each other.
Admixture proportions are deterministically constructed from the linear 1D admixture model bnpsd::admix_prop_1d_linear()
.
If fst < 0.5
the intermediate inbreeding coefficients are proportional to their index (1:k_subpops
), otherwise they are proportional to (1:k_subpops) + 1
.
If G > 1
, a random family structure is drawn using simfam::sim_pedigree()
.
No per-locus parameters are constructed or simulated with this function.
sim_pop( n_ind = 1000, k_subpops = 3, bias_coeff = 0.5, fst = 0.3, G = 1, verbose = TRUE )
n_ind |
The number of individuals. |
k_subpops |
The number of intermediate subpopulations for admixture model. |
bias_coeff |
The bias coefficient of the admixed individuals (for the founders if |
fst |
The FST of the admixed individuals (for the founders if |
G |
The number of generations for random family.
The |
verbose |
If |
A list containing the following elements:
admix_proportions_1
: The true admixture proportions of the founders (required to draw genotypes for admixed founders and seed the family structure if G > 1
)
admix_proportions
: The true admixture proportions of the joint admixed family model (final generation only).
inbr_subpops
: The vector of intermediate subpopulation inbreeding/FST values for admixture model.
fam
: If G > 1
, the pedigree structure as a plink FAM table, pruned with simfam::prune_fam()
to include only ancestors of the final generation; otherwise NULL
.
ids
: If G > 1
, a list of IDs from fam
above split into non-overlapping generations; otherwise NULL
.
kinship
: The true kinship of the joint admixed family model (final generation only).
The bnpsd
and simfam
packages.
# a small example data_pop <- sim_pop( n_ind = 50, G = 3 ) # parameters for admixture model of founders data_pop$admix_proportions_1 data_pop$inbr_subpops # parameters of family structure data_pop$fam data_pop$ids # parameters for final generation data_pop$admix_proportions data_pop$kinship
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.