flowchart LR
A["Ancestry"] --> G["Allele frequency"]
A --> E["Environment,<br/>other genes"]
E --> Y["Trait"]
G -. "spurious<br/>association" .-> Y
style A fill:transparent,stroke:#adb5bd
10 Relatedness and population structure
Association tests assume that people are independent, and real cohorts break that assumption in two ways: relatives share long stretches of DNA, and people of similar ancestry share allele frequencies. Measure both before you test anything. Then either remove relatives or model them, and adjust for ancestry with principal components.
10.1 Why independence matters
Both problems create the same symptom: test statistics that are too large across the genome. Relatedness correlates the residuals of the model, so the same genetic signal is counted more than once. Population structure is confounding: ancestry affects both allele frequencies and, through environment or genetics, the trait.
A classic example. Group A has allele frequency 0.70 and a higher disease prevalence; group B has frequency 0.30 and a lower prevalence. Pool them and test, and every variant that differs in frequency between A and B looks associated with the disease. This is population stratification. The variant is a marker of group membership, not a cause.
10.2 LD pruning first
Kinship, PCA, and heterozygosity all need a set of roughly independent variants. Linkage disequilibrium (LD) is the correlation between nearby variants (Chapter 2). Without pruning, a region with strong LD counts many times, and PCA can pick it up as a “population” axis.
LD pruning walks along the genome in windows and removes one variant from each pair whose \(r^2\) exceeds a threshold:
plink2 --bfile qc/clean --chr 1-22 --maf 0.05 \
--exclude range high_ld_regions_b37.txt \
--indep-pairwise 200 50 0.2 --out qc/prune
# window of 200 variants, step 50, remove one of each pair with r2 > 0.2
plink2 --bfile qc/clean --extract qc/prune.prune.in --make-bed --out qc/prunedAlso exclude the known long-range LD regions, such as the MHC on chromosome 6 and inversions on chromosomes 8 and 17 (listed by Price et al., 2008, American Journal of Human Genetics). A pruned set of 50,000 to 200,000 variants is plenty.
Pruning is for structure and relatedness only. Never run the association test on the pruned set; you would throw away the variants you want to test.
10.4 Remove or model relatives
You have two options, and the choice depends on the model you will use.
| Approach | When | How |
|---|---|---|
| Remove relatives | Ordinary regression (PLINK --glm); small or medium cohorts |
Drop one of each related pair, keeping the most samples |
| Keep and model | Large biobanks; mixed models such as SAIGE, REGENIE, BOLT-LMM | Keep everyone; the GRM or a whole-genome regression absorbs relatedness |
To remove, prefer an algorithm that removes the fewest people rather than dropping pairs one at a time. PLINK 2 does this:
plink2 --bfile qc/pruned --king-cutoff 0.0884 --out qc/unrelated
# writes qc/unrelated.king.cutoff.in.id (keep) and .out.id (removed)When one member of a pair is a case and the other a control, keep the case if cases are scarce. Mixed models are the better answer at biobank scale, where removing relatives costs thousands of samples (Chapter 12).
Compute principal components on unrelated people only, then project the relatives onto those axes. Close relatives in a PCA pull the components toward their family, and a PC that separates one family is useless as an ancestry covariate.
10.5 Principal component analysis
Principal component analysis (PCA) summarizes genome-wide variation in a few axes. Each principal component (PC) is a weighted sum of standardized genotypes. In genetic data, the top PCs track ancestry: in 1000 Genomes, PC1 separates African from non-African samples, and PC2 separates East Asian from European samples.
plink2 --bfile qc/pruned --keep qc/unrelated.king.cutoff.in.id --pca 20 --out qc/pca
# qc/pca.eigenvec: one row per sample, PC1..PC20
# qc/pca.eigenval: variance explained by each PCFor hundreds of thousands of samples, use --pca approx or FlashPCA2. EIGENSOFT smartpca is the reference implementation (Patterson et al., 2006, PLoS Genetics; Price et al., 2006, Nature Genetics).
How many PCs? Plot the eigenvalues (a scree plot) and look for where they flatten. Ten PCs is the common default for a single-ancestry GWAS. Twenty is not unusual for diverse cohorts. The absolute PC values have no meaning on their own; only the relative positions of samples do.
10.6 Ancestry inference with reference panels
To label ancestry, place your samples on axes defined by a reference panel of known origin, such as 1000 Genomes (super-populations AFR, AMR, EAS, EUR, SAS) or the Human Genome Diversity Project. Compute PCs on the reference, then project your samples with the PC loadings (allele weights):
# 1. PCs and allele weights in the reference
plink2 --pfile ref_1kg --freq counts --pca allele-wts vcols=chrom,ref,alt 10 --out ref_pcs
# 2. Project study samples (same variants, same alleles)
plink2 --pfile study --read-freq ref_pcs.acount \
--score ref_pcs.eigenvec.allele 2 5 header-read no-mean-imputation variance-standardize \
--score-col-nums 6-15 --out study_projProjected scores are on a different scale from .eigenvec, so project the reference samples with the same command and compare like with like. Then assign ancestry. Two common ways:
- Distance rule. Keep samples within a few SD of a reference group’s centroid on the top PCs. Marees et al. use this with multidimensional scaling.
- Classifier. Train a random forest on reference PCs and labels, and assign a group when the predicted probability exceeds a cutoff such as 0.8. gnomAD uses this approach. Samples below the cutoff stay “other” or admixed.
Then run the GWAS within each ancestry group and combine with meta-analysis (Chapter 14), or analyze all groups together with PCs and a mixed model.
10.7 Checking that it worked
Adjustment works when the genome-wide test statistics look calibrated. The genomic inflation factor λ and the QQ plot (Chapter 11) are the checks. With PCs and relatedness handled, λ for a modest trait should be close to 1. A residual excess that grows with sample size is usually polygenic signal, not confounding; LD score regression separates the two.
Ancestry adjustment has limits. PCs capture broad structure well, but fine-scale structure and recent admixture leave residual confounding. Mixed models handle both relatedness and subtle structure better, which is part of why they dominate biobank analyses (Chapter 12).
| Problem | Detect with | Adjust with |
|---|---|---|
| Close relatives | KING kinship, PI_HAT | Remove one per pair, or GRM in a mixed model |
| Cryptic distant relatedness | GRM | Mixed model |
| Continental ancestry | PCA, reference projection | Stratify by ancestry; PCs as covariates |
| Fine-scale structure | PCA on one ancestry group | PCs plus mixed model |
Using the 1000 Genomes Affymetrix 6.0 genotypes after the QC in Chapter 9, run --make-king-table and count the pairs in each degree of relatedness. Then compute ten PCs on the unrelated samples and plot PC1 against PC2, colored by super-population. Which super-population is most spread out, and what does that say about its history?