Why Use Principal Components for Genotype Data?
A genotype data set can contain many variants measured on many individuals. Even when each genotype is recorded simply as an allele dosage, the variants may vary together across individuals. Principal component analysis (PCA) summarizes this multivariate variation with a smaller set of axes. In population-structure work, those axes can reveal major patterns in the analyzed genotype data, but they do not, by themselves, identify a unique biological cause for a pattern.
The central calculation is an SVD of a centered genotype matrix. The SVD separates the matrix into directions describing patterns across individuals and directions describing patterns across variants. Its singular values quantify how much variation lies along the corresponding axes. The connections are exact: the right singular vectors are eigenvectors of the variant covariance matrix, and multiplying the centered matrix by a right singular vector gives the individual scores on that component.
Here the analysis concerns centering only: each variant is shifted by its sample mean. The choice of whether and how to scale variants is a separate preprocessing decision. Write the compact SVD of \(X\) as \(X=UDV^\mathsf{T}\), where \(r=\operatorname{rank}(X)\), the columns of \(U\) and \(V\) are orthonormal, and \(D\) is diagonal with positive singular values \(d_1\ge d_2\ge\cdots\ge d_r>0\). The columns of \(U\) describe directions across individuals; the columns of \(V\) describe directions across variants.
Why the SVD Gives Principal Components
The sample covariance matrix among variants is \(S=X^\mathsf{T}X/(n-1)\). For any unit-length vector \(a\) of variant weights, the \(n\) values in \(Xa\) are the individuals' scores along that direction. Since \(X\) is centered, their sample variance is \(a^\mathsf{T}Sa\). PCA chooses a direction that maximizes this variance, then chooses further directions that maximize variance subject to being orthogonal to the directions already chosen.
The SVD gives the covariance matrix directly:
Because \(U^\mathsf{T}U\) is the identity matrix, this expression shows that \(v_k\) is an eigenvector of \(S\) with eigenvalue \(d_k^2/(n-1)\). It also shows that the sample variance of the scores \(t_k=Xv_k\) is \(d_k^2/(n-1)\). The scores for distinct components are uncorrelated in this sample because \(T=XV=UD\) has \(T^\mathsf{T}T=D^2\), a diagonal matrix.
The variance-maximization result follows from the eigenvalue decomposition. Express any unit vector \(a\) as \(a=\sum_{k=1}^{r}c_kv_k+a_0\), where \(a_0\) is in the null space of \(S\) and \(\sum_k c_k^2+\|a_0\|^2=1\). Then
Equality is achieved by \(a=v_1\). After restricting to directions orthogonal to \(v_1\), the same argument gives \(v_2\) as a direction of greatest remaining variance, and continues for later components. Centering also implies \(\operatorname{rank}(X)\le \min(p,n-1)\): the \(n\) rows of \(X\) lie in the \((n-1)\)-dimensional subspace whose entries sum to zero. Thus a centered data set cannot have more than \(n-1\) nonzero components.
Worked Example: Identical Genotype Patterns at Two Variants
Consider four hypothetical individuals genotyped at two variants. At both variants, their allele dosages are \(0,0,2,2\). Find the centered matrix, its nonzero SVD, component scores, and covariance eigenvalues.
The mean dosage at each variant is \((0+0+2+2)/4=1\). Subtracting this mean from each entry gives
The columns are identical, so \(X\) has rank one. A unit right singular vector is \(v_1=(1/\sqrt{2},1/\sqrt{2})^\mathsf{T}\). Multiplication gives
Normalizing this score vector gives \(u_1=(-1/2,-1/2,1/2,1/2)^\mathsf{T}\), so \(d_1u_1=Xv_1\). The rank-one reconstruction is exactly \(d_1u_1v_1^\mathsf{T}=X\). The variant covariance matrix is
Its eigenvalues are \(d_1^2/3=8/3\approx2.667\) and \(0\). The nonzero component explains all the variation in this matrix: the two variants have exactly the same centered pattern, so there is no second independent direction.
Reading Scores, Loadings, and Explained Variance
A score tells where an individual lies along a component axis. A loading describes the variant weights defining that axis. For a fixed component, the score for individual \(i\) is \(\sum_{j=1}^{p}X_{ij}v_{jk}\). Scores are centered across individuals, and their sample variance is the component's covariance eigenvalue. A positive or negative score is a position relative to the sample mean on that axis, not an amount of ancestry or a direct biological measurement.
The proportion of total variance explained by component \(k\) is its score variance divided by the sum of score variances. Since the common denominator \(n-1\) cancels, this is the squared singular value divided by the sum of all squared singular values. It measures the share of variation in the centered matrix represented by that component. It does not measure the fraction of an individual's genome explained.
Worked Example: Two Orthogonal Genotype Patterns
For four hypothetical individuals, suppose the uncentered dosages at two variants are as follows. The first variant has dosages \(0,0,2,2\), and the second has dosages \(0,1,0,1\), in the displayed individual order.
| Individual | Variant 1 dosage | Variant 2 dosage |
|---|---|---|
| A | 0 | 0 |
| B | 0 | 1 |
| C | 2 | 0 |
| D | 2 | 1 |
The variant means are \(1\) and \(0.5\). Therefore,
The columns have squared lengths \(4\) and \(1\), and their inner product is \(0\). Thus \(X^\mathsf{T}X=\begin{bmatrix}4&0\\0&1\end{bmatrix}\), so the right singular vectors are the two coordinate vectors and the singular values are \(d_1=2\) and \(d_2=1\). The score vectors are the columns of \(X\). With \(n-1=3\), the component variances are \(4/3\) and \(1/3\). The first component explains \(4/(4+1)=0.80\), or 80%, of the total centered variation; the second explains 20%.
This result is a statement about these two dosage patterns in this sample: the first column has four times the squared length of the second and is orthogonal to it. It does not say that the first variant is biologically four times as important. The PCA calculation summarizes covariance in the matrix supplied to it.
Worked Example: What a One-Component Approximation Retains
Use the preceding centered matrix and retain only its first component. The rank-one approximation is \(X_1=d_1u_1v_1^\mathsf{T}\). Here \(v_1=(1,0)^\mathsf{T}\), \(d_1=2\), and \(u_1=(-1/2,-1/2,1/2,1/2)^\mathsf{T}\). Hence
The sum of squared entries of \(X\) is \(4+1=5\), while the sum of squared entries of the residual \(X-X_1\) is \(1\). Thus retaining the first component preserves \(4/5=80\%\) of the squared variation and leaves \(1/5=20\%\) unrepresented. This matches the explained-variance calculation. A low-rank approximation is a compact representation of the matrix, not a claim that the omitted variation is measurement error or biologically irrelevant.
What Leading Components Summarize
The leading components are the directions that account for the largest amounts of sample variation in the centered genotype matrix. When genotype frequencies differ across groups or vary along a gradient, many variants can contribute to a shared pattern across individuals. A component can summarize that broad pattern with one score per individual and one loading per variant. The covariance-based derivation explains why this works: a direction with large score variance corresponds to a large eigenvalue of the variant covariance matrix.
A component is always relative to the individuals, variants, and matrix preparation used in the analysis. Changing the sampled individuals or the included variants can change the estimated axes. Also, a component captures variation, not its cause. Population structure is one possible source of a pattern; relatedness, technical effects, and other sources of variation can also contribute. Accordingly, a leading component should be described as an axis of variation in the analyzed genotypes unless additional evidence supports a more specific interpretation.
The signs of a component are arbitrary: replacing \(v_k\) and \(u_k\) by \(-v_k\) and \(-u_k\) leaves \(d_ku_kv_k^\mathsf{T}\), the reconstruction, and the explained variance unchanged. If two singular values are equal, their component directions are not individually unique: different orthonormal directions within the tied subspace represent the same covariance information. These properties matter when comparing component coordinates across calculations.
Common Mistakes
- Confusing a singular value with a score. The singular value \(d_k\) is a nonnegative scalar; the score vector is \(d_ku_k=Xv_k\), containing one score for each individual.
- Using \(d_k\) rather than \(d_k^2\) for variance. The covariance eigenvalue is \(d_k^2/(n-1)\), not \(d_k/(n-1)\). The explained-variance proportion uses squared singular values.
- Interpreting a component as a cause. A component is a mathematical summary of variation in the analyzed matrix. It does not, by itself, establish ancestry, selection, or any other causal explanation.
- Treating the component sign as meaningful by itself. Reversing all scores and loadings for a component gives an equivalent solution; comparisons must account for this sign ambiguity.
Check Your Understanding
Try these questions using the definitions and results above.
- For a centered genotype matrix with \(n\) individuals, what is the sample covariance eigenvalue associated with singular value \(d_k\)?
- Why does a centered matrix with \(n\) rows have rank at most \(n-1\)?
- If the squared singular values are 9, 4, and 3, what proportion of total variation does the first component explain?
- What is unchanged if the signs of both \(u_k\) and \(v_k\) are reversed?
- Why does a component that explains a large share of genotype variation not, on its own, prove a particular biological cause?