Generate genetic marker data in or out of Hardy-Weinberg Equilibrium
HWData generates samples of genotypic counts under various schemes. It mainly uses sampling from the multinomial distribution given Hardy-Weinberg allele frequencies.
HWData(nm = 100, n = rep(100, nm), f = rep(0, nm), p = NULL, conditional = FALSE, exactequilibrium = FALSE, pdist = "runif", x.linked = FALSE, nA = NULL, n.males=rep(round(0.5*n),nm), ...)
nm |
The number of bi-allelic markers. |
n |
The sample sizes. |
f |
The inbreeding coefficients (only for autosomal markers) |
p |
a vector of allele frequencies |
conditional |
if |
exactequilibrium |
generates data in exact HWE if set to
|
pdist |
Take a random allele frequency from a uniform or beta
distribution of |
x.linked |
Simulated autosomal markers ( |
nA |
A vector of minor allele counts, one for each marker. If not
specified, it will be calculated from |
n.males |
The number of males (only relevant if |
... |
specific parameters for the uniform or beta |
The exactequilibrium
option only takes effects for autosomal
markers (x.linked=FALSE
) and multinomial sampling
(conditional=FALSE
).
Option pfixed
is deprecated and replaced by conditional
HWData
returns a matrix of genotype counts, nm
by 3 for
autsomal markers or nm
by 5 for X-chromosomal markers. Output
is no longer supplied in the compositional form. Function
HWClo
can be used to convert the genotype counts to a composition.
If the inbreeding coefficient is specified (f
) it will only
take effect for autosomal markers (x.linked=FALSE
) and
multinomial sampling (conditional=FALSE
).
X |
A matrix containing the genotype counts. |
Jan Graffelman (jan.graffelman@upc.edu)
nm <- 100 n <- 100 out <- HWData(nm,n)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.