- X
The m-by-n genotype matrix (if loci_on_cols = FALSE, transposed otherwise), or a BEDMatrix object.
This is a numeric matrix consisting of reference allele counts (in c(0, 1, 2, NA) for a diploid organism).
- m_causal
The desired number of causal loci.
- herit
The desired heritability (proportion of trait variance due to genetics).
- p_anc
The length-m vector of true ancestral allele frequencies.
Optional but recommended for simulations.
Either this or kinship must be specified.
- kinship
The mean kinship value of the individuals in the data.
The n-by-n kinship matrix of the individuals in the data is also accepted.
Optional but recommended for real data.
Either this or p_anc must be specified.
- mu
The desired parametric mean value of the trait (scalar, default 0).
- sigma_sq
The desired parametric variance factor of the trait (scalar, default 1).
Corresponds to the variance of an outbred individual.
- labs
Optional labels assigning individuals to groups, to simulate group effects.
If vector, length must be number of individuals.
If matrix, individuals must be along rows, and levels along columns (for multiple levels of group effects).
The levels are not required to be nested (as the name may falsely imply).
Values can be numeric or strings, simply assigning the same values to individuals in the same group.
If this is non-NULL, then labs_sigma_sq must also be given!
- labs_sigma_sq
Optional vector of group effect variance proportions, one value for each level given in labs (a scalar if labs is a vector, otherwise its length should be the number of columns of labs).
Ignored unless labs is also given.
As these are variance proportions, each value must be non-negative and sum(labs_sigma_sq) + herit <= 1 is required so residual variance is non-negative.
- maf_cut
The optional minimum allele frequency threshold (default NA, no threshold).
This prevents rare alleles from being causal in the simulation.
Threshold is applied to the sample allele frequencies and not their true parametric values (p_anc), even if these are available.
- loci_on_cols
If TRUE, X has loci on columns and individuals on rows; if FALSE (the default), loci are on rows and individuals on columns.
If X is a BEDMatrix object, loci are always on the columns (loci_on_cols is ignored).
- m_chunk_max
BEDMatrix-specific, sets the maximum number of loci to process at the time.
If memory usage is excessive, set to a lower value than default (expected only for extremely large numbers of individuals).
- fes
If TRUE, causal coefficients are inversely proportional to the square root of p_anc * ( 1 - p_anc ) (estimated when p_anc is unavailable), which ensures fixed effect sizes (FES) per causal locus.
Signs (+/-) are drawn randomly with equal probability.
If FALSE (the default), random coefficients (RC) are drawn from a standard Normal distribution.
In both cases coefficients are rescaled to result in the desired heritability.