sample_genotype {simDNAmixtures} | R Documentation |
Sample a genotype according to allele frequencies
sample_genotype(freqs, loci = names(freqs), label = "U")
freqs |
Allele frequencies (see read_allele_freqs) |
loci |
Character vector of locus names (defaults to |
label |
Sample name |
A genotype is sampled randomly by drawing two alleles from allele frequencies for each locus.
DataFrame with columns Sample Name
, Locus
, Allele1
and Allele2
.
# below we read an allele freqs and sample a genotype
filename <- system.file("extdata","FBI_extended_Cauc.csv",
package = "simDNAmixtures")
freqs <- read_allele_freqs(filename)
sample_genotype(freqs, loci = c("D3S1358", "vWA"))