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

Description Usage Arguments Value Author(s) Examples

View source: R/generateMix.R

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

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

 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)

Example output

Loading required package: Familias
Loading required package: kinship2
Loading required package: Matrix
Loading required package: quadprog
Loading required package: paramlink
Loading required package: Rsolnp
Warning messages:
1: no DISPLAY variable so Tk is not available 
2: loading Rplot failed 

relMix documentation built on Dec. 15, 2020, 5:11 p.m.