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

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