sample_pedigree_genotypes: Sample genotypes for pedigree according to allele frequencies...

View source: R/sample_pedigree_genotypes.R

sample_pedigree_genotypesR Documentation

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

Description

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)

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.

Value

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

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)

simDNAmixtures documentation built on April 15, 2025, 1:11 a.m.