PLINK
Summary¶
PLINK is an open-source C/C++ toolset designed for whole-genome association (WGA) and population-based linkage analyses. It is widely considered a foundational tool in statistical genetics and bioinformatics, enabling researchers to perform large-scale data manipulation, quality control, association analysis, and population structure estimation. The second-generation codebases (PLINK 1.9 and PLINK 2.0) are highly optimized for speed and memory efficiency, utilizing bit-parallel representation and operations to process millions of variants and individuals.
Core Functionality¶
PLINK provides a vast array of utilities, grouped into several primary domains:
1. Data Management: Importing, recoding, filtering, merging, and transposing genomic data files. It supports standard text formats (.ped/.map) and binary formats (.bed/.bim/.fam).
2. Quality Control (QC): Filtering samples and markers based on:
- Minor Allele Frequency (MAF)
- Genotyping call rates per individual and per marker
- Hardy-Weinberg Equilibrium (HWE) deviations
- Sex discrepancies (using X-chromosome heterozygosity)
3. Association Analysis: Performing linear and logistic regression models for quantitative and binary traits, respectively, as well as family-based association tests and Cochran-Armitage trend tests.
4. Linkage Disequilibrium (LD): Estimating pairwise LD ((r^2) and (D')) and performing LD-based clumping to identify lead variants.
5. Population Stratification: Calculating Identity-by-State (IBS) and Identity-by-Descent (IBD) matrices, and performing Multidimensional Scaling (MDS) or Principal Component Analysis (PCA) to adjust for population structure in association analyses.
Technical Optimizations (PLINK 1.9/2.0)¶
As dataset sizes grew exponentially, PLINK was rewritten as PLINK 1.9 and 2.0 to achieve 100-fold to 1000-fold speedups. The primary performance drivers include:
- Bit-Parallel Genotype Representation: Genotype data is stored compactly using 2 bits per genotype within .bed (PLINK 1) or .pgen (PLINK 2) files:
- 00: Homozygous for the first allele
- 01: Missing genotype
- 10: Heterozygous
- 11: Homozygous for the second allele
- Bit-Level Operations: Computations (e.g., allele counting, Hardy-Weinberg tests) are performed using bitwise logical operations (AND, OR, XOR, shifts) on 64-bit machine words, allowing up to 32 genotypes to be processed in parallel inside a single CPU cycle.
- Lookup Tables: Arithmetic operations in inner loops are bypassed by mapping bit-packed genotype blocks to precomputed arrays of partial sums, replacing floating-point math with fast memory lookups.
See Also¶
Citations¶
[1] Purcell et al. (2007), \"PLINK: a tool set for whole-genome association and population-based linkage analyses\", American Journal of Human Genetics, 81(3), 559-575. [2] Chang et al. (2015), \"Second-generation PLINK: rising to the challenge of larger and richer datasets\", GigaScience, 4(1), s13742-015-0047-8.