sample_contributor_genotypes {simDNAmixtures}R Documentation

Sample genotypes for mixture contributors according to allele frequencies

Description

Sample genotypes for mixture contributors according to allele frequencies

Usage

sample_contributor_genotypes(
  contributors,
  freqs,
  pedigree,
  loci = names(freqs),
  return_non_contributors = FALSE
)

Arguments

contributors

Character vector with unique names of contributors. Valid names are "U1", "U2", ... for unrelated contributors or the names of pedigree members for related contributors.

freqs

Allele frequencies (see read_allele_freqs)

pedigree

(optionally) ped object

loci

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

return_non_contributors

Logical. Should genotypes of non-contributing pedigree members also be returned?

Details

For each founder or unrelated person, a genotype is sampled randomly by drawing two alleles from allele frequencies. The non-founders get genotypes by allele dropping, see sample_pedigree_genotypes for details.

Value

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

Examples


# read allele frequencies
freqs <- read_allele_freqs(system.file("extdata","FBI_extended_Cauc.csv",
                           package = "simDNAmixtures"))

# define a pedigree of siblings S1 and S2 (and their parents)
ped_sibs <- pedtools::nuclearPed(children = c("S1", "S2"))

# sample genotypes for a mixture of S1 + U1 + S2
# where U1 is an unrelated person

sample_contributor_genotypes(contributors = c("S1","U1","S2"), freqs, ped_sibs)

[Package simDNAmixtures version 1.0.1 Index]