Learn R Programming

simDNAmixtures (version 1.0.1)

sample_genotype: Sample a genotype according to allele frequencies

Description

Sample a genotype according to allele frequencies

Usage

sample_genotype(freqs, loci = names(freqs), label = "U")

Value

DataFrame with columns Sample Name, Locus, Allele1 and Allele2.

Arguments

freqs

Allele frequencies (see read_allele_freqs)

loci

Character vector of locus names (defaults to names attribute of freqs)

label

Sample name

Details

A genotype is sampled randomly by drawing two alleles from allele frequencies for each locus.

Examples

Run this code
# 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"))

Run the code above in your browser using DataLab