Why LD-score computation needs explicit choices
LD Score Regression uses an LD score to summarize how much linkage disequilibrium (LD) a variant has with other variants in a chosen set. In practice, computing that score means more than summing numbers from a matrix: the analyst must define the reference genotypes, the variants included in the sum, and the genomic window. A score is therefore meaningful only alongside its variant set and window definition.
The basic computation is straightforward. The consequential choices are how to construct the correlations consistently, which variants count as neighbors, and whether the reference variants can be matched correctly to the summary statistics. Errors in those steps can produce scores that are numerically valid but do not correspond to the intended analysis.
A genotype dosage is typically the number of copies of a specified allele, or an estimated dosage between 0 and 2. Correlations are calculated across reference individuals. For a score that includes several variants, the same variant set and correlation conventions should be applied systematically. The set used to calculate LD can be broader than the set of variants retained as regression targets: for example, a study may estimate scores for selected target SNPs while including a larger set of reference variants in their windows.
This tutorial concerns the construction and checking of those scores. The earlier material on LD Score Regression establishes why LD scores enter the summary-statistic mean model; here the focus is on obtaining the input accurately.
From genotype correlations to a score
For each pair \(j,k\), calculate the Pearson correlation of their genotype dosages in the reference samples, then square it. Squaring makes the contribution nonnegative: a strong negative correlation contributes as much as a strong positive correlation. The score is the sum of those contributions over the specified window, not an average.
Here \(G_{ij}\) is the dosage for reference individual \(i\) at variant \(j\), and \(m\) is the number of individuals used for the pairwise correlation. If a variant is monomorphic in the reference data, its dosage variance is zero and the correlation is undefined; it cannot be treated as an ordinary target with a self-correlation of one. Such variants need to be removed or handled as a data-quality failure before scores are computed.
The basic calculation assumes that the reference genotypes are suitable for estimating the LD relevant to the analysis, that the variants and genomic positions have been identified consistently, and that the correlation estimates are based on adequate, usable genotype data. It also assumes a clearly defined window and variant set. These are computational and design conditions, not guarantees that the resulting scores will be appropriate for every analysis.
Worked Example: Summing Correlations in a Window
Suppose a hypothetical reference panel contains four variants, A, B, C, and D. For target B, the chosen window includes A, B, and C but excludes D. The estimated genotype correlations are \(r_{BA}=0.60\), \(r_{BB}=1\), and \(r_{BC}=0.70\). Assume the variants are non-monomorphic and the correlations were calculated from the same reference individuals.
Square each correlation and add the results for the included variants:
The LD score for B is 1.85. D contributes nothing because it is outside the stated window; it is not assigned a zero correlation. The value would change if the window or the variant set changed. The self-correlation contributes exactly 1, which is why a score for a non-monomorphic target that includes itself is at least 1.
Choosing and recording a window
A window determines which variants count as neighbors of the target. A physical window uses genomic coordinates, such as a fixed number of base pairs on either side. A genetic window uses genetic-map distance, commonly expressed in centimorgans, and can better reflect that the physical distance corresponding to a given recombination distance varies across the genome. Neither choice is universally correct for every purpose. The important requirements are to use a stated rule, use coordinates and maps consistently, and avoid silently changing the window across targets.
Specify whether the window is centered on the target, whether its endpoints are included, which chromosome and genome build define positions, and which variants are eligible to contribute. If a target is near a chromosome end, include only variants on that chromosome within the defined range; do not wrap the window to the other end. For genetic windows, state the map and how positions are converted to genetic distance. A particular threshold is an analysis choice, not a universal property of an LD score.
Worked Example: Physical Versus Genetic Distance
Consider a hypothetical target at 10.0 Mb and 2.5 cM. A physical window extends 0.5 Mb in each direction. A genetic window extends 0.5 cM in each direction. Potential contributors are listed below; the target itself is included in both windows.
| Variant | Physical position | Genetic position | Squared correlation with target |
|---|---|---|---|
| U | 9.2 Mb | 1.9 cM | 0.16 |
| V | 9.8 Mb | 2.3 cM | 0.25 |
| Target | 10.0 Mb | 2.5 cM | 1.00 |
| W | 10.7 Mb | 2.8 cM | 0.09 |
Under the physical rule, the interval is 9.5–10.5 Mb. It includes V and the target, but not U or W. Thus \(l_{\text{target}}=0.25+1.00=1.25\). Under the genetic rule, the interval is 2.0–3.0 cM. It includes V, the target, and W, but not U. Thus \(l_{\text{target}}=0.25+1.00+0.09=1.34\). The scores differ because the windows contain different variants, not because either sum was calculated incorrectly. A production analysis would also state whether a variant exactly on a boundary is included.
Alleles, identifiers, and quality checks
LD scores use squared correlations, so swapping the coded allele at one variant changes the sign of correlations involving that variant but not their squares. If \(G_j\) is replaced by \(2-G_j\), its correlation with another dosage changes sign: \(r_{jk}\) becomes \(-r_{jk}\). Since \((-r_{jk})^2=r_{jk}^2\), the LD score is unchanged, provided the same variants remain in the calculation.
This invariance does not make allele harmonization optional. Summary-statistic regression requires matching each score to the correct summary-statistic variant. A wrong variant match, genome-build mismatch, or inconsistent allele coding can associate a score with the wrong test statistic. Effect-allele direction is especially important when interpreting effect estimates: changing the effect allele reverses the sign of a coefficient, even though a squared test statistic may be unchanged.
Worked Example: Allele Flips and a Matching Check
Suppose a hypothetical summary-statistic file reports an effect estimate of \(0.12\) with standard error \(0.04\) per A allele at a biallelic SNP. A reference file represents the same SNP with T as the counted allele. If A and T are the two alleles at the same locus, the effect estimate per T allele is \(-0.12\), with the same standard error.
The squared Wald statistic is unchanged:
Likewise, recoding a reference genotype dosage from A copies to T copies reverses the sign of its correlation with another dosage, but not the squared correlation used in the LD score. The analyst must still verify that the chromosome, position, genome build, and allele pair identify the same SNP before attaching its score to the summary statistic. If the alleles are strand-ambiguous (A/T or C/G), strand information alone may not resolve the match; use a reliable harmonization rule or exclude unresolved variants rather than guessing.
Useful quality checks include confirming that variant identifiers are unique, positions are valid for the stated genome build, alleles are plausible and consistently represented, and reference variants have adequate genotype data and nonzero variance. Check that correlations are finite and within \([-1,1]\), diagonal entries are 1 for non-monomorphic variants, and squared correlations are between 0 and 1. Also inspect missingness and allele frequencies for unexpected coding or sample problems. If pairwise correlations use different subsets of individuals because of missing genotypes, record that choice and check that it does not create inconsistent estimates across pairs.
Derivation and interpretation
The invariance to allele recoding follows directly from the correlation formula. Let \(G_j'=2-G_j\). Then \(G_j'-\bar G_j'=-(G_j-\bar G_j)\), while the standard deviation of \(G_j'\) equals that of \(G_j\). Substitution into the correlation numerator reverses its sign and leaves the denominator unchanged, so \(r'_{jk}=-r_{jk}\). Therefore \((r'_{jk})^2=r_{jk}^2\), and the sum of squared correlations is unchanged. This justifies using squared correlations for an allele-orientation-invariant measure of local correlation, but does not justify skipping variant matching.
Common mistakes and alternatives
- Using an unspecified window. Saying only “local LD” does not define a reproducible score. State the distance scale, threshold, map or coordinate build, boundary rule, and variant set.
- Averaging instead of summing. An LD score is a sum of \(r^2\) values. Dividing by the number of variants creates a different quantity.
- Forgetting the target variant. Under the convention used here, the target is included and contributes 1 if it is polymorphic. Excluding it changes the score definition.
- Pruning the variants before summing without noting it. LD pruning deliberately removes correlated variants. A score computed from a pruned set generally differs from a score based on the full eligible set; pruning is not a harmless shortcut.
- Treating allele orientation as a matching problem solved by squaring. Squaring removes the sign of a correlation, not errors in variant identity, position, or effect-allele interpretation.
A physical window is simple to implement and does not require a genetic map, but the same physical range need not represent the same recombination distance throughout the genome. A genetic window uses recombination information but depends on a suitable map and correct map coordinates. Similarly, summing across a broad eligible set retains more measured LD contributions, whereas restricting the set reduces computation but changes the defined score. These are choices to document and assess, not interchangeable calculations that always yield the same result.
Specify reference genotypes, variant identifiers, genome build, eligible variants, and the LD-window rule.
Remove or resolve unusable variants, calculate genotype correlations consistently, and verify their range and diagonal values.
For each target, sum \(r^2\) over the variants in its window, including its self-term when polymorphic; inspect scores and confirm that they match the intended summary-statistic variants.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions.
- A target has correlations \(0.5\) and \(-0.4\) with two other included variants. What is its LD score if the target is included?
- Why can changing the counted allele leave an LD score unchanged while still requiring allele harmonization?
- A physical window includes variants P and Q, while a genetic window includes P, Q, and R. Their squared correlations with the target are 0.10, 0.20, and 0.30, respectively. Calculate both scores.
- Name two checks that can detect an invalid or mismatched reference variant before scores are used in regression.
Solutions. 1. Include the self-term of 1: \(l=1+(0.5)^2+(-0.4)^2=1+0.25+0.16=1.41\). 2. Reversing an allele changes the sign of a genotype correlation, but squaring removes that sign. Harmonization is still needed to ensure the score is matched to the correct SNP and that effect estimates have the intended allele direction. 3. The physical-window score is \(1+0.10+0.20=1.30\); the genetic-window score is \(1+0.10+0.20+0.30=1.60\). 4. Examples include checking for duplicate or invalid variant identifiers, verifying chromosome and position against the stated genome build, confirming alleles match, and checking that genotype variance is nonzero and correlations are finite and within \([-1,1]\).