Skip to contents

Note that this function doesn't preprocess the bloodmeal and human profile data. If you would like to preprocess it in the same way as is performed internally in the bistro() function, you must run prep_bloodmeal_profiles() and prep_human_profiles() first.

Usage

calc_log10_lrs(
  bloodmeal_profiles,
  human_profiles,
  pop_allele_freqs,
  kit,
  peak_thresh,
  bloodmeal_ids = NULL,
  human_ids = NULL,
  model_degrad = TRUE,
  model_bw_stutt = FALSE,
  model_fw_stutt = FALSE,
  difftol = 1,
  threads = 4,
  seed = NULL,
  time_limit = 3,
  check_inputs = TRUE
)

Arguments

bloodmeal_profiles

Tibble or data frame with alleles for all bloodmeals in reference database including 4 columns: SampleName, Marker, Allele, Height. Height must be numeric or coercible to numeric.

human_profiles

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

pop_allele_freqs

Tibble or data frame 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. If NULL and calc_allele_freqs = TRUE, then population allele frequencies will be calculated from human_profiles.

kit

STR kit name from euroformix. To see a list of all kits embedded in euroformix use euroformix::getKit(). If your kit is not included, see vignette("bistro") for details on how to include your own kit.

peak_thresh

Allele peak height threshold in RFUs. All peaks under this threshold will be filtered out. If prior filtering was performed, this number should be equal to or greater than that number. Also used for threshT argument in euroformix::contLikSearch().

bloodmeal_ids

Vector of bloodmeal ids from the SampleName column in bloodmeal_profiles for which to compute log10_lrs. If NULL, all ids in the input dataframe will be used. Default: NULL

human_ids

Vector of human ids from the SampleName column in human_profiles for which to compute log10_lrs. If NULL, all ids in the input dataframe will be used. Default: NULL

model_degrad

A boolean indicating whether or not to model peak degradation. Used for modelDegrad argument in euroformix::contLikSearch(). Default: TRUE

model_bw_stutt

A boolean indicating whether or not to model peak backward stutter. Used for modelBWstutt argument in euroformix::contLikSearch(). Default: FALSE

model_fw_stutt

A boolean indicating whether or not to model peak forward stutter. Used for modelFWstutt argument in euroformix::contLikSearch(). Default: FALSE

difftol

Tolerance for difference in log likelihoods across 2 iterations. euroformix::contLikSearch() argument. Default: 1

threads

Number of threads to use when calculating log10_lrs. euroformix::contLikSearch() argument. Default: 4

seed

Seed when calculating log10_lrs. euroformix::contLikSearch() argument. Default: NULL (no seed)

time_limit

Time limit in minutes to run the euroformix::contLikSearch() function on 1 bloodmeal-human pair. Default: 3

check_inputs

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

Value

A tibble with the same output as for bistro(), except there is no match column and every bloodmeal-human pair with the calculated log10_lr is included. The only additional column is efm_noc which is the number of contributors used for euroformix::contLikSearch(). This has a maximum value of 3.

Examples

bm_profs <- prep_bloodmeal_profiles(bloodmeal_profiles, peak_thresh = 200)
#> Removing 6 peaks under the threshold of 200 RFU.
#> For 1/4 bloodmeal ids, all peaks are below the threshold
hu_profs <- prep_human_profiles(human_profiles)
log10_lrs <- calc_log10_lrs(bm_profs,
  hu_profs,
  bloodmeal_ids = "evid1",
  pop_allele_freqs = pop_allele_freqs,
  kit = "ESX17",
  peak_thresh = 200
)
#> 1/17 markers in kit but not in bloodmeal_profiles: AMEL
#> 1/17 markers in kit but not in human_profiles: AMEL
#> # bloodmeal ids: 1
#> # human ids: 3
#> Bloodmeal id 1/1
#> Human id 1/3
#> Human id 2/3
#> Human id 3/3