Skip to contents

Calculate allele frequencies for a (generally human) population.

Usage

calc_allele_freqs(human_profiles, rm_markers = NULL, check_inputs = TRUE)

Arguments

human_profiles

Tibble or data frame with alleles for all humans in reference database including three columns: SampleName, Marker, Allele.

rm_markers

A vector indicating what markers should be removed prior to calculating log10LRs. NULL to include all markers. By default, for the bistro function AMEL is removed as it is not standard to include it in LR calculations.

check_inputs

A boolean indicating whether or not to check the inputs to the function. Default: TRUE

Value

A tibble where the first column is the STR allele and the following columns are the frequency of that allele for different markers. Alleles that do not exist for a given marker are coded as NA.

Examples

calc_allele_freqs(human_profiles)
#> # A tibble: 32 × 18
#>    Allele  AMEL D10S1248 D12S391 D16S539 D18S51 D19S433 D1S1656 D21S11 D22S1045
#>    <chr>  <dbl>    <dbl>   <dbl>   <dbl>  <dbl>   <dbl>   <dbl>  <dbl>    <dbl>
#>  1 X        0.6     NA    NA      NA     NA        NA    NA       NA         NA
#>  2 Y        0.4     NA    NA      NA     NA        NA    NA       NA         NA
#>  3 12      NA        0.2  NA       0.167 NA        NA     0.167   NA         NA
#>  4 13      NA        0.6  NA      NA      0.167     0.4  NA       NA         NA
#>  5 17      NA       NA     0.167  NA      0.333    NA    NA       NA         NA
#>  6 18      NA       NA     0.333  NA     NA        NA    NA       NA         NA
#>  7 10      NA       NA    NA       0.333 NA        NA    NA       NA         NA
#>  8 11      NA       NA    NA       0.333  0.167    NA     0.167   NA         NA
#>  9 14      NA       NA    NA      NA      0.167     0.4   0.167   NA         NA
#> 10 29      NA       NA    NA      NA     NA        NA    NA        0.5       NA
#> # ℹ 22 more rows
#> # ℹ 8 more variables: D2S1338 <dbl>, D2S441 <dbl>, D3S1358 <dbl>,
#> #   D8S1179 <dbl>, FGA <dbl>, SE33 <dbl>, TH01 <dbl>, VWA <dbl>