Ancestrify
All stories

qpadm

By Andi Thomaj
3 min read

qpAdm data preparation: from a raw DNA file to an AADR merge that works

The undocumented half of every qpAdm analysis: file formats, genome builds, strand hygiene, convertf and Poseidon, and the merge arithmetic that decides your standard errors before any model runs.

qpadmguideraw-dnamethodology

  1. The target state, and the formats on the way
  2. The three silent killers
  3. The merge itself, and the arithmetic to expect
  4. Or skip it, knowingly
  5. References

Every qpAdm tutorial starts at "given your genotypes in EIGENSTRAT format, merged with the reference panel". Almost nobody documents how you get there — and the getting-there is where real analyses succeed or die, because the merge sets your standard errors before any model runs. This is the missing chapter: formats, builds, strand discipline, the tools that do the work, and the checks that catch the silent failures. It is the pipeline we run in production, written down.

The target state, and the formats on the way#

qpAdm consumes EIGENSTRAT (or its binary sibling PACKEDANCESTRYMAP): a .geno genotype matrix, a .snp file of positions and alleles, a .ind file of individuals with population labels. The AADR ships in exactly this shape. Your own data starts life elsewhere — a consumer text export, a PLINK .bed/.bim/.fam trio, or a VCF — and the pipeline is the sequence of conversions and one merge that ends with your sample as one more row of the panel.

The canonical converters: PLINK itself (consumer text → .ped/.map.bed), and EIGENSOFT's convertf for PLINK ↔ EIGENSTRAT, driven by a small parameter file naming the input/output formats and files. Modern practice increasingly wraps the whole thing in Poseidon's trident, which manages panel packages with their metadata and performs merges (trident forge) with the bookkeeping handled — it is what our own production merge uses, and its package discipline is worth adopting even solo: a genotype file whose provenance you cannot state is a liability, not data.

The three silent killers#

Build mismatch. The AADR's positions are GRCh37/hg19; a consumer file usually is too, but a sequencing VCF is often GRCh38. Merging across builds does not error — it quietly matches almost nothing, or worse, mismatches something. Liftover before anything else, and verify by spot-checking a few known rsIDs' positions afterwards.

Strand flips. Consumer files report genotypes on the strand the chip happened to probe. For an A/G SNP recorded as T/C, naive merging misreads every genotype — and for the truly cursed class, palindromic (A/T and C/G) SNPs, no strand check can rescue them because both strands read the same alphabet. The professional move is the boring one: align alleles against the panel's .snp records, flip where the complement matches, and drop palindromic sites outright — they are a small fraction of the intersection and an outsized fraction of the merge errors.

Sex chromosomes and duplicates. qpAdm runs on autosomes (auto_only is the default for a reason); haploid male X calls, PAR-region weirdness and duplicate rsIDs at one position all belong out of the merge, not in it. Deduplicate by position, not by name — chip annotations recycle names more often than positions.

The merge itself, and the arithmetic to expect#

Intersect-and-merge is the only honest mode: keep exactly the positions present in both your file and the panel, your sample encoded like the panel's own (for comparisons against pseudohaploid ancients, that can mean randomly sampling one allele of yours per site — matching the reference's data class for the same reason capture classes should not be mixed).

Then check three numbers before celebrating. The intersection size: a healthy consumer chip against the AADR's 1240K sites lands in the hundreds of thousands; a number far below your chip's usual range means the pipeline, not the chip. The per-population missingness of the ancients you plan to use — the allsnps decision hangs on it. And a sanity model: run one utterly standard model (a known European target against the textbook sources and rights) and confirm it behaves like the literature says it should. A pipeline that cannot reproduce a boring known result has no business producing interesting new ones.

Or skip it, knowingly#

This pipeline is exactly the unglamorous half of what the paid analysis does before any analyst hours begin: your export or whole-genome VCF converted, aligned, merged into AADR v66 with the discipline above, and the Model Lab will even hand you the finished EIGENSTRAT bundle to run yourself. Doing it solo is genuinely achievable with a weekend and this page — and either way, the free file check is the right first move: it reads your export and reports the marker counts this whole pipeline will live off.

From €29.99 · one-time
The tested version of this question
A qpAdm model composed, run and checked by hand against AADR v66, published with its p-value, every source's standard error and z-score, and the full right set, so the result can be argued with.
See the qpAdm analysis

Terms used here are defined in the glossary.

References#

  • Patterson, N. et al. (2012). Ancient admixture in human history. Genetics, 192(3), 1065–1093. (EIGENSTRAT/convertf lineage.)
  • Mallick, S. et al. (2024). The Allen Ancient DNA Resource (AADR): a curated compendium of ancient human genomes. Scientific Data, 11, 182.
  • Schmid, C. et al. (2024). Poseidon — a framework for archaeogenetic human genotype data management. eLife, 13, e98317.
  • Chang, C. C. et al. (2015). Second-generation PLINK. GigaScience, 4, 7.

Related posts

Learn qpAdm: the complete guide, from zero to defensible models
Learn qpAdm: the complete guide, from zero to defensible models

A structured learning path through everything qpAdm — what to read in what order, from the f4-statistics underneath to running models in R, choosing outgroups, reading results and knowing the method's measured limits.

3 min read
qpAdm best practices: the current checklist, with the numbers behind every rule
qpAdm best practices: the current checklist, with the numbers behind every rule

The definitive working checklist for qpAdm in 2026 — temporal stratification, right-set construction, lowest-rank-first search, composite feasibility and reporting standards — each rule carrying its measured justification from the 2021–2025 audit literature.

4 min read
Classic ADMIXTOOLS vs ADMIXTOOLS 2: why your qpAdm numbers differ, and how to match them
Classic ADMIXTOOLS vs ADMIXTOOLS 2: why your qpAdm numbers differ, and how to match them

Same model, different p-value: the real differences between original qpAdm and ADMIXTOOLS 2 — allsnps semantics, fudge_twice, f2 precomputation — and the settings that reproduce classic behaviour when you need to.

3 min read
Back to all stories
Ancestrify

Combining cutting-edge genomic science with rich historical records to map your ancestry across generations and continents.


© 2026 Ancestrify. All rights reserved. · Ancestrify is a trading name of Andi Thomaj, a sole trader registered in Tiranë, Albania · NUIS M61725001N
Card payments processed by POK Payments (RPay Ltd)VISAMASTERCARD