A field guide to population genetics

Computational population genetics, clearly explained

Posts on genetic data, ancient DNA, and the methods used to study ancestry and human history.

Latest Posts

Latest post

Convert 23andMe, AncestryDNA, MyHeritage & FTDNA Raw DNA to PLINK (BED/BIM/FAM)

To convert raw DNA data from 23andMe, AncestryDNA, MyHeritage, or FamilyTreeDNA (FTDNA) to PLINK binary format (.bed, .bim, .fam), you will have to first convert the raw file to 23andMe format. You can then convert it with PLINK 1.9 using --23file. Converting Raw DNA to 23andMe Format with AWK Windows users can use WSL to access awk; see How to Download the AADR Dataset (Linux & WSL). If your DNA file is already in 23andMe format, skip this section. ...

August 19, 2026

Genetic Traits of Loschbour: Appearance, Height, Blood Type, and More

I was inferring genetic traits of ancient individuals, among them the “Cheddar Man”, whose pigmentation phenotype I thought was well established from his genotype. However, most of the 58 trait markers I was checking for could not be called reliably (with MAPQ ≥30 and base quality ≥30). Most markers had no reads at all, several others were supported by only a single read. This included markers like HERC2/OCA2 rs12913832 for eye colour, likewise SLC24A5 and SLC45A2 used to infer skin pigmentation. ...

August 18, 2026

F4Mix: Sample-Wise Ancestry Fitting with f4 Statistics

Last week I published F4Mix, a tool for fitting modern and ancient DNA samples against a pool of source populations, usually ancient ones. F4Mix estimates, for each target, the non-negative mixture of reference populations whose covariance-aware f4 profile best matches it. This makes it useful for testing every sample against the same sources. With a proper setup, the tool gives meaningful results, and can reveal both substructure and clear outliers within a site. ...

August 15, 2026

Testing for Admixture with f3-Statistics in AdmixPy

f3-statistics are used to test if populations are admixed or to measure shared genetic drift between two populations relative to an outgroup. This post explains the theory behind admixture f3-statistics and shows how to run admixture f3 tests with AdmixPy. If you want to skip the theoretical part, you can jump to Running admixture f3-statistics in AdmixPy. What is an f3-statistic? For three populations, the statistic is written as: f3(A;B,C)=Ei[(pA,i−pB,i)(pA,i−pC,i)] f_3(A;B,C)=\mathbb{E}_i\left[(p_{A,i}-p_{B,i})(p_{A,i}-p_{C,i})\right] f3​(A;B,C)=Ei​[(pA,i​−pB,i​)(pA,i​−pC,i​)]Here, AAA is in the target position. Populations BBB and CCC are the reference populations. The values pA,ip_{A,i}pA,i​, pB,ip_{B,i}pB,i​, and pC,ip_{C,i}pC,i​ are the allele frequencies in populations AAA, BBB, and CCC, respectively, at SNP iii. The expectation is an average across SNPs. ...

August 7, 2026

Are Higher qpAdm P-Values Better?

Yes. For two qpAdm models with the same target, the same right groups, and the same settings, the model with the higher p-value is the better statistical fit. qpAdm calculates a covariance-weighted discrepancy between the observed and fitted f4-statistics. The p-value reflects how well the model explains the used f4-statistics. A higher p-value means the discrepancy between the observed and fitted values is less unusual under the model. This does not mean that the model with the highest p-value for a target is automatically the best one, because qpAdm results depend on the selected right groups. Uninformative right-groups can lack the power to detect a bad model, while overly restrictive ones can make a plausible model appear to fit badly. Therefore, p-values are more comparable when models for the same target are compared using the same groups and settings. Models with different numbers of sources are also comparable since p-values account for different degrees of freedom. Z-scores can be used to assess whether an additional source is justified. ...

July 30, 2026

Why the Best PCA Fit May Still Be the Wrong Admixture Model

A Vahaduo generated PCA model for Sardinians gives: 82.8% Barcin Neolithic 11.6% Loschbour 5.6% Yamnaya Distance: 3.4303% Ganj Dareh was included in the sources but gets a weight of zero. This seems to imply that Sardinians don’t have any eastern-Farmer related ancestry. When Sardinians are modelled with qpAdm using Barcin Neolithic, Loschbour, Yamnaya, and Ganj Dareh, the model fits well: 68.6% Barcin Neolithic 11.9% Loschbour 10.2% Yamnaya 9.4% Ganj Dareh Neolithic p = 0.769 When Ganj Dareh is dropped, the model fails (p=1.18×10−12p = 1.18 \times 10^{-12}p=1.18×10−12). ...

July 22, 2026