Simulate bi-allelic genotypes.

simulateGenotypes(N, NrSNP = 5000, frequencies = c(0.1, 0.2, 0.4),
  sampleID = "ID_", snpID = "SNP_", verbose = TRUE)

Arguments

N

Number of samples for which to simulate bi-allelic genotypes.

NrSNP

Number of SNPs to simulate.

frequencies

Vector of allele frequencies [double] from which to sample.

sampleID

Prefix [string] for naming samples (will be followed by sample number from 1 to N when constructing id_samples).

snpID

Prefix [string] for naming SNPs (will be followed by SNP number from 1 to NrSNP when constructing id_snps).

verbose

[boolean] If TRUE, progress info is printed to standard out.

Value

Named list with [N x NrSNP] matrix of simulated genotypes (genotypes), their SNP frequencies (freq), a vector of sample IDs (id_samples) and a vector of SNP IDs (id_snps).

See also

Examples

N10NrSNP10 <- simulateGenotypes(N=10, NrSNP=10)
#> Simulate 10 SNPs...
N10NrSNP10 <- simulateGenotypes(N=10, NrSNP=10, frequencies=c(0.2,0.3,0.4))
#> Simulate 10 SNPs...