Create a mixture of genotypes with simulated drop-in and dropout

Share:

Description

Takes as input genotypes and creates a mixture. Alleles drop in and out of the mixture with the specified probabilities

Usage

1
generateMix(G,alleles,afreq,D,di)

Arguments

G

List of genotypes. Each element is a vector with genotype for one individual

alleles

Vector of allele names for the marker

afreq

Vector of allele frequencies for the marker

D

List of dropout values (between 0 and 1) per contributor. Each element is a vector containing heterozygous and homozygous dropout probability for the given contributor

di

Drop-in value

Value

Returns a vector of mixture alleles.

Author(s)

Guro Dorum

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
#Define alleles and frequencies
alleles <- 1:2
afreq <- c(0.5,0.5)
#Genotypes
gM <- c(1,1)
gC <- c(1,2)
#Dropout and drop-in values
d <- 0.1
di <- 0.05
#No drop-in for first contributor
D <- list(c(0,0),c(d,d^2))
R <- generateMix(G=list(gM,gC),alleles,afreq,D=D,di=di)