sim_gen_phen | R Documentation |
Simulate entire parameters and random variables, particularly random genotypes and phenotypes, with desired dimensions and other base parameters.
sim_gen_phen( n_ind = 1000, m_loci = 1e+05, k_subpops = 3, fst = 0.3, bias_coeff = 0.5, G = 1, m_causal = 100, herit = 0.8, env = NA, env_var = 1, fes = FALSE, n_chr = 22, beta = NA, verbose = TRUE )
n_ind |
The number of individuals. |
m_loci |
The number of loci. |
k_subpops |
The number of intermediate subpopulations for admixture model. |
fst |
The FST of the admixed individuals (for the founders if |
bias_coeff |
The bias coefficient of the admixed individuals (for the founders if |
G |
The number of generations for random family.
The |
m_causal |
The number of causal loci for the trait, selected randomly from among the simulated loci. |
herit |
The trait heritability. |
env |
A string describing environment model.
Only |
env_var |
The variance of the environment effect.
Ignored if |
fes |
If |
n_chr |
Number of chromosomes to simulate. Chromosome assignments are not biologically meaningful, as all loci are drawn independently (no LD). |
beta |
Shape parameter for a symmetric Beta for ancestral allele frequencies |
verbose |
If |
A list containing the following elements:
X
: The simulated genotype matrix.
bim
: The variant info table.
p_anc
: The ancestral allele frequency vector (aligned with rows of X
).
kinship
: The true kinship of the joint admixed family model (final generation only).
admix_proportions
: The true admixture proportions of the joint admixed family model (final generation only).
trait
: The simulated trait vector.
causal_indexes
: The vector of randomly selected causal loci indexes.
causal_coeffs
: The vector of simulated regression coefficients for causal loci.
This function is a wrapper around sim_pop()
, sim_geno()
, sim_bim()
, and sim_trait_env()
, see those for more details.
# run with default values, except smaller data <- sim_gen_phen( n_ind = 50, G = 3, m_loci = 100, m_causal = 5 ) # main objects of interest: # genotype matrix data$X # trait vector data$trait
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.