sample_genotype {simDNAmixtures}R Documentation

Sample a genotype according to allele frequencies

Description

Sample a genotype according to allele frequencies

Usage

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

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.

Value

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

Examples

# 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"))

[Package simDNAmixtures version 1.0.1 Index]