genDataset: genDataset

View source: R/genDataset.R

genDatasetR Documentation

genDataset

Description

Function for generating mixture samples for given model parameters

Usage

genDataset(
  nC,
  popFreq,
  mu = 1000,
  sigma = 0.1,
  sorted = FALSE,
  threshT = 50,
  refData = NULL,
  mx = NULL,
  nrep = 1,
  stutt = 0,
  prC = 0,
  lambda = 0,
  beta = 1,
  kit = NULL,
  stuttFW = 0
)

Arguments

nC

Number of contributors in model.

popFreq

A list with allele frequencies for a given population.

mu

Expected peak heights for a het. single contributor allele

sigma

Coeffecient of variance of peak heights.

sorted

Wheter sorting the contributors with respect to decreasingly mixture proportions.

threshT

Required allele peak height in mixture (can be a vector with names giving the loci names)

refData

A list with given reference profiles given as refData[[i]][[s]]. Default is random from population.

mx

A vector with known mixture proportions. Default is random uniform.

nrep

Number of peak height replicates (same contributors) to generate. Default is 1.

stutt

A numerical stutter proportion (n-1). Default is 0.

prC

A numerical dropin probability (can be a vector with names giving the loci names). Default is 0.

lambda

The rate parameter in the exponential distribution for simulating drop-in peak heights (can be a vector with names giving the loci names). Default is 0.

beta

The degradation slope parameter used for simulating degradation trend (requires valid kit to be specified). Default is 1.

kit

shortname of kit: "ESX17","ESI17","ESI17Fast","ESX17Fast","Y23","Identifiler","NGM","ESSPlex","ESSplexSE","NGMSElect","SGMPlus","ESX16", "Fusion","GlobalFiler"

stuttFW

A numerical Forward stutter proportion (n+1). Default is 0.

Details

genDataset samples random mixture peak heights given as gamma(rho*sum(h_k),tau), with h_k as peak height of k-te contributor. genData conditions on alleles given by refData. Empty references are generated with population frequencies.

Value

List with elements theta,samples,refData where theta is the true parameters of the model. samples is a list with samples which for each samples has locus-list elements with list elements adata and hdata

Author(s)

Oyvind Bleka

Examples

## Not run:  
kit = "SGMPlus"
popfile = paste(path.package("euroformix"),"FreqDatabases",
 paste0(kit,"_Norway.csv"),sep=.Platform$file.sep)
popFreq = freqImport(popfile)[[1]] #obtain list with population frequencies
gen = genDataset(2,popFreq,beta=.7,kit=kit,stutt=.1,stuttFW=.05)
plotEPG2(gen$samples,kit = kit,refData=gen$refData,AT=50) #visualize samples

## End(Not run)

oyvble/euroformix documentation built on Aug. 25, 2023, 11:14 a.m.