commfish / GCLr

Gene Conservation Lab R package repository
3 stars 0 forks source link

plot distribution of rubias individual assignment z_scores #90

Open krshedd opened 3 months ago

krshedd commented 3 months ago

Create a new function to plot a histogram of rubias individual assignment z_scores. This can be helpful to see if you have missing baseline population issues, wrong species, or widespread genotyping errors. Ideally most fish should have z_scores within +/- 2, if not, then you likely have some fish that are not assigning well to any specific population in your baseline. Here's some template code from digging into Liz's Yukon 2024 inseason run 1 genotyping error issue. Note that this basic code assumes just 1 mixture.

ind_assign %>% dplyr::group_by(indiv) %>% dplyr::slice_max(z_score, n = 1) %>% ggplot2::ggplot(ggplot2::aes(x = z_score)) + ggplot2::geom_histogram() + ggplot2::theme_bw()

image Liz's Yukon inseason run 1 2024 genotyping error (bad assay map!)

image A more typical distribution, centered on 0