simulateGenotypes: Simulate bi-allelic genotypes.

Description Usage Arguments Value See Also Examples

View source: R/genotypeFunctions.R

Description

Simulate bi-allelic genotypes.

Usage

1
2
3
4
5
6
7
8
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

standardiseGenotypes

Examples

1
2
3
N10NrSNP10 <- simulateGenotypes(N=10, NrSNP=10)
N10NrSNP10 <- simulateGenotypes(N=10, NrSNP=10,
frequencies=c(0.2,0.3,0.4))

HannahVMeyer/PhenotypeSimulator documentation built on July 19, 2021, 7:41 a.m.