simulGenosDoseStruct | R Documentation |
Simulate SNP genotypes as allele dose additively encoded, i.e. 0,1,2, using correlated allele frequencies to mimick genetic structure.
simulGenosDoseStruct(
nb.genos = c(100, 120, 80),
nb.snps = 1000,
div.pops = diag(3) * 0.5 + 0.5,
geno.ids = NULL,
snp.ids = NULL
)
nb.genos |
number of genotypes (i.e. individuals) per population |
nb.snps |
number of SNPs |
div.pops |
matrix of divergence among populations, with a diagonal of 1's; the closer off-diagonal values are from 1; the weaker the divergence; the further, the stronger |
geno.ids |
vector of genotype identifiers (if NULL, will be "geno001", etc) |
snp.ids |
vector of SNP identifiers (if NULL, will be "snp001", etc) |
matrix with genotypes in rows and SNPs in columns
Andres Legarra [aut], Timothee Flutre [ctb]
## Not run:
## weak divergences among populations:
weak.div.pops <- diag(3)
weak.div.pops[upper.tri(weak.div.pops)] <- 0.9
weak.div.pops[lower.tri(weak.div.pops)] <- weak.div.pops[upper.tri(weak.div.pops)]
weak.div.pops
## strong divergences among populations:
strong.div.pops <- diag(3)
strong.div.pops[upper.tri(strong.div.pops)] <- 0.5
strong.div.pops[lower.tri(strong.div.pops)] <- strong.div.pops[upper.tri(strong.div.pops)]
strong.div.pops
X <- simulGenosDoseStruct(div.pops=weak.div.pops)
A <- estimGenRel(X)
imageWithScale(A, "Weak divergence")
X <- simulGenosDoseStruct(div.pops=strong.div.pops)
A <- estimGenRel(X)
imageWithScale(A, "Strong divergence")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.