# read allele frequencies
freqs <- read_allele_freqs(system.file("extdata","FBI_extended_Cauc.csv",
package = "simDNAmixtures"))
data(gf)
# define the gamma model for peak heights
model <- gamma_model(mixture_proportions = 1, mu = 1000.,
cv = 0.1, model_settings = gf$gamma_settings_no_stutter)
# sample a single source profile (1-person 'mixture')
u1 <- sample_contributor_genotypes("U1", freqs, loci = gf$autosomal_markers)
sample <- sample_mixture_from_genotypes(u1, model)
# peaks follow a gamma distribution with an expected height of
# 1,000 for heterozygous alleles; 2,000 for homozygotes
hist(sample$Height)
# the gamma distribution is more obvious if many samples are taken
many_samples <- replicate(n = 1e2,
sample_mixture_from_genotypes(u1, model),
simplify = FALSE)
hist(sapply(many_samples, function(x) x$Height))
Run the code above in your browser using DataLab