PCA QC for GWAS: Outlier & Stratification Detection Guide
TL;DR — A Defensible PCA QC Recipe
Run PCA on LD-pruned autosomal SNPs while masking long-range LD regions; remove or adjust for close relatives before fitting; select PCs with the Tracy–Widom test (avoid a fixed "top 10"); flag outliers by distance in PC space; and project new batches onto the fixed axes to keep covariates consistent across waves. This reduces stratification artifacts and stabilizes covariates for downstream GWAS analysis.
Why PCA QC Is Non-Optional
Even modest ancestry shifts or plate effects can inflate test statistics, trigger false positives, or hide real associations. Principal components analysis (PCA) is the standard for detecting and correcting stratification in genome-wide studies. Treat it as a quantitative control step, not just a pretty plot.
Risks when PCA QC is skipped or superficial:
- Batch masquerading as biology. Top PCs dominated by capture kit, center, or plate layout indicate missing QC.
- Cryptic relatedness. Unremoved relatives form artificial clusters that look like population structure.
- Over-reliance on barplots. If PCs reflect a single high-LD region rather than genome-wide structure, reviewers will question your model.
The cure is simple: prune, mask, de-relate, test, and project—then carry forward significant PCs as covariates in your Population Structure Analysis and GWAS analysis workflows.
What Robust PCA QC Solves
- Stratification Detection & Control. PCs model genome-wide ancestry gradients; including significant PCs as covariates reduces confounding in both case–control and quantitative trait studies.
- Outlier Triage. Objective distances in PC space separate contamination or sample mix-ups from legitimate ancestry tails, so you remove only what you should.
- Relatedness Artifacts. Robust kinship methods (e.g., KING, PC-Relate) keep family structure from warping the PCA fit.
- Scale Without Distortion. FastPCA and efficient EIGENSOFT implementations make biobank-scale analysis feasible while preserving interpretability.
Where this connects to services: most teams fold PCA outputs directly into our PCA analysis service (projection files + PC covariates) and end-to-end Population Structure Analysis, then carry PCs into GWAS analysis models.
Standards, Tests, and Tools To Cite
- EIGENSTRAT/EIGENSOFT for PCA-based stratification control in GWAS.
- Patterson–Price–Reich eigenanalysis introducing the Tracy–Widom significance test.
- PLINK 1.9 LD pruning (--indep-pairwise) to create an unlinked SNP panel.
- Long-Range LD Masks (GRCh38) to prevent extended LD (e.g., inversions) from hijacking top PCs.
- KINship & Structure: KING (robust under stratification) and PC-Relate (structure-aware kinship).
- FastPCA for large cohorts and rapid projections to new data waves.
These elements—and the exact parameters you record—become your reviewer-ready Methods and your audit trail.
Workflow: Data Prep → PCA Run → Interpretation
Step 1 — Build a Clean, Unlinked Marker Set
- Filter Variants & Samples. Filter autosomal SNPs by call rate and MAF; drop samples with excessive missingness or outlier heterozygosity.
- LD Pruning. Use PLINK to remove correlated variants and retain an approximately independent SNP set (e.g., --indep-pairwise 50 5 0.1). This prevents dense haplotype blocks from dominating PCs.
- Mask Long-Range LD Regions (GRCh38). Extended LD (including inversions) can dominate top PCs and mimic structure; exclude published regions before PCA.
Robust PCA methods improve sensitivity and specificity for flagging sample outliers versus classical PCA, highlighting how robust estimators sharpen QC decisions. (Liu X. et al. (2020) BMC Bioinformatics)
Tip: If you mix array with WES/WGS, harmonize reference/strand and intersect SNPs first; run a preliminary PCA to check that top PCs are not just platform. If they are, revisit harmonization.
Step 2 — Remove or Account for Relatedness
Detect ≥2nd-degree pairs with KING (robust to population structure). Either drop one per pair for the PCA fit or use PC-Relate to get structure-adjusted kinship; then fit PCA on an unrelated subset and project relatives back. This prevents family clusters from pulling PCs off true ancestry axes.
Step 3 — Compute PCA (Fit) and Project (Apply)
Use EIGENSOFT/smartpca or FastPCA for large cohorts. Save eigenvectors (loadings) and eigenvalues, and project new or held-out samples (validation batches, WES/WGS arms) onto the same axes so covariates remain comparable across time and subcohorts.
Scale Choices
- FastPCA for biobank-scale runs.
- smartpca for standard GWAS.
- Projection for all subsequent data waves to keep axes stable.
PC1–PC2 projections across multiple geographic contexts show that some Southeast Asian diversity is insufficiently represented in 1KG, underscoring why projection choices and reference panels matter for stratification control. (Lu D. et al. (2013) Frontiers in Genetics)
Step 4 — Decide the Number of PCs (Not "Always 10")
Use the Tracy–Widom test to determine how many PCs represent genuine structure. Combine TW results with model-fit diagnostics (e.g., genomic inflation after including PCs). Do not hardcode a number across projects; cohorts differ in complexity.
Step 5 — Outlier & Batch Diagnostics
- Flag Outliers by Euclidean or Mahalanobis distance in PC space; examine whether they are sample issues (mix-ups, contamination) or legitimate ancestry tails.
- Interrogate Batch. Plot PCs versus plate/center/capture kit to ensure top PCs track ancestry rather than technical factors. Missing long-range LD masks and incomplete harmonization are frequent culprits.
Disposition Policy
- Replace contaminated or swapped samples and re-run PCA.
- Keep legitimate ancestry outliers, but ensure the GWAS analysis includes the right set of PCs as covariates and, where appropriate, stratifies analyses by ancestry.
Step 6 — Lock Deliverables For GWAS
Package these hand-offs to your association team:
- PC covariates (per sample), projection weights, and a variance explained table.
- Methods text (parameters, masks, kinship policy, software, versioning).
- Figures: PC1–PC2 by ancestry and by batch; outlier table; a projection figure for new batches.
These artifacts reduce back-and-forth during manuscript prep and make pre-registration and SOP reuse simple.
An interactive PCA sample view with linked scree plot streamlines PC selection, outlier review, and the generation of publication-ready figures from the same UI. (Marini F. et al. (2019) BMC Bioinformatics)
Outliers vs Structure: Make the Right Call
True outliers (e.g., contamination, mix-ups) break expected PC patterns and sit far from any cluster; remove and re-run PCA after fixing the root cause. Legitimate structure (e.g., recent admixture or a population isolate) forms coherent tails or clusters consistent with geography or known demography; keep such samples, treat PCs as covariates, and annotate with a complementary method (e.g., global ancestry proportions) only if it aids interpretation. Above all, ensure the PCs you carry into association models are significant (Tracy–Widom) and stable under projection.
If PC1/PC2 are driven by one genomic region, you likely missed a long-range LD mask. Re-mask, re-prune, and re-fit.
Reporting & Reproducibility (Reviewer-Ready Pack)
Methods Boilerplate To Adapt
"We generated an unlinked SNP set using PLINK (--indep-pairwise 50 5 0.1), excluded published GRCh38 long-range LD regions, and removed one individual from each pair of ≥2nd-degree relatives (KING). We computed PCA on the unrelated subset with EIGENSOFT (or FastPCA for scale) and projected remaining samples. We selected significant PCs via Tracy–Widom tests and inspected associations for residual inflation. Software versions, CPU/RAM, and array job settings were recorded."
Figure Checklist
- PC1–PC2 coloured by ancestry.
- PC1–PC2 coloured by plate/center (to reveal batch).
- Variance-explained table.
- Outlier table with objective thresholds.
- Projection plot for a new batch.
Troubleshooting: Quick Diagnosis → Targeted Fix
PCs Track Batch, Not Ancestry
- Signs: top PCs separate by capture kit or center.
- Fix: re-harmonize variant sets, confirm strand/build, mask long-range LD, and re-run; include batch as a downstream covariate only after you've restored ancestry signal.
Relatives Inflate Apparent Clusters
- Signs: family units form distinct clusters even after pruning.
- Fix: identify kin with KING or PC-Relate; fit PCA on unrelateds; project relateds back; decide whether to keep both relatives for GWAS based on study design.
"How Many PCs?" Remains Unclear
- Signs: the scree is shallow and results vary by arbitrary cut-offs.
- Fix: use Tracy–Widom to formalize PC significance; assess inflation while varying PC count; document the rule you used.
PCA Is Too Slow At Cohort Scale
- Signs: wall-time and memory spike with N and SNPs.
- Fix: switch to FastPCA or fit on a carefully downsampled set and project the full cohort; use a cluster with array jobs; cache projection artifacts.
Runtime and accuracy benchmarks show ProPCA scales efficiently on very large cohorts while maintaining PCA fidelity, enabling rapid analysis of biobank-sized data. (Ioannidis A.G. et al. (2020) PLOS Genetics)
FAQ: PCA QC Best Practices
Use the Tracy–Widom test to select significant PCs and complement with model-fit checks (e.g., genomic inflation after adding PCs). Avoid a fixed number across studies; structure varies by cohort, platform, and ancestry mix.
Yes. LD pruning creates an unlinked marker set; long-range LD masks remove extended haplotype regions that can hijack top PCs. Skipping either step raises the chance your PCs reflect technical artifacts rather than ancestry.
Detect ≥2nd-degree pairs using KING or compute structure-aware kinship with PC-Relate. Fit PCA on an unrelated subset and project related individuals afterwards to avoid kinship-driven PCs.
Yes. FastPCA approximates top PCs with far lower time and memory while preserving the core eigenstructure. Pair it with projection for new data waves to keep covariates consistent.
Fit once on a clean reference set, save loadings, and project all subsequent batches. This maintains the axes and prevents drift in covariates across analysis waves.
Conclusion & Next Steps
A defensible PCA QC pipeline—PLINK LD pruning, GRCh38 long-range LD masks, kinship control (KING/PC-Relate), Tracy–Widom PC selection, and projection—gives you clean, reproducible covariates and fewer surprises in association testing. Document parameters, state your selection rule, and ship a reviewer-ready pack (PC covariates, figures, Methods).
Ready to operationalise this across cohorts? Start with a PCA QC plan or engage our Population Structure Analysis and PCA analysis service to deliver projection files and PC covariates that drop straight into your GWAS analysis workflow—complete with compute planning and SOPs for repeatable results.
Related reading:
- What Tools Analyze Population Structure
- ADMIXTURE vs STRUCTURE: Choosing K & Validating Results
- Big-Cohort Compute: Hail, plink2 & bigsnpr Basics
References
- Agrawal, A., Chiu, A.M., Le, M., Halperin, E., Sankararaman, S. Scalable probabilistic PCA for large-scale genetic variation data. PLOS Genetics 16(5), e1008773 (2020).
- Lu, D., Xu, S. Principal component analysis reveals the 1000 Genomes Project does not sufficiently cover the human genetic diversity in Asia. Frontiers in Genetics 4, 127 (2013).
- Chen, X., Zhang, B., Wang, T., Bonni, A., Zhao, G. Robust principal component analysis for accurate outlier sample detection in RNA-Seq data. BMC Bioinformatics 21, 269 (2020).
- Marini, F., Binder, H. pcaExplorer: an R/Bioconductor package for interacting with RNA-seq principal components. BMC Bioinformatics 20, 331 (2019).
- Zhang, L., Zhu, Z., Du, W., Li, S., Liu, C. Genetic structure and forensic feature of 38 X-chromosome InDels in the Henan Han Chinese population. Frontiers in Genetics 12, 805936 (2022).
- Price, A.L., Patterson, N.J., Plenge, R.M., Weinblatt, M.E., Shadick, N.A., Reich, D. Principal components analysis corrects for stratification in genome-wide association studies. Nature Genetics 38, 904–909 (2006).
- Manichaikul, A., Mychaleckyj, J.J., Rich, S.S., Daly, K., Sale, M., Chen, W.-M. Robust relationship inference in genome-wide association studies. Bioinformatics 26, 2867–2873 (2010).