sim_geno | R Documentation |
This function draws genotypes from an admixture model and optionally propagates them through a pedigree.
The admixture genotypes are calculated using bnpsd::draw_all_admix()
and simply returned if fam
is NULL
.
If fam
is not NULL
, genotypes are propagated through the pedigree using simfam::geno_last_gen()
.
The admixture model by default redraws fixed loci from the model.
However, loci may become fixed after propagation through the pedigree.
This function identifies these fixed loci (using bnpsd::fixed_loci()
) and redraws them first from the admixture model and then through the pedigree, iterating until no loci are fixed.
sim_geno( admix_proportions_1, inbr_subpops, fam = NULL, ids = NULL, m_loci = 1e+05, p_anc = NULL, beta = NA, verbose = TRUE )
admix_proportions_1 |
The admixture proportions matrix of the founders (required to draw the founder genotypes from the admixture model). |
inbr_subpops |
The vector of intermediate subpopulation inbreeding/FST values for admixture model. |
fam |
The pedigree structure as a plink FAM table, or |
ids |
The list of IDs from |
m_loci |
The number of loci. |
p_anc |
The desired ancestral allele frequencies (scalar or length- |
beta |
Shape parameter for a symmetric Beta for ancestral allele frequencies |
verbose |
If |
A list containing the following elements:
X
: The simulated genotype matrix.
p_anc
: The vector of ancestral allele frequencies (required to simulate traits with desired heritability).
# draw population parameters using `sim_pop` first # a small example data_pop <- sim_pop( n_ind = 50, G = 3 ) # now draw genotypes! m_loci <- 100 data_geno <- sim_geno( data_pop$admix_proportions_1, data_pop$inbr_subpops, data_pop$fam, data_pop$ids, m_loci ) # genotype matrix data_geno$X # ancestral allele frequencies data_geno$p_anc
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.