Last updated: 2025-01-17
Checks: 7 0
Knit directory: PODFRIDGE/
This reproducible R Markdown analysis was created with workflowr (version 1.7.1). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.
Great! Since the R Markdown file has been committed to the Git repository, you know the exact version of the code that produced these results.
Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.
The command set.seed(20230302) was run prior to running
the code in the R Markdown file. Setting a seed ensures that any results
that rely on randomness, e.g. subsampling or permutations, are
reproducible.
Great job! Recording the operating system, R version, and package versions is critical for reproducibility.
Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.
Great job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.
Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.
The results in this page were generated with repository version 64c4f90. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.
Note that you need to be careful to ensure that all relevant files for
the analysis have been committed to Git prior to generating the results
(you can use wflow_publish or
wflow_git_commit). workflowr only checks the R Markdown
file, but you know if there are other scripts or data files that it
depends on. Below is the status of the Git repository when the results
were generated:
Ignored files:
Ignored: .DS_Store
Ignored: .Rhistory
Ignored: .Rproj.user/
Ignored: analysis/.DS_Store
Ignored: analysis/.Rhistory
Ignored: data/.DS_Store
Untracked files:
Untracked: data/family_size.csv
Unstaged changes:
Modified: .Rprofile
Modified: .gitattributes
Modified: .gitignore
Modified: PODFRIDGE.Rproj
Modified: README.md
Modified: _workflowr.yml
Modified: analysis/CODIS-STR-freqs.Rmd
Modified: analysis/STR-simulation.Rmd
Modified: analysis/_site.yml
Modified: analysis/about.Rmd
Modified: analysis/database-composition.Rmd
Modified: analysis/final_equation.Rmd
Modified: analysis/index.Rmd
Modified: analysis/license.Rmd
Modified: analysis/long-range-prob.Rmd
Modified: analysis/lr.Rmd
Modified: analysis/lr_dist.Rmd
Modified: analysis/methods.Rmd
Modified: analysis/murphy.rmd
Modified: analysis/regression.Rmd
Modified: analysis/relative-distribution.Rmd
Modified: code/README.md
Modified: code/STR-sims-env.txt
Modified: code/STR_sims-v2.R
Modified: code/STR_sims-v3.R
Modified: code/STR_sims.R
Modified: code/assemble_table.R
Modified: code/env.yml
Modified: code/geno-sim_script.sh
Modified: code/great-lakes-setup.sh
Modified: code/known-vs-tested_simulation_script.R
Modified: code/launcher_job
Modified: code/lr.R
Modified: code/lr_cutoff.R
Modified: code/lr_expanded.R
Modified: code/lr_plots.R
Modified: code/rslurm_simulate_genotypes.R
Modified: code/script-v2.sh
Modified: code/script-v3-array1.sh
Modified: code/script-v3-batch1.sh
Modified: code/script.sh
Modified: code/script_v3-launcher.sh
Modified: code/simulate_focal_genotypes.R
Modified: code/simulate_genotypes.R
Modified: code/simulate_genotypes_expanded.R
Modified: code/simulations_script.R
Modified: code/synthetic_data.R
Modified: data.csv
Modified: data/1036_AfAm.csv
Modified: data/1036_AfAm_wide.csv
Modified: data/1036_Asian.csv
Modified: data/1036_Asian_wide.csv
Modified: data/1036_Cauc.csv
Modified: data/1036_Cauc_wide.csv
Modified: data/1036_Hispanic.csv
Modified: data/1036_Hispanic_wide.csv
Modified: data/1036_all.csv
Modified: data/1036_all_wide.csv
Modified: data/Coop_cousins_vs_database_size.R
Modified: data/DTC_access_export.csv
Modified: data/DTC_race_export.csv
Modified: data/Murphy_Appendix_all_data.csv
Modified: data/README.md
Modified: data/autosomal_ibd_by_pair.20150206.txt
Modified: data/data_filtered_recoded.csv
Modified: data/data_proportions.csv
Modified: data/df_allelefreq_combined.csv
Modified: data/df_allelefreq_wide.csv
Modified: data/dl_known_vs_tested_simulation_results.csv
Modified: data/dtc_demographics.csv
Modified: data/erlich2018.md
Modified: data/final_CODIS_data.csv
Modified: data/frequency_table_by_race_year.csv
Modified: data/marker_list.txt
Modified: data/murphy_foia_cleaned.csv
Modified: data/populations_states.csv
Modified: data/processed_genotypes.csv
Modified: data/proportions_table_by_race_year.csv
Modified: data/regression_data/readme
Modified: data/sim-summary_genotypes.csv
Modified: data/sim_processed_genotypes.csv
Modified: data/sim_summary_genotypes.csv
Modified: data/sims/simulation_11297218/processed_genotypes.csv
Modified: data/sims/simulation_11297218/timing_log.csv
Modified: data/simulation_results.csv
Modified: data/stats_by_race_year.csv
Modified: data/subset_example_data/readme
Modified: data/subset_example_data/sim_cutoffs.csv
Modified: data/subset_example_data/sim_proportions_exceeding_cutoffs.csv
Modified: data/summary_genotypes.csv
Modified: output/README.md
Modified: output/aggregated_llr_results_by_population.csv
Modified: output/cutoff_results.csv
Modified: output/cutoffs.csv
Modified: output/demographic_composition_comparison.csv
Modified: output/proportions_exceeding_cutoffs.csv
Modified: output/sim_cutoffs.csv
Modified: output/sim_proportions_exceeding_cutoffs.csv
Modified: output/simulation_11297164/sim_processed_genotypes.csv
Modified: output/simulation_20240726-103909/sim_cutoffs.csv
Modified: output/simulation_20240726-103909/sim_processed_genotypes.csv
Modified: output/simulation_20240726-103909/sim_proportions_exceeding_cutoffs.csv
Modified: output/simulation_20240726-103909/sim_summary_genotypes.csv
Modified: output/simulation_20240726-103909/timing_log.csv
Modified: output/simulation_20240726-152621/sim_cutoffs.csv
Modified: output/simulation_20240726-152621/sim_processed_genotypes.csv
Modified: output/simulation_20240726-152621/sim_proportions_exceeding_cutoffs.csv
Modified: output/simulation_20240726-152621/sim_summary_genotypes.csv
Modified: output/simulation_20240726-152621/timing_log.csv
Modified: output/simulation_20240726-154225/logfiles/resource_usage_11226865.log
Modified: output/simulation_20240726-154225/logfiles/usage_11226865.log
Modified: output/simulation_20240726-154225/sim_cutoffs.csv
Modified: output/simulation_20240726-154225/sim_processed_genotypes.csv
Modified: output/simulation_20240726-154225/sim_proportions_exceeding_cutoffs.csv
Modified: output/simulation_20240726-154225/sim_summary_genotypes.csv
Modified: output/simulation_20240726-154225/timing_log.csv
Modified: output/simulation_20240726-155743/sim_cutoffs.csv
Modified: output/simulation_20240726-155743/sim_processed_genotypes.csv
Modified: output/simulation_20240726-155743/sim_proportions_exceeding_cutoffs.csv
Modified: output/simulation_20240726-155743/sim_summary_genotypes.csv
Modified: output/simulation_20240726-155743/slurm/resource_usage_11226959.log
Modified: output/simulation_20240726-155743/slurm/usage_11226959.log
Modified: output/simulation_20240726-155743/timing_log.csv
Modified: output/simulation_20240726-160726_11227723/sim_cutoffs.csv
Modified: output/simulation_20240726-160726_11227723/sim_processed_genotypes.csv
Modified: output/simulation_20240726-160726_11227723/sim_proportions_exceeding_cutoffs.csv
Modified: output/simulation_20240726-160726_11227723/sim_summary_genotypes.csv
Modified: output/simulation_20240726-160726_11227723/slurm/resource_usage_11227723.log
Modified: output/simulation_20240726-160726_11227723/slurm/usage_11227723.log
Modified: output/simulation_20240726-160726_11227723/timing_log.csv
Modified: output/simulation_20240726-162034_11228488/slurm/resource_usage_11228488.log
Modified: output/simulation_20240726-162034_11228488/slurm/usage_11228488.log
Modified: output/simulation_20240726-163235_11228791/slurm/resource_usage_11228791.log
Modified: output/simulation_20240726-163235_11228791/slurm/usage_11228791.log
Modified: output/simulation_20240726-164223_11229998/slurm/resource_usage_11229998.log
Modified: output/simulation_20240726-164223_11229998/slurm/usage_11229998.log
Modified: output/simulation_20240726-165046_11230240/slurm/resource_usage_11230240.log
Modified: output/simulation_20240726-165046_11230240/slurm/usage_11230240.log
Modified: output/simulation_20240726-165603/sim_cutoffs.csv
Modified: output/simulation_20240726-165603/sim_processed_genotypes.csv
Modified: output/simulation_20240726-165603/sim_proportions_exceeding_cutoffs.csv
Modified: output/simulation_20240726-165603/sim_summary_genotypes.csv
Modified: output/simulation_20240726-165603/timing_log.csv
Modified: output/simulation_20240726-165924/sim_cutoffs.csv
Modified: output/simulation_20240726-165924/sim_processed_genotypes.csv
Modified: output/simulation_20240726-165924/sim_proportions_exceeding_cutoffs.csv
Modified: output/simulation_20240726-165924/sim_summary_genotypes.csv
Modified: output/simulation_20240726-165924/timing_log.csv
Modified: output/simulation_20240726-170852/sim_cutoffs.csv
Modified: output/simulation_20240726-170852/sim_processed_genotypes.csv
Modified: output/simulation_20240726-170852/sim_proportions_exceeding_cutoffs.csv
Modified: output/simulation_20240726-170852/sim_summary_genotypes.csv
Modified: output/simulation_20240726-170852/timing_log.csv
Modified: output/simulation_20240726-172213/sim_cutoffs.csv
Modified: output/simulation_20240726-172213/sim_processed_genotypes.csv
Modified: output/simulation_20240726-172213/sim_proportions_exceeding_cutoffs.csv
Modified: output/simulation_20240726-172213/sim_summary_genotypes.csv
Modified: output/simulation_20240726-172230/sim_cutoffs.csv
Modified: output/simulation_20240726-172230/sim_processed_genotypes.csv
Modified: output/simulation_20240726-172230/sim_proportions_exceeding_cutoffs.csv
Modified: output/simulation_20240726-172230/sim_summary_genotypes.csv
Modified: output/simulation_20240726-172230/timing_log.csv
Modified: output/simulation_20240727-143100/sim_cutoffs.csv
Modified: output/simulation_20240727-143100/sim_processed_genotypes.csv
Modified: output/simulation_20240727-143100/sim_proportions_exceeding_cutoffs.csv
Modified: output/simulation_20240727-143100/sim_summary_genotypes.csv
Modified: slurm/STR_sims-11266147.log
Modified: slurm/STR_sims-11297218.log
Modified: slurm/STR_sims-v2-11266148.log
Modified: slurm/STR_sims-v2-11297164.log
Modified: slurm/resource_usage_11226557.log
Modified: slurm/resource_usage_11231120.log
Modified: slurm/resource_usage_11233712.log
Modified: slurm/resource_usage_11234141.log
Modified: slurm/resource_usage_11234476.log
Modified: slurm/resource_usage_11234482.log
Modified: slurm/resource_usage_11266147.log
Modified: slurm/resource_usage_11266148.log
Modified: slurm/resource_usage_11297164.log
Modified: slurm/usage_11226557.log
Modified: slurm/usage_11231120.log
Modified: slurm/usage_11233712.log
Modified: slurm/usage_11234141.log
Modified: slurm/usage_11234476.log
Modified: slurm/usage_11234482.log
Modified: slurm/usage_11266147.log
Modified: slurm/usage_11266148.log
Modified: slurm/usage_11297164.log
Modified: slurm/usage_11297218.log
Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.
These are the previous versions of the repository in which changes were
made to the R Markdown (analysis/probability_disparity.Rmd)
and HTML (docs/probability_disparity.html) files. If you’ve
configured a remote Git repository (see ?wflow_git_remote),
click on the hyperlinks in the table below to view the files as they
were in that past version.
| File | Version | Author | Date | Message |
|---|---|---|---|---|
| Rmd | 64c4f90 | Junhui He | 2025-01-17 | create a report for Result 3 |
We aims to determine the difference in the probability of finding a match in a direct-to-consumer (DTC) genetic database for Black and White Americans. This analysis integrates family size distributions (from Result 2), database representation disparities (from Result 1B), and considers the proportion of DTC databases accessible to law enforcement.
We establish a theoretical binomial model \(\text{Bin}(K,p)\) to calculate the probability of finding a match in a database, where \(K\) is the size of the database and \(p\) is the match probability between a target and another individual. The match probability \(p\) is calculated based on the population size, the database size, racial representation disparities, and the family size distribution.
In the current generation, the population size is \(N\), and the racial proportion of the population is \(\alpha\).
The database has \(K\) individuals, and the racial proportion of the database is \(\beta\). The database is randomly sampled from the current population.
The family trees of different races are strictly separated. For instance, the ancestors and descendants of black Americans are also black Americans.
We assume that there is no inter-marriage in the family involved, except for the known ancestor couple of the target.
The number of children per couple at the generation \(g\) before the present is \(r_g\). In this model, we estimate \(r_1\) by the children number of 1990 age-range 40-49 women, \(r_2\) by the children number of 1960 age-range 40-49 women, \(r_3\) by the children number of 1960 age-range 70+ women and \(r_g\) has the same distribution as \(r_3\) for \(g\geq 3\). Additionally, if a certain couple is known as the ancestors of the target, it has at least one child.
Individuals are diploid and we consider only the autosomal genome.
The genome of the target individual is compared to those of all individuals in the database, and identical-by-descent (IBD) segments are identified. We assume that detectable segments must be of length \(\geq\) \(m\) (in Morgans). We further assume that in order to confidently detect the relationship (a “match”), we must observe at least \(s\) such segments
We only consider relationships for which the common ancestors have lived \(g\leq g_{\max}\) generations ago. For example, \(g=1\) for siblings, \(g=2\) for first cousins, etc. All cousins/siblings are full.
We only consider regular cousins, excluding once removed and so on.
The number of matches between the target and the individuals in the database is counted. If we have more than \(t\) matches, we declare that there is sufficient information to trace back the target. Typically, we simply assume \(t=1\).
Consider the cousins of the target. \(g\) generations before the present, the target has \(2^{g-1}\) ancestral couples. For example, each individual has one pair of parents (\(g=1\)), two pairs of grandparents (\(g=2\)), four pairs of great-grandparents (\(g=3\)) and so on. Each ancestral couple contributes to \((r_g-1) \prod_{i=1}^{g-1} r_i\) of the \((g-1)\)-th cousins of the target. For example, consider a pair of grandparents (\(g=2\)), each individual has \((r_2-1)\) uncles/aunts, and hence \((r_2-1)r_1\) first cousins. Note that \(r_g \geq 1\). Therefore, the total number of the \((g-1)\)-th cousins is given by
\[\text{The number of the $(g-1)$ cousins}=2^{g-1}(r_g-1) \prod_{i=1}^{g-1} r_i.\]
Under the assumption of separated family trees and randomly sampled database, given the family size, the probability to share an ancestral couple for the first time at generation \(g\) between the target and the individual in the database with the same race is approximately:
\[P(\text{first sharing a mating pair at $g$ for a certain race}|r)=\frac{2^{g-1}(r_g-1) \prod_{i=1}^{g-1} r_i}{\alpha N}.\]
Given the family size, the probability of declaring a match between the target and a random individual in the database is simply the sum of the product over all \(g\),
\[ P(\text{match}|r)=\sum_{g=1}^{g_{\max}} P(\text{match}|g) \frac{2^{g-1}(r_g-1) \prod_{i=1}^{g-1} r_i}{\alpha N}. \]
The number of matches to a database is assumed to follow a binomial distribution defined as
\[ \text{Bin}(\beta K, P(\text{match}|r)) .\]
To identify an individual, we need to find at least \(t\) matches in the database. Thus, given the family size,
\[P(\text{identify}|r)=1-\sum_{k=1}^{t-1} \text{Bin}(k;\beta K, P(\text{match}|r)).\]
We utilize Monte Carlo methods to calculate the mean probability of identifying an individual over family size, i.e., \(E[P(\text{identify}|r)]\).
Additionally, we calculate \(P(\text{identify}|\bar{r})\) to make a comparison with \(E[P(\text{identify}|r)]\), where \(\bar{r}\) represents the mean number of children. This probability \(P(\text{identify}|\bar{r})\) is used in the paper of Erlich et al. 2018, if we substitute \(\bar{r}\) by a constant \(r\).


