Last updated: 2026-03-26

Checks: 7 0

Knit directory: ~/Documents/GitHub/PAINT/

This reproducible R Markdown analysis was created with workflowr (version 1.7.2). 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(20251106) 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 d270176. 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:    .RData
    Ignored:    .Rhistory
    Ignored:    .Rproj.user/
    Ignored:    analysis/.Rhistory
    Ignored:    analysis/.Rproj.user/
    Ignored:    data/modern_metadata.csv
    Ignored:    data/neo_uvi.csv
    Ignored:    data/pigmentation_snps.csv
    Ignored:    data/simons_metadata.csv
    Ignored:    data/simons_whole.csv

Unstaged changes:
    Modified:   analysis/index.Rmd

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/depth.Rmd) and HTML (docs/depth.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
html 2d31b45 Lily Heald 2026-03-26 Build site.
Rmd 05c4750 Lily Heald 2026-03-26 stack snp distribution
html 05c4750 Lily Heald 2026-03-26 stack snp distribution

Sequencing coverage

Sequencing read alignments were processed using samtools. The input BAM file was first indexed, then coordinate-sorted and re-indexed to ensure compatibility with downstream analyses. Read depth was calculated for archaic samples at the specified pigmentation-related SNP panel using samtools depth including sites with zero coverage.

Version Author Date
05c4750 Lily Heald 2026-03-26

Version Author Date
05c4750 Lily Heald 2026-03-26

Missingness

In order to examine patterns of missingness, I created a heatmap of where sequencing depth = 0.

depth_all <- depth_all %>%
  mutate(
    Position = as.factor(Position),
    Depth = as.numeric(Depth),
    Position_bin = round(Position / 500000),
    Depth_NA = ifelse(Depth > 0, log(Depth), NA)  # avoid -Inf
  )
Warning: There was 1 warning in `mutate()`.
ℹ In argument: `Position_bin = round(Position/5e+05)`.
Caused by warning in `Ops.factor()`:
! '/' not meaningful for factors
ggplot(depth_all, aes(x = Position, y = Sample)) +
  geom_raster(aes(fill = Depth_NA)) +
  scale_fill_gradientn(
    colors = wes_palette("Zissou1", 100, type = "continuous"),
    na.value = "grey70",
    name = "log(Depth)"
  ) +
  theme_minimal(base_family = "lato") +
  theme(
    axis.text.x = element_blank(),
    axis.text.y = element_text(size = 8),
    panel.spacing = unit(0.5, "lines")
  ) 

Version Author Date
05c4750 Lily Heald 2026-03-26

Manhattan style plot

depth_all <- depth_all %>%
  mutate(
    Position = as.numeric(as.character(Position)),
    Depth = as.numeric(as.character(Depth))
  )

depth_all <- depth_all %>%
  arrange(Chromosome, Position) %>%
  group_by(Chromosome) %>%
  mutate(chr_len = max(Position, na.rm = TRUE)) %>%
  ungroup() %>%
  mutate(
    chr_offset = cumsum(lag(chr_len, default = 0)),
    Position_cum = Position + chr_offset,
    Depth_log = ifelse(Depth > 0, log10(Depth), NA)
  )

ggplot(depth_all, aes(x = Position_cum, y = Depth_log, color = Chromosome)) +
  geom_point(size = 0.8, alpha = 0.8) +
  scale_color_manual(
    values = rep(wes_palette("Zissou1", 5), length.out = length(unique(depth_all$Chromosome)))
  ) +
  theme_minimal(base_family = "lato") +
  labs(
    x = "Genomic Position",
    y = "log10(Depth)",
    color = "Chromosome"
  )
Warning: Removed 1329 rows containing missing values or values outside the scale range
(`geom_point()`).

Version Author Date
05c4750 Lily Heald 2026-03-26
ggplot(depth_all, aes(x = Position_cum, y = Depth_log, color = Chromosome)) +
  geom_point(size = 0.6) +
  facet_wrap(~ Sample, ncol = 3) +
  scale_color_manual(
    values = rep(wes_palette("Zissou1", 5), length.out = length(unique(depth_all$Chromosome)))
  ) +
  theme_minimal(base_family = "lato") +
  theme(
    legend.position = "none",
    strip.text = element_text(face = "bold")
  ) +
  labs(
    x = "Genomic Position",
    y = "log10(Depth)"
  )
Warning: Removed 1329 rows containing missing values or values outside the scale range
(`geom_point()`).

Version Author Date
05c4750 Lily Heald 2026-03-26

sessionInfo()
R version 4.4.2 (2024-10-31)
Platform: aarch64-apple-darwin20
Running under: macOS 26.3.1

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] wesanderson_0.3.7 showtext_0.9-7    showtextdb_3.0    sysfonts_0.8.9   
 [5] lubridate_1.9.4   forcats_1.0.1     stringr_1.6.0     dplyr_1.2.0      
 [9] purrr_1.2.1       readr_2.1.6       tidyr_1.3.2       tibble_3.3.1     
[13] tidyverse_2.0.0   ggplot2_4.0.2     workflowr_1.7.2  

loaded via a namespace (and not attached):
 [1] sass_0.4.10        generics_0.1.4     stringi_1.8.7      hms_1.1.4         
 [5] digest_0.6.39      magrittr_2.0.4     timechange_0.4.0   evaluate_1.0.5    
 [9] grid_4.4.2         RColorBrewer_1.1-3 fastmap_1.2.0      rprojroot_2.1.1   
[13] jsonlite_2.0.0     processx_3.8.6     whisker_0.4.1      ps_1.9.1          
[17] promises_1.5.0     httr_1.4.7         scales_1.4.0       jquerylib_0.1.4   
[21] cli_3.6.5          rlang_1.1.7        withr_3.0.2        cachem_1.1.0      
[25] yaml_2.3.12        otel_0.2.0         tools_4.4.2        tzdb_0.5.0        
[29] httpuv_1.6.16      curl_7.0.0         vctrs_0.7.1        R6_2.6.1          
[33] lifecycle_1.0.5    git2r_0.36.2       fs_1.6.6           pkgconfig_2.0.3   
[37] callr_3.7.6        pillar_1.11.1      bslib_0.10.0       later_1.4.5       
[41] gtable_0.3.6       glue_1.8.0         Rcpp_1.1.1         xfun_0.56         
[45] tidyselect_1.2.1   rstudioapi_0.18.0  knitr_1.51         farver_2.1.2      
[49] htmltools_0.5.9    labeling_0.4.3     rmarkdown_2.30     compiler_4.4.2    
[53] getPass_0.2-4      S7_0.2.1