Computational Population Genomics and Inference in R
Learning the fundamentals of population genomics through computer simulations
Introduction
This workbook contains materials for a work-in-progress course on the fundamentals of data science, computational population genomics and inference, with a strong focus on good practices of reproducible research and programming in R.
The general structure of the final book (expected to be developed over the course of 2025-2026) will take the form of a series of worksheets with exercises on varrious interlinked topics from computational population genetics. The primary goal is for students to walk through these worksheets in the classroom under the interactive guidance of a teacher, but each chapter is also suitable for self-study and designed to serve as a reference during practical research work.
The git repository containing the sources of all materials for the entire course (text of the worksheets, coding exercises and their solutions) is available on GitHub at github.com/bodkan/simgen.
The primary intended audience for this material are novice researchers who have just started (or are about to start) their careers in computational population genomics and evolutionary genomics, primarily master students or doctoral students in the early parts of their research journey. However, some of the materials have also been used in training workshops of researchers who have had a relatively extensive experience with population genomics, but who were not entirely up-to-speed on modern practices in reproducible computational data science or have not had the opportunity to engage with fundamental concepts in population genomics from the ground up.
Planned outline
Status of chapters:
β : Chapter is finished
π§: Chapter under construction left)
β: Chapter still missing
- β
Introduction to R
- β Basic data types and container types
- β Functions and iteration
- β Data manipulation using base R
- β Minimum background on base R visualization
- π§ Reproducible computing
- β What makes for a good project structure
- β Transforming disorganized scripts into pipelines
- β Reproducible reports and presentations with Quarto
- π§ Building interfaces for command-line scripts
- β
tidyverse
- β Filtering, processing, and manipulation of data
- β Group-based operations and summary statistics
- β Reading and saving files
- β Visualization using ggplot2
- π§ Working with spatial data
- π§ sf spatial data format
- π§ Plotting spatial data with sf and ggplot2
- β
Simulations with slendr
- β Introduction to the R package slendr
- β Building demographic models
- β Tree sequences as a storage of genomic information
- π§ Fundamentals of population genetics
- π§ Effective population size \(N_e\)
- π§ Allele frequency spectrum
- π§ Nucleotide diversity \(\pi\), number of segregating sites, \(F_{ST}\), nucleotide divergence
- β Tying it all togetherβgrid-based inference engine of \(N_e\)
- π§ Other useful tools for studying population histories
- π§ PCA
- π§ Identity-by-descent (IBD)
- π§ Ancestry tracts / chromosome painting
- π§ Admixture dating
- π§ Simulating natural selection
- β Basic theory of natural selection
- π§ Simple one-locus simulation
- β Selection tests and summary statistics
- π§ Simulation-based inference with demografr
- π§ Grid-based inference (\(f_4\) and \(f_4\)-ratio) β sourced from demografr
- π§ Grid-based admixture tract dating β based on a slendr tutorial
- π§ Approximate Bayesian Computation (ABC) β sourced from demografr
- π§Workhorses of applied population genetics
- π§ MDS / PCA β extending the PCA chapters part 1 and part 2 to real-world scenarios
- π§ ADMIXTOOLS - \(f\)-statistics, qpAdm β extending the \(f\)-statistics chapter to other real-world scenarios
- β ADMIXTURE / STRUCTURE β focusing on the non-identifiability problem
- β IBD
- β Selection scans and summary statistics
All content is available under the CC BY-SA 4.0 license.
