Why Diagnose Frequency and LD Separately?
A polygenic score applies discovery-derived weights to genotypes in a target population. Its portability can differ across populations, but a performance difference alone does not identify why. Two measurable features of the genotype data are allele frequencies and linkage disequilibrium (LD). Frequency differences change how common each coded allele is; LD differences change how genotypes at nearby variants covary. Either can alter the distribution of a score or the relationship between a weighted marker and the genetic signal it was intended to capture.
This tutorial uses matched variants: the same genomic positions, alleles, and genotype coding are compared in discovery and target samples. The comparisons are diagnostic, not a complete decomposition of portability loss. A frequency shift or LD mismatch can flag a plausible mechanism, but neither by itself establishes how much prediction changed or rules out differences in estimated weights, phenotype measurement, sampling, or other factors.
Definitions and Comparability Requirements
A comparison requires more than matching variant identifiers. Genome build and position must agree, and the effect allele must be aligned in both datasets. If one dataset counts the opposite allele, its frequency is \(1-p_j\); correlations involving that variant also change sign. Palindromic A/T and C/G variants can be especially difficult to align when strand information is unavailable. Variants with unresolved alleles should be excluded rather than treated as biological frequency or LD differences.
Use the same variant inclusion rules in both populations, including compatible quality control and imputation filters. For LD, compare the same pairs of variants within the same genomic windows. If samples contain related individuals, ancestry mixture, or strong population structure, ordinary sampling formulas and pooled LD estimates may not describe the intended population comparison. Define the population groups clearly and inspect subgroup structure where possible.
Frequency and LD Diagnostic Plots
A matched-variant frequency scatterplot places discovery frequency \(p_{Dj}\) on the horizontal axis and target frequency \(p_{Tj}\) on the vertical axis. The diagonal \(p_{Tj}=p_{Dj}\) represents equal frequencies; signed vertical deviations show their direction. A companion plot of \(p_{Tj}-p_{Dj}\) against the mean frequency helps reveal whether shifts are concentrated among rare or common variants. Labeling points by chromosome or genomic region can identify clusters that merit follow-up.
For LD, each point can represent a matched pair of variants, with discovery \(r_{D,jk}\) on the horizontal axis and target \(r_{T,jk}\) on the vertical axis. A diagonal reference line indicates equal signed correlation. A plot of \(r_{T,jk}-r_{D,jk}\), or matched local LD heat maps, helps identify regions with notable differences. Use signed \(r\) when the direction of genotype association matters for a weighted score. A plot of \(r^2\) can summarize association strength, but it hides sign reversals.
Do not interpret every off-diagonal point as a population difference. The number of possible variant pairs can be very large, and estimates become noisy when sample sizes are small or alleles are rare. Report sample sizes and consider uncertainty, for example through resampling individuals or genomic blocks. A visual pattern is a prompt for investigation, not a significance test or a causal explanation.
How Genotype Differences Enter a Score
For fixed weights \(\beta_j\), a score is \(S=\sum_j \beta_jG_j\). Let \(\Sigma\) be the genotype covariance matrix in a population, so that its \(j,k\) entry is \(\operatorname{Cov}(G_j,G_k)\). The score variance is
This follows by expanding the variance of a sum: each pair of score terms contributes \(\beta_j\beta_k\operatorname{Cov}(G_j,G_k)\). The diagonal entries are genotype variances, which depend on allele frequency; off-diagonal entries depend on both genotype variances and LD. Under Hardy–Weinberg equilibrium, \(\operatorname{Cov}(G_j,G_k)=r_{jk}\sqrt{2p_j(1-p_j)\,2p_k(1-p_k)}\). In real samples, the empirical covariance matrix directly captures observed variances and covariances and does not require assuming Hardy–Weinberg equilibrium.
Thus, even if the score weights are held fixed, frequency and LD differences can change the score’s variance. That fact alone does not determine the score’s predictive accuracy: prediction also depends on the relationship between the score and the phenotype. In particular, LD can affect how well a discovery marker tracks relevant genetic variation in the target population. These plots diagnose genotype patterns; they do not establish that a particular difference caused a measured performance gap.
Worked Example: Quantifying a Frequency Difference
Suppose a hypothetical matched variant has effect-allele counts of 600 among 2,000 allele copies in discovery and 100 among 1,000 allele copies in the target sample. The samples are assumed unrelated, and allele copies are treated as independent for this approximate uncertainty calculation.
The estimated frequencies are \(p_D=600/2000=0.300\) and \(p_T=100/1000=0.100\). The target-minus-discovery difference is \(0.100-0.300=-0.200\), a 20-percentage-point lower frequency in the target sample.
Under the stated independence approximation, the standard error of a sample allele frequency based on \(2n\) allele copies is \(\sqrt{p(1-p)/(2n)}\). The standard error of the difference is therefore
The difference is about \(-0.200/0.0140=-14.3\) standard errors from zero under this approximation. This is strong evidence of a frequency difference in these hypothetical samples, assuming correct allele alignment and the sampling assumptions. It does not show that the difference caused a particular loss of predictive accuracy.
Worked Example: Interpreting Signed LD Changes
Consider two hypothetical variants with effect alleles aligned in both populations. Their estimated signed LD correlations are \(r_D=0.70\) in discovery and \(r_T=-0.50\) in the target population. Both estimates are treated here as sufficiently precise for illustrating the comparison.
The matched-pair plot would place the point at \((0.70,-0.50)\), well away from the equality line. The difference is \(r_T-r_D=-0.50-0.70=-1.20\), indicating a reversal in the direction of correlation as well as a change in its magnitude. By contrast, \(r_D^2=0.49\) and \(r_T^2=0.25\): a plot of \(r^2\) would show a reduction in strength but not the reversal.
The score-variance consequence can also be illustrated. Suppose both variants have frequency \(0.25\) in each population and fixed weights \(\beta_1=0.12\), \(\beta_2=0.08\), measured in phenotype units per effect-allele copy. Under Hardy–Weinberg equilibrium, each genotype variance is \(2(0.25)(0.75)=0.375\). The score variance for these two variants is
In discovery this is \(0.375(0.0144+0.0064+0.01344)=0.01284\) phenotype-units squared. In the target it is \(0.375(0.0144+0.0064-0.00960)=0.00420\) phenotype-units squared. The contrast illustrates how signed LD enters score variance; it does not by itself quantify a change in prediction.
Worked Example: Resolving an Apparent Frequency Outlier
A hypothetical variant has discovery frequency \(p_D=0.08\), while the target file reports frequency \(0.92\). The variant is known to be coded for the opposite allele in the target file. Before harmonization, the point would appear far from the frequency equality line.
Recode the target to count the same effect allele as discovery. Its aligned frequency is \(p_T=1-0.92=0.08\), so the aligned frequency difference is \(0.08-0.08=0\). The apparent discrepancy was a coding mismatch, not evidence of a frequency shift.
The same recoding matters for LD: changing the allele counted at one variant reverses the sign of its correlation with other variants. If the target’s reported correlation between this variant and a second, consistently coded variant is \(r=0.35\), the aligned correlation is \(-0.35\). Thus a frequency scatterplot and an LD scatterplot should be made only after allele harmonization. This correction assumes the strand and allele correspondence are known; if they are ambiguous, the pair should not be interpreted.
Assumptions, Diagnostics, and Limits
Frequency and LD comparisons are most informative when variant matching, allele alignment, sample definition, and estimation procedures are consistent. Check that frequencies lie between zero and one, that the same allele is counted in both datasets, and that the LD estimates use the same pair orientation and genotype coding. For a frequency comparison, an approximate standard error for \(p_T-p_D\) is
where \(n_T\) and \(n_D\) are the numbers of unrelated diploid individuals. This approximation treats allele copies as independent; departures from that assumption, including relatedness or population structure, can make it inaccurate. Rare alleles need particular care because a small change in allele count can yield a large relative frequency change, while estimates of LD involving rare variants may be unstable.
For LD, inspect sample sizes, missingness, imputation quality, and allele frequencies alongside the correlations. A small target sample can produce noisy pairwise estimates, and a large number of tested pairs makes isolated extremes unsurprising. Confidence intervals from appropriate resampling can help distinguish a stable pattern from estimation noise. Local heat maps can show whether a mismatch is concentrated in a region, but should be read with matched variant coverage in mind.
Population labels summarize sampled groups; they do not make the groups genetically uniform or establish that ancestry itself caused a difference. Admixture and within-group structure can affect pooled frequency and LD estimates. Moreover, differences in phenotype definition, ascertainment, environments, and effect estimates can also matter for portability. A frequency or LD plot cannot resolve these explanations on its own.
Common Pitfall and Practical Comparison
Wrong reasoning: “The target has lower allele frequency at several score variants, so the score must be less accurate there.” The correction is that frequency differences change genotype distributions and may change score variance, but accuracy depends on the score–phenotype relationship as well. Report the observed frequency shifts as diagnostics, then evaluate predictive performance separately and avoid attributing that performance difference to frequency alone.
Frequency scatterplots and LD comparisons answer complementary questions. A frequency plot compares individual variant prevalences; an LD plot compares pairwise genotype relationships. Neither replaces direct score evaluation, and neither by itself separates the contributions of genotype differences from other sources of portability loss. Signed \(r\) is more informative than \(r^2\) when direction matters, while \(r^2\) is useful for comparing association strength when the sign is not the focus. The appropriate choice depends on the diagnostic question.
Check Your Understanding
Answer each question, then compare with the brief solutions below.
- A variant has discovery frequency 0.40 and target frequency 0.35 after allele alignment. What is the target-minus-discovery difference, and what does its sign mean?
- Why can comparing \(r^2\) alone conceal an important LD change?
- For a fixed weighted score, which genotype covariance terms depend on allele frequencies, and which involve LD?
- A frequency plot shows a striking discrepancy, but one dataset may count the opposite allele. What should be checked before interpreting the point?
Solutions. (1) The difference is \(0.35-0.40=-0.05\), meaning the coded allele is five percentage points less frequent in the target. (2) Squaring removes the sign: correlations \(0.7\) and \(-0.7\) have the same \(r^2=0.49\), despite opposite directions. (3) Diagonal covariance terms are genotype variances, which depend on frequency; off-diagonal terms include both genotype variances and the signed LD correlation. (4) Check allele alignment, strand, and variant matching; if the target counts the opposite allele, recode its frequency as \(1-p\) and reverse relevant LD signs before comparison.