The identification probability for White Americans is significantly higher than that for Black Americans, primarily due to disparities in database representation.
The value of \(P(\text{identify}|\bar{r})\) is notably higher than \(E[P(\text{identify}|r)]\), highlighting the importance of considering family size as a complete distribution in the analysis.
R version 4.4.2 (2024-10-31)
Platform: aarch64-apple-darwin20
Running under: macOS Sequoia 15.2
Matrix products: default
BLAS: /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRlapack.dylib; LAPACK version 3.12.0
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
time zone: America/Detroit
tzcode source: internal
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] ggplot2_3.5.1 workflowr_1.7.1
loaded via a namespace (and not attached):
[1] gtable_0.3.6 jsonlite_1.8.9 compiler_4.4.2 promises_1.3.2
[5] Rcpp_1.0.13-1 stringr_1.5.1 git2r_0.35.0 callr_3.7.6
[9] later_1.4.1 jquerylib_0.1.4 scales_1.3.0 yaml_2.3.10
[13] fastmap_1.2.0 R6_2.5.1 labeling_0.4.3 knitr_1.49
[17] tibble_3.2.1 munsell_0.5.1 rprojroot_2.0.4 bslib_0.8.0
[21] pillar_1.9.0 rlang_1.1.4 utf8_1.2.4 cachem_1.1.0
[25] stringi_1.8.4 httpuv_1.6.15 xfun_0.49 getPass_0.2-4
[29] fs_1.6.5 sass_0.4.9 cli_3.6.3 withr_3.0.2
[33] magrittr_2.0.3 ps_1.8.1 grid_4.4.2 digest_0.6.37
[37] processx_3.8.4 rstudioapi_0.17.1 lifecycle_1.0.4 vctrs_0.6.5
[41] evaluate_1.0.1 glue_1.8.0 farver_2.1.2 whisker_0.4.1
[45] colorspace_2.1-1 fansi_1.0.6 rmarkdown_2.29 httr_1.4.7
[49] tools_4.4.2 pkgconfig_2.0.3 htmltools_0.5.8.1