Skip to contents

Sample genotypes for pedigree according to allele frequencies by allele dropping.

Usage

sample_pedigree_genotypes(pedigree, freqs, loci = names(freqs))

Arguments

pedigree

ped object

freqs

Allele frequencies (see read_allele_freqs)

loci

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

Value

List of DataFrames with genotypes for each pedigree member. See sample_genotype for the DataFrame format.

Details

For each founder, a genotype is sampled randomly by drawing two alleles according to allele frequencies. Alleles for the rest of the pedigree are then obtained by allele dropping: sample_offspring is invoked for each non-founder.

See also

sample_many_pedigree_genotypes for a function that takes linkage into account.

Examples

freqs <- read_allele_freqs(system.file("extdata","FBI_extended_Cauc_022024.csv",
                           package = "simDNAmixtures"))
gf <- gf_configuration()

ped_sibs <- pedtools::nuclearPed(children = c("S1", "S2"))

sibs_genotypes <- sample_pedigree_genotypes(ped = ped_sibs,
freqs = freqs, loci = gf$autosomal_markers)