Skip to contents

Sample genotypes for mixture contributors according to allele frequencies

Usage

sample_contributor_genotypes(
  contributors,
  freqs,
  linkage_map,
  pedigree,
  loci = names(freqs),
  return_non_contributors = FALSE,
  sex_locus_name = "AMEL"
)

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)

linkage_map

(optional) A linkage map specifying the recombination fractions between loci. If missing, loci are assumed to be independent. See also sample_many_pedigree_genotypes.

pedigree

(optional) 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?

sex_locus_name

Character vector, defaults to "AMEL"

Value

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

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.

Examples


# read allele frequencies
freqs <- read_allele_freqs(system.file("extdata","FBI_extended_Cauc_022024.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, pedigree = ped_sibs,
                             loci = gf_configuration()$autosomal_markers)
#> $S1
#>    Sample Name    Locus Allele1 Allele2
#> 1           S1  D3S1358      14      17
#> 2           S1      vWA      17      17
#> 3           S1  D16S539      12      12
#> 4           S1   CSF1PO      11      12
#> 5           S1     TPOX       8      12
#> 6           S1  D8S1179      13      14
#> 7           S1   D21S11      30      31
#> 8           S1   D18S51      15      18
#> 9           S1   D2S441      11      14
#> 10          S1  D19S433      14      14
#> 11          S1     TH01       9     9.3
#> 12          S1      FGA      21      21
#> 13          S1 D22S1045      15      17
#> 14          S1   D5S818       9      12
#> 15          S1  D13S317      11      11
#> 16          S1   D7S820       8      10
#> 17          S1     SE33      19    32.2
#> 18          S1 D10S1248      15      16
#> 19          S1  D1S1656      14    17.3
#> 20          S1  D12S391      19      21
#> 21          S1  D2S1338      20      23
#> 
#> $U1
#>    Sample Name    Locus Allele1 Allele2
#> 1           U1  D3S1358      16      17
#> 2           U1      vWA      17      17
#> 3           U1  D16S539      11      13
#> 4           U1   CSF1PO      10      11
#> 5           U1     TPOX       8       8
#> 6           U1  D8S1179      12      13
#> 7           U1   D21S11      27      29
#> 8           U1   D18S51      14      15
#> 9           U1   D2S441      11      14
#> 10          U1  D19S433      12      14
#> 11          U1     TH01       6     9.3
#> 12          U1      FGA      22      22
#> 13          U1 D22S1045      15      16
#> 14          U1   D5S818      12      12
#> 15          U1  D13S317       8      11
#> 16          U1   D7S820       8      10
#> 17          U1     SE33    22.2    29.2
#> 18          U1 D10S1248      13      14
#> 19          U1  D1S1656      15    17.3
#> 20          U1  D12S391      16      19
#> 21          U1  D2S1338      17      24
#> 
#> $S2
#>    Sample Name    Locus Allele1 Allele2
#> 1           S2  D3S1358      14      17
#> 2           S2      vWA      17      17
#> 3           S2  D16S539      12      12
#> 4           S2   CSF1PO      10      11
#> 5           S2     TPOX       8      12
#> 6           S2  D8S1179      10      14
#> 7           S2   D21S11      30      31
#> 8           S2   D18S51      13      15
#> 9           S2   D2S441      11      14
#> 10          S2  D19S433      14      14
#> 11          S2     TH01       9     9.3
#> 12          S2      FGA      21      21
#> 13          S2 D22S1045      14      15
#> 14          S2   D5S818      10      12
#> 15          S2  D13S317      11      11
#> 16          S2   D7S820       8      10
#> 17          S2     SE33      18      19
#> 18          S2 D10S1248      15      16
#> 19          S2  D1S1656      14      15
#> 20          S2  D12S391      19      21
#> 21          S2  D2S1338      17      17
#> 

# now also include AMEL
sample_contributor_genotypes(contributors = c("S1","S2", "U1"),
                             freqs, pedigree = ped_sibs,
                             loci = c(gf_configuration()$autosomal_markers, "AMEL"))
#> $S1
#>    Sample Name    Locus Allele1 Allele2
#> 1           S1  D3S1358      15      15
#> 2           S1      vWA      15      18
#> 3           S1  D16S539       9      11
#> 4           S1   CSF1PO      11      11
#> 5           S1     TPOX       9      11
#> 6           S1  D8S1179      13      13
#> 7           S1   D21S11      28      28
#> 8           S1   D18S51      13      13
#> 9           S1   D2S441      11      14
#> 10          S1  D19S433      13    16.2
#> 11          S1     TH01       7     9.3
#> 12          S1      FGA      20      26
#> 13          S1 D22S1045      11      15
#> 14          S1   D5S818      11      13
#> 15          S1  D13S317       8      14
#> 16          S1   D7S820       8       9
#> 17          S1     SE33      23    29.2
#> 18          S1 D10S1248      14      14
#> 19          S1  D1S1656      14      16
#> 20          S1  D12S391      15      22
#> 21          S1  D2S1338      21      24
#> 22          S1     AMEL       X       Y
#> 
#> $S2
#>    Sample Name    Locus Allele1 Allele2
#> 1           S2  D3S1358      15      17
#> 2           S2      vWA      15      18
#> 3           S2  D16S539       9      13
#> 4           S2   CSF1PO      11      11
#> 5           S2     TPOX       9      11
#> 6           S2  D8S1179      10      13
#> 7           S2   D21S11      28      28
#> 8           S2   D18S51      13      14
#> 9           S2   D2S441      11      11
#> 10          S2  D19S433      13      14
#> 11          S2     TH01       7     9.3
#> 12          S2      FGA      22      26
#> 13          S2 D22S1045      11      15
#> 14          S2   D5S818      11      12
#> 15          S2  D13S317       8      14
#> 16          S2   D7S820       8      10
#> 17          S2     SE33      17    29.2
#> 18          S2 D10S1248      14      14
#> 19          S2  D1S1656      16    19.3
#> 20          S2  D12S391      22      24
#> 21          S2  D2S1338      21      24
#> 22          S2     AMEL       X       Y
#> 
#> $U1
#>    Sample Name    Locus Allele1 Allele2
#> 1           U1  D3S1358      14      14
#> 2           U1      vWA      15      19
#> 3           U1  D16S539      12      14
#> 4           U1   CSF1PO      12      12
#> 5           U1     TPOX       8      10
#> 6           U1  D8S1179      13      13
#> 7           U1   D21S11      29      30
#> 8           U1   D18S51      17      22
#> 9           U1   D2S441      12      14
#> 10          U1  D19S433      12      15
#> 11          U1     TH01       6       7
#> 12          U1      FGA      21      22
#> 13          U1 D22S1045      11      11
#> 14          U1   D5S818      11      12
#> 15          U1  D13S317       8      11
#> 16          U1   D7S820      11      11
#> 17          U1     SE33      14      19
#> 18          U1 D10S1248      15      16
#> 19          U1  D1S1656      12      13
#> 20          U1  D12S391      18      22
#> 21          U1  D2S1338      17      23
#> 22          U1     AMEL       X       X
#>