generateMix: Create a mixture of genotypes with simulated drop-in and...

View source: R/generateMix.R

generateMixR Documentation

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

Description

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

Usage

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

Arguments

G

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

alleles

Numeric or character Vector of allele names for the marker

afreq

Numeric 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 (between 0 and 1)

Value

A vector of mixture alleles.

Author(s)

Guro Dorum

Examples

#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)

gdorum/relMix documentation built on April 17, 2024, 8:49 p.m.