Precourse

Author

Per Unneberg

Suggested readings

The first sessions consist of lectures that aim to introduce concepts and theory from population genetics

Population genomics in practice provides a quick overview of population genomics. Although not required, it is recommended to briefly go through the following papers that will be discussed in the lecture:

  • Fuller et al. (2020) (most important)
  • Johri et al. (2022)

Population genetics introduces the foundations of population genetics. This lecture contains a lot of material and we strongly recommend you review the slides to be fully prepared for the lecture. See notes on usage for instructions how to view slides.

UPPMAX account

You will need an uppmax account to run some of the exercises. You can apply for an account here.

Tutorials

Look at https://www.uppmax.uu.se/support/user-guides/, in particular https://www.uppmax.uu.se/support/user-guides/guide--first-login-to-uppmax/ for information on how to connect to and work on uppmax.

Software installation

Although we will mainly work on UPPMAX, some exercises, notably the ones that utilise Jupyter notebooks benefit from working in a local compute environment on your computer. We will use the conda package manager to install necessary requirements from the package repositories bioconda and conda-forge.

1. Install conda

To start using conda, follow the quick command line install instructions to install the minimal conda installer miniconda.

2. Configure conda

Configure conda to access the package repositories (see also bioconda usage). This will modify your ~/.condarc file:

conda config --add channels defaults
conda config --add channels bioconda
conda config --add channels conda-forge
conda config --set channel_priority strict
Important

Please note that the order of these commands is important! When conda config --add is run it adds the channel to the top of the list in your configuration, so your ~/.condarc will end up looking like this:

cat ~/.condarc
channels:
  - conda-forge
  - bioconda
  - defaults
channel_priority: strict

3. Create an isolated course environment

It is suggested you create and change to a isolated environment pgip dedicated to the course. The command below will create an environment named pgip and install the packages python version 3.10, an R base installation (r-base), the jupyter package that provides support for Jupyter Notebooks, and the mamba package manager.

conda create -n pgip python=3.10 r-base mamba jupyter
conda activate pgip

The activate command is required to access the isolated environment named pgip. Once you have activated the environment, you gain access to whatever programs are installed. To deactivate an environment you issue the command conda deactivate.

4. Install packages

Installation of packages is done with the install command, but we recommend you use the mamba package manager as it is faster (mamba is a rewrite of conda in C++). An example of how to install packages bcftools, angsd, mosdepth follows (remember to activate pgip!):

03-Nov-2023: Package errors

Some users have reported errors in that bcftools and angsd cannot be found, despite setting the proper channels. We are looking into the issue, but unless there are issues with UPPMAX, we will not need to install any additional packages apart from those that went into the creation of the pgip environment above. You can therefore treat the code below as examples only.

#| eval: false
conda activate pgip
mamba install bcftools angsd mosdepth

or if you have packages listed in an environment file

#| label: conda-install-packages-from-environment-file
#| echo: true
#| eval: false
mamba env update -f environment.yml

Resources

Literature

Lecture notes have been prepared based on the literature listed below.

Online

Graham Coop’s notes on population genetics
Comprehensive introduction to population genetics. Contains many biological examples and code snippets. (Graham Coop, 2020).
Joachim Hermisson’s notes on mathematical population genetics
Introduction to mathematical population genetics (Hermisson, 2017, 2018).

Books

Population Genetics: A Concise Guide
John Gillespie’s short but excellent introduction to population genetics (Gillespie, 2004).
Molecular Population Genetics
A more recent introduction to population genetics with more focus on the analyses of sequencing data (Hahn, 2019).
Molecular Evolution and Phylogenetics
Over view of molecular evolution and population genetics, and also phylogenetics (Nei & Kumar, 2000).
Mathematical Population Genetics I
A great reference when it comes to the mathematical treatment of population genetics (Ewens, 2004).
Principles of Population Genetics
A comprehensive textbook covering most topics of population genetics (Hartl & Clark, 1997).
Elements of Evolutionary Genetics
Introduction to evolutionary genetics (Charlesworth & Charlesworth, 2010).
Evolution
Great comprehensive textbook covering evolution (Barton et al., 2007).
Coalescent Theory: An Introduction
A great introduction to coalescent theory (Wakeley, 2008).
Gene Genealogies, Variation and Evolution: A Primer in Coalescent Theory
Alternative introduction to coalescent with more focus on the Wright-Fisher model (Hein et al., 2005).


References

Barton, N. H., Briggs, D. E. G., Eisen, J. A., Goldstein, D. B., & Patel, N. H. (2007). Evolution. Cold Spring Harbor Laboratory Press.
Charlesworth, B., & Charlesworth, D. (2010). Elements of Evolutionary Genetics. Roberts and Company Publishers.
Ewens, W. J. (2004). Mathematical Population Genetics (S. S. Antman, J. E. Marsden, L. Sirovich, & S. Wiggins, Eds.; Vol. 27). Springer. https://doi.org/10.1007/978-0-387-21822-9
Fuller, Z. L., Mocellin, V. J. L., Morris, L. A., Cantin, N., Shepherd, J., Sarre, L., Peng, J., Liao, Y., Pickrell, J., Andolfatto, P., Matz, M., Bay, L. K., & Przeworski, M. (2020). Population genetics of the coral Acropora millepora: Toward genomic prediction of bleaching. Science, 369(6501), eaba4674. https://doi.org/10.1126/science.aba4674
Gillespie, J. H. (2004). Population Genetics: A Concise Guide (2nd edition). Johns Hopkins University Press.
Graham Coop. (2020). Notes on Population Genetics. https://github.com/cooplab/popgen-notes
Hahn, M. (2019). Molecular Population Genetics (First). Oxford University Press.
Hartl, D. L., & Clark, A. G. (1997). Principles of population genetics. Sinauer Associates.
Hein, J., Schierup, M. H., & Wiuf, C. (2005). Gene genealogies, variation and evolution: A primer in coalescent theory. Oxford University Press. https://books.google.se/books?id=CCmLNAEACAAJ
Hermisson, J. (2017). Mathematical population genetics. https://www.mabs.at/fileadmin/user_upload/p_mabs/Lecture_Notes_2017
Hermisson, J. (2018). Mathematical population genetics II. https://www.mabs.at/fileadmin/user_upload/p_mabs/Lecture_Notes_2018
Johri, P., Aquadro, C. F., Beaumont, M., Charlesworth, B., Excoffier, L., Eyre-Walker, A., Keightley, P. D., Lynch, M., McVean, G., Payseur, B. A., Pfeifer, S. P., Stephan, W., & Jensen, J. D. (2022). Recommendations for improving statistical inference in population genomics. PLOS Biology, 20(5), e3001669. https://doi.org/10.1371/journal.pbio.3001669
Nei, M., & Kumar, S. (2000). Molecular Evolution and Phylogenetics. Oxford University Press.
Wakeley, J. (2008). Coalescent Theory: An Introduction (1st Edition edition). Roberts and Company Publishers.