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      15      16
#> 2           S1      vWA      17      18
#> 3           S1  D16S539      10      11
#> 4           S1   CSF1PO      10      11
#> 5           S1     TPOX       8      11
#> 6           S1  D8S1179      13      13
#> 7           S1   D21S11    24.2      29
#> 8           S1   D18S51      12      17
#> 9           S1   D2S441      11      11
#> 10          S1  D19S433      13      16
#> 11          S1     TH01       7     9.3
#> 12          S1      FGA      19      23
#> 13          S1 D22S1045      17      17
#> 14          S1   D5S818      11      12
#> 15          S1  D13S317      11      13
#> 16          S1   D7S820      10      11
#> 17          S1     SE33    25.2    27.2
#> 18          S1 D10S1248      13      15
#> 19          S1  D1S1656      15    18.3
#> 20          S1  D12S391      15      17
#> 21          S1  D2S1338      19      20
#> 
#> $U1
#>    Sample Name    Locus Allele1 Allele2
#> 1           U1  D3S1358      15      16
#> 2           U1      vWA      15      18
#> 3           U1  D16S539      12      12
#> 4           U1   CSF1PO      11      11
#> 5           U1     TPOX       8      12
#> 6           U1  D8S1179      13      14
#> 7           U1   D21S11      28    31.2
#> 8           U1   D18S51      16      17
#> 9           U1   D2S441      15      15
#> 10          U1  D19S433      15      16
#> 11          U1     TH01       6       8
#> 12          U1      FGA      19      24
#> 13          U1 D22S1045      16      16
#> 14          U1   D5S818      11      12
#> 15          U1  D13S317      11      11
#> 16          U1   D7S820       8      11
#> 17          U1     SE33    22.2    30.2
#> 18          U1 D10S1248      14      16
#> 19          U1  D1S1656      15    17.3
#> 20          U1  D12S391      17      18
#> 21          U1  D2S1338      23      24
#> 
#> $S2
#>    Sample Name    Locus Allele1 Allele2
#> 1           S2  D3S1358      15      16
#> 2           S2      vWA      17      17
#> 3           S2  D16S539      11      12
#> 4           S2   CSF1PO      10      11
#> 5           S2     TPOX       8      11
#> 6           S2  D8S1179      13      13
#> 7           S2   D21S11      29      29
#> 8           S2   D18S51      12      17
#> 9           S2   D2S441      11      14
#> 10          S2  D19S433      12      16
#> 11          S2     TH01       7       9
#> 12          S2      FGA      19      23
#> 13          S2 D22S1045      17      17
#> 14          S2   D5S818      11      12
#> 15          S2  D13S317      11      13
#> 16          S2   D7S820      10      12
#> 17          S2     SE33    25.2    27.2
#> 18          S2 D10S1248      14      15
#> 19          S2  D1S1656      15    17.3
#> 20          S2  D12S391      16      17
#> 21          S2  D2S1338      17      26
#> 

# 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      16      17
#> 3           S1  D16S539       9      13
#> 4           S1   CSF1PO      10      11
#> 5           S1     TPOX       8       9
#> 6           S1  D8S1179      13      13
#> 7           S1   D21S11      29      30
#> 8           S1   D18S51      14      17
#> 9           S1   D2S441    11.3      14
#> 10          S1  D19S433      12      14
#> 11          S1     TH01       6       7
#> 12          S1      FGA      22      24
#> 13          S1 D22S1045      15      15
#> 14          S1   D5S818      11      12
#> 15          S1  D13S317      11      12
#> 16          S1   D7S820      11      13
#> 17          S1     SE33    30.2      32
#> 18          S1 D10S1248      16      17
#> 19          S1  D1S1656      11      16
#> 20          S1  D12S391      17      18
#> 21          S1  D2S1338      17      23
#> 22          S1     AMEL       X       Y
#> 
#> $S2
#>    Sample Name    Locus Allele1 Allele2
#> 1           S2  D3S1358      14      15
#> 2           S2      vWA      16      17
#> 3           S2  D16S539      13      14
#> 4           S2   CSF1PO      10      11
#> 5           S2     TPOX       8       9
#> 6           S2  D8S1179      13      13
#> 7           S2   D21S11      30      30
#> 8           S2   D18S51      14      17
#> 9           S2   D2S441      11      14
#> 10          S2  D19S433      13      14
#> 11          S2     TH01       6       7
#> 12          S2      FGA      22      24
#> 13          S2 D22S1045      15      15
#> 14          S2   D5S818      12      12
#> 15          S2  D13S317      11      12
#> 16          S2   D7S820       8      13
#> 17          S2     SE33    30.2      32
#> 18          S2 D10S1248      13      16
#> 19          S2  D1S1656      16      16
#> 20          S2  D12S391      17      18
#> 21          S2  D2S1338      16      17
#> 22          S2     AMEL       X       Y
#> 
#> $U1
#>    Sample Name    Locus Allele1 Allele2
#> 1           U1  D3S1358      14      17
#> 2           U1      vWA      18      20
#> 3           U1  D16S539       8      11
#> 4           U1   CSF1PO      10      12
#> 5           U1     TPOX      11      11
#> 6           U1  D8S1179      11      15
#> 7           U1   D21S11      28      28
#> 8           U1   D18S51      12      14
#> 9           U1   D2S441      11      14
#> 10          U1  D19S433      13      14
#> 11          U1     TH01       6     9.3
#> 12          U1      FGA    22.2      23
#> 13          U1 D22S1045      15      17
#> 14          U1   D5S818      11      13
#> 15          U1  D13S317      11      14
#> 16          U1   D7S820       8       9
#> 17          U1     SE33    23.2    29.2
#> 18          U1 D10S1248      14      16
#> 19          U1  D1S1656      15    17.3
#> 20          U1  D12S391      16      26
#> 21          U1  D2S1338      24      25
#> 22          U1     AMEL       X       Y
#>