Why Genotype Scaling Changes PCA
In genotype PCA, each column represents a genetic variant and each row an individual. Centering columns removes their average dosage, but it does not make variants equally influential: a column with larger variation can contribute more to the directions PCA finds. Dividing centered dosages by a frequency-based standard deviation changes that balance. For rare variants, this inverse-frequency weighting can make a carrier stand out strongly, so the leading principal components may describe different contrasts under different scaling choices.
The earlier material on centering and scaling genotypes established the basic transformations, and the earlier material on genotype covariance and principal components established how PCA summarizes variation. Here the focus is the consequence of choosing a scale, particularly when allele frequencies are low. The formulas below concern diploid genotypes at biallelic variants. They do not imply that one scaling is universally best.
For \(Z_{ij}\), the counted allele must be the same allele used to calculate \(p_j\). Coding the other allele changes the sign of a centered column but not its variance or its effect on PCA. A variant with \(p_j=0\) or \(p_j=1\) is monomorphic and has zero denominator; it must be removed rather than scaled. The formulas assume complete diploid genotypes for clarity. In applications, missing genotypes require a documented handling rule, and allele frequencies and scaling must be consistent with that rule.
Why the Denominator Depends on Allele Frequency
Under HWE, the two alleles in a diploid genotype are independent Bernoulli draws with probability \(p_j\) of carrying the counted allele. Thus \(G_{ij}\) is the sum of two such draws. Its mean is \(2p_j\), and its variance is the sum of their variances:
Dividing by the square root of this variance gives a centered value with variance one under the model. This is a marginal statement about a genotype at a variant; it does not say that every observed standardized column has sample variance exactly one. Nor does the PCA calculation require HWE as an algebraic condition. HWE supplies the variance used by this particular scaling, while departures from it can make the observed column behave differently from the model-based expectation.
When \(p_j\) is small, \(\sqrt{2p_j(1-p_j)}\) is small. Therefore a fixed dosage difference becomes larger after scaling. Equivalently, in a covariance or squared-distance calculation, a variant's centered contribution is weighted by the inverse of its expected variance, \(1/[2p_j(1-p_j)]\). This is the source of rare-variant amplification.
Worked Example: Comparing Dosage Values at Common and Rare Variants
Consider two hypothetical variants. The counted allele has frequency \(p=0.50\) at the first and \(p=0.05\) at the second. Calculate the standardized dosage for a heterozygote, \(G=1\), at each.
At \(p=0.50\), the denominator is \(\sqrt{2(0.50)(0.50)}=\sqrt{0.50}\approx0.7071\), and the centered dosage is \(1-2(0.50)=0\). Therefore \(Z=0/0.7071=0\).
At \(p=0.05\), the denominator is \(\sqrt{2(0.05)(0.95)}=\sqrt{0.095}\approx0.3082\), and the centered dosage is \(1-2(0.05)=0.90\). Therefore \(Z=0.90/0.3082\approx2.920\). In this scaling, a heterozygote at the rare variant is about 2.92 standardized units above the expected dosage, whereas a heterozygote at the common variant is at its expected dosage.
The large value is not evidence by itself of an error or an unusually large biological effect. It is a consequence of measuring deviation in units of a smaller expected standard deviation. For comparison, at \(p=0.05\), \(G=0\) gives \((-0.10)/0.3082\approx-0.3245\), while \(G=2\) gives \(1.90/0.3082\approx6.165\). The homozygous rare-allele genotype is unusual under this frequency, but the formula still assigns the stated value if it is observed.
How Scaling Alters Distances and Principal Components
PCA is sensitive to distances and covariances among individuals. Centering alone leaves a dosage difference of one as a difference of one, regardless of frequency. After variance standardization, that same difference is divided by the frequency-dependent denominator. Consequently, variants can contribute very differently to the geometry of the sample.
Worked Example: A Rare Variant's Contribution to a Pairwise Distance
Suppose two hypothetical individuals differ by one dosage unit at a common variant with \(p=0.50\), and also by one dosage unit at a rare variant with \(p=0.05\). Compare the squared Euclidean-distance contribution from each variant after HWE variance standardization. The sign of each difference does not affect its squared contribution.
For the common variant, the standardized difference is \(1/\sqrt{0.50}\approx1.414\), so its squared contribution is \(1^2/0.50=2.000\). For the rare variant, the standardized difference is \(1/\sqrt{0.095}\approx3.245\), so its squared contribution is \(1^2/0.095\approx10.53\).
Thus, for this pair and these two dosage differences, the rare variant contributes about \(10.53/2.000\approx5.263\) times as much squared distance. This comparison is conditional on the stated differences; it does not mean rare variants always produce greater observed contributions. It shows how the weighting can give a rare variant greater leverage when a dosage contrast is present.
The same reweighting can change a PCA axis, not merely rescale the plotted scores. The following example isolates that effect by using two orthogonal centered genotype columns. For centered matrix \(X\), the nonzero PCA directions can be found from \(X^\mathsf{T}X\); multiplying each column by a different scale factor changes this matrix and can change which direction has the largest eigenvalue.
Worked Example: Scaling Switches the Leading PCA Axis
For eight hypothetical individuals, consider two variants with genotype columns \(G_1=(0,1,1,1,1,1,1,2)\) and \(G_2=(0,0,1,1,0,0,0,0)\). The allele frequencies are \(p_1=8/16=0.50\) and \(p_2=2/16=0.125\). The centered columns are \(x=(-1,0,0,0,0,0,0,1)\) and \(y=(-0.25,-0.25,0.75,0.75,-0.25,-0.25,-0.25,-0.25)\).
Their squared lengths are \(x^\mathsf{T}x=2\) and \(y^\mathsf{T}y=2(0.75^2)+6(0.25^2)=1.50\). Their inner product is \(x^\mathsf{T}y=(-1)(-0.25)+(1)(-0.25)=0\); the other entries of \(x\) are zero. Thus the columns are orthogonal. With centered dosages, \(X^\mathsf{T}X\) is diagonal with entries 2 and 1.50. The leading axis is the first variant, since \(2>1.50\).
Now scale by the HWE standard deviations. For variant 1 the denominator is \(\sqrt{0.50}\), so its squared column length becomes \(2/0.50=4.000\). For variant 2 the denominator is \(\sqrt{2(0.125)(0.875)}=\sqrt{0.21875}\), so its squared column length becomes \(1.50/0.21875\approx6.857\). The columns remain orthogonal, but the second now has the larger squared length. The leading axis switches to the second variant.
This deliberately small example shows that scaling can alter which variation PCA ranks first. It does not establish that the rare-variant axis is more meaningful. In this example, the first column's observed variance is much smaller than its HWE variance would suggest; HWE scaling therefore increases its length less than it increases the second column's length.
Choosing and Checking a Scaling
Three choices are useful to distinguish. Each answers a different practical question.
| Choice | What it does | Main consequence |
|---|---|---|
| Centered dosage | Subtracts \(2p_j\), without dividing by a standard deviation | Variants with greater observed dosage variation can have greater influence. |
| HWE variance standardization | Divides centered dosage by \(\sqrt{2p_j(1-p_j)}\) | Weights deviations by inverse expected genotype variance; rare-variant contrasts can be amplified. |
| Empirical unit-variance scaling | Divides each centered column by its observed sample standard deviation | Gives nonconstant columns equal observed sample variance, but can still magnify rare columns with few carriers. |
A further option is to exclude variants below a specified frequency threshold or to cap the amount of inverse-frequency weighting. Such choices can reduce the leverage of sparse variants, but change the variation the PCA represents. They should be specified before interpreting the components and reported with the PCA results. A frequency filter is not a universal remedy: it may remove genuine population information as well as unstable or unwanted contributions.
Diagnostics should examine the variants and individuals that drive the result, not only the shape of a score plot. Check allele frequencies, carrier counts, missingness, and the distribution of column scales. Inspect the largest contributions or loadings for the leading components and determine whether a few very low-frequency variants dominate. Compare results under scientifically reasonable scaling or frequency-filter choices. Large changes in leading axes, individual positions, or influential variants warrant investigation; they do not by themselves identify which analysis is correct.
Scaling also cannot repair poor genotype calls, frequency estimates distorted by the sample composition, or technical artifacts. HWE-based standardization uses the frequency supplied to it, so a frequency estimated across a structured sample is a pooled quantity, not necessarily the frequency within each ancestry group. In addition, a rare allele observed in only a few people can have an imprecisely estimated frequency. The resulting scaled values may be highly sensitive to those few observations.
Common Mistake and Practical Interpretation
The choice of scaling defines which genotype differences count most in the analysis. Centering alone gives no extra inverse-frequency weight, while HWE standardization expresses differences relative to expected genotype variability and can emphasize rare alleles. Empirical scaling equalizes observed column variances when they are nonzero, but a rare variant's observed variance may itself be determined by just a few carriers. Interpret PCA axes in light of this choice, and treat sensitivity to scaling as a substantive diagnostic rather than a cosmetic plotting difference.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions.
- Under HWE, what is the variance of a diploid dosage when the counted allele has frequency \(p\)?
- At \(p=0.10\), calculate the HWE-standardized dosage for \(G=1\), to three significant figures.
- Two individuals differ by one dosage unit at variants with \(p=0.50\) and \(p=0.10\). What are the squared-distance contributions after HWE variance standardization?
- Why can empirical unit-variance scaling still give a rare variant substantial influence?
- If the leading PCA axis changes after rare variants are filtered, what can and cannot be concluded from that change?
Solutions. (1) Under HWE, \(G\) is the sum of two independent Bernoulli variables with variance \(p(1-p)\) each, so \(\operatorname{Var}(G)=2p(1-p)\). (2) The denominator is \(\sqrt{2(0.10)(0.90)}=\sqrt{0.18}\approx0.4243\). The centered dosage is \(1-0.20=0.80\), so \(Z=0.80/0.4243\approx1.886\). (3) The contributions are \(1/[2(0.50)(0.50)]=2.000\) and \(1/[2(0.10)(0.90)]=5.556\), respectively. (4) Empirical scaling divides by the observed standard deviation; if only a few individuals carry the allele, that observed scale may be small, and carrier values after division can be large. (5) The change shows that the PCA result is sensitive to the retained variants under the two analyses. It does not, by itself, establish which axis is biologically correct or whether the removed variants were artifactual.