Tutorials › Statistical Genetics › Harmonizing Traits And Variants For Cross-Trait LDSC

Genetic Correlation Across Traits · Tutorial 569 of 989

Harmonizing Traits And Variants For Cross-Trait LDSC

Prepare two GWAS summary datasets for cross-trait LDSC by matching the same variants and expressing their effects on the same allele.

Advanced 10 min read

What You'll Learn

  • Define the allele orientation and variant identity required for a valid cross-trait comparison
  • Complement alleles and determine when an effect estimate must change sign
  • Resolve or exclude strand-ambiguous A/T and C/G variants using allele frequencies
  • Match variant identifiers only after checking genomic build, position, and allele representation
  • Audit effect, standard-error, Z-score, allele-frequency, and sample-size fields
  • Explain how alignment errors can distort cross-trait LDSC inputs

Why Harmonization Is Part of the Analysis

Cross-trait LD score regression uses summary statistics from two traits at the same genetic variants. Its cross-trait signal depends on the signs and magnitudes of the two traits’ association statistics at each variant. Those signs have meaning only when both datasets describe effects for the same allele. If one file reports an effect for the A allele and the other reports it for the G allele, comparing their signed statistics without adjustment can reverse the contribution of that variant.

Harmonization is the process of preparing both summary datasets so that a retained row refers to the same variant, with a consistent allele orientation and interpretable effect and sample-size fields. It does not estimate genetic correlation or fix problems in the underlying studies. It aims to ensure that the inputs to the cross-trait analysis are comparable.

Definition: Two summary-statistic rows are harmonized for cross-trait analysis when they identify the same biallelic variant in the same genomic reference build, use the same effect allele and other allele after any strand complementing, and have valid, interpretable association and sample-size fields. A harmonized row pair may be retained for analysis only if its allele and variant identity are sufficiently certain.

The input fields commonly needed include a variant identifier, chromosome and position, effect allele, other allele, effect estimate or Z statistic, standard error or P value, allele frequency where available, and sample size. Column names do not guarantee consistent meanings: for example, “A1” may be defined differently across files or software. The analyst must confirm each field’s meaning from the study documentation rather than infer it from its label.

Allele Orientation and the Sign of an Effect

For this tutorial, call the allele whose effect is reported the effect allele, and call the other allele the other allele. If a study reports an additive effect \(\beta\), then \(\beta\) describes the change in the modeled trait per additional copy of the effect allele, under that study’s model and trait scale. The corresponding Z statistic is often \(Z=\beta/SE\), where \(SE\) is the standard error of \(\beta\).

If the effect allele and other allele are exchanged at a biallelic variant, the per-allele effect changes sign: the count of copies of one allele is two minus the count of the other. The standard error is unchanged by this recoding, so the Z statistic also changes sign. This is the key operation when harmonizing opposite allele orientations.

$$ \beta_{\text{new}}=-\beta_{\text{old}},\qquad SE_{\text{new}}=SE_{\text{old}},\qquad Z_{\text{new}}=-Z_{\text{old}}. $$

For ordinary single-nucleotide variants, the reverse-complement transformation maps A to T, T to A, C to G, and G to C. A pair of alleles may therefore be written on opposite DNA strands while still describing the same variant. Complementing both alleles preserves their pairing; it does not, by itself, require a sign flip. A sign flip is needed when the effect allele after matching is the other allele relative to the allele originally used.

Worked Example: Reversing the Effect Allele

Suppose two hypothetical GWAS files contain the same variant at the same build and position. Dataset 1 reports effect allele A, other allele G, \(\beta_1=0.12\), and \(SE_1=0.04\). Dataset 2 reports effect allele G, other allele A, \(\beta_2=-0.06\), and \(SE_2=0.03\). Both rows are assumed to be correctly labeled and to refer to the same biallelic variant.

Choose A as the common effect allele. Dataset 1 already uses A, so its values remain \(\beta_1=0.12\) and \(SE_1=0.04\), giving \(Z_1=0.12/0.04=3.00\). Dataset 2 uses G, so reverse its effect sign while retaining its standard error: \(\beta_2^{(A)}=-(-0.06)=0.06\) and \(SE_2^{(A)}=0.03\). Thus \(Z_2^{(A)}=0.06/0.03=2.00\).

Both harmonized effects are now per copy of A. The positive signs are comparable. Without the sign change, the second statistic would have been \(-2.00\), reversing the sign of its cross-trait product with \(Z_1\).

Matching Variants Before Comparing Effects

A matching identifier is not enough by itself to establish that two rows describe the same variant. Identifiers can be missing, duplicated, or inconsistent across data releases; positions can differ when files use different genome builds. A robust comparison checks the chromosome, position, build, and alleles, as well as the identifier when it is available. Indels and multiallelic sites require particular care because their representations can vary; a simple single-nucleotide complement-and-swap rule is not sufficient for every representation.

A practical workflow first confirms the genome build for both files and the LD-score reference. It then identifies candidate shared variants, checks for duplicate rows and incompatible allele pairs, and standardizes the allele representation. Only after those checks should effects be oriented to a common allele. For cross-trait LDSC, the retained SNP set must also be suitable for the LD scores and the analysis’s SNP filters.

1
Verify field definitions and genome build.
Confirm which allele each effect refers to, what each frequency field measures, the position build, and how sample size is defined.
2
Identify candidate shared variants.
Match by stable identifiers where possible, but check chromosome, position, alleles, and build; investigate duplicates rather than selecting one arbitrarily.
3
Standardize allele pairs.
Allow direct matches or reverse complements for unambiguous variants. Determine whether a row also needs a sign change to express its effect on the chosen common allele.
4
Resolve ambiguity and audit numeric fields.
Use suitable frequency information for strand-ambiguous variants, exclude unresolved cases, and check effect, standard error, Z statistic, and sample-size values.
5
Retain and document the analysis set.
Record which variants were retained or removed and why; confirm that the retained variants are compatible with the LD-score reference and downstream input requirements.

Strand-Ambiguous Variants

A/T and C/G variants are called strand-ambiguous, or palindromic, because complementing the allele pair gives the same unordered pair: A/T complements to T/A, and C/G complements to G/C. If the two files disagree only by strand, the allele letters alone do not tell which frequency corresponds to the same physical allele. A matching identifier and position do not resolve that orientation problem.

Allele frequency can help when its definition is known and the studies are sufficiently comparable. For example, if a file reports the frequency of its effect allele, a frequency near 0.12 is distinguishable from the complementary frequency near 0.88. But a frequency near 0.50 is not informative about orientation, and differences in ancestry, ascertainment, or frequency definition can make comparisons unreliable. Frequency-based resolution should therefore use an explicit tolerance justified for the data; it is not a universal automatic rule. If orientation remains uncertain, excluding the variant is safer than assigning a potentially incorrect sign.

Worked Example: Using Frequency to Resolve a Palindrome

Consider a hypothetical A/T variant present in both datasets. Dataset 1 reports effect allele A with effect-allele frequency \(0.18\). Dataset 2 reports effect allele T with effect-allele frequency \(0.82\). Assume both frequency fields are defined for the reported effect allele, the studies are from comparable populations, and the documented frequency difference is within the chosen matching tolerance.

If dataset 2’s T allele is the same physical allele as dataset 1’s T allele, its frequency should be close to dataset 1’s complementary A frequency: \(1-0.18=0.82\). The observed value is consistent with that orientation. Thus dataset 2’s T effect allele corresponds to dataset 1’s other allele, so to express dataset 2’s effect per A allele, change its effect and Z signs. This conclusion depends on the stated frequency definitions and comparability assumptions.

Now suppose dataset 2 instead reports effect-allele frequency \(0.49\). Its complementary frequency is \(1-0.49=0.51\), nearly the same. The frequency cannot distinguish the two orientations reliably. Unless additional trusted information resolves the strand, this row should be excluded rather than harmonized by guesswork.

Auditing Effects, Z Statistics, and Sample Size

After allele alignment, check that the association fields are internally coherent. If both \(\beta\) and \(SE\) are supplied, compute \(Z=\beta/SE\) and compare it with the reported Z statistic, allowing for rounding and any documented differences in test definition. The effect and standard error must be finite, the standard error positive, and the effect units and trait scale understood. If only a P value and direction are given, a signed Z statistic may be derived only when the P value’s test and tail convention are known.

Sample size also needs explicit interpretation. A single \(N\) may be appropriate for a quantitative-trait GWAS with a common sample across variants, but available sample size can vary by variant because of missing genotypes or quality control. For binary traits, total sample size, case and control counts, and effective sample size are not interchangeable. Use the sample-size convention required by the LDSC implementation and the study design; do not replace one definition with another merely because the fields are both labeled “N.”

Worked Example: Checking Effect and Sample-Size Fields

A hypothetical quantitative-trait summary row has effect allele C, \(\beta=0.08\) trait units per C allele, \(SE=0.02\) trait units, reported \(Z=4.00\), and \(N=10{,}000\). Assume the study documentation confirms that \(SE\) is the standard error of \(\beta\), that the Z statistic is based on the same effect estimate, and that \(N\) is the number of participants contributing to this variant.

The consistency check gives \(Z=\beta/SE=0.08/0.02=4.00\), agreeing with the reported value. The units of \(\beta\) and \(SE\) match, and \(N\) is positive and has an explicit interpretation. If the other trait’s row uses a different effect allele, its signed statistic must be oriented to C before the two Z statistics are paired.

If the reported Z had instead been \(-4.00\), the disagreement would require investigation: it could reflect a mislabeled effect allele, an incorrect effect or standard error, or a different test statistic. It should not be silently “fixed” by changing a sign without checking the source fields.

Why Alignment Changes the Cross-Trait Input

At a shared variant \(j\), cross-trait LDSC uses the product of the two signed association statistics, \(Z_{1j}Z_{2j}\), as part of the cross-trait information. If one trait’s statistic is accidentally reversed, this product changes sign. For instance, \(3.00\times2.00=6.00\), whereas \(3.00\times(-2.00)=-6.00\). Across many variants, inconsistent orientation can therefore obscure or distort the pattern the regression is intended to summarize.

This gives a short justification for the sign-flip rule. Let \(G\) be the count of an effect allele in a diploid genotype, and let the other allele’s count be \(2-G\). If a linear per-allele model has contribution \(\beta G\), then writing it in terms of the other allele gives \(\beta G=\beta(2-(2-G))\), or, equivalently, a coefficient of \(-\beta\) on the other allele count plus a constant. The constant is absorbed by the model intercept. Thus exchanging the counted allele reverses the slope, while its standard error is unchanged under the same model and data.

$$ \beta G = 2\beta + (-\beta)(2-G). $$

This argument concerns allele coding, not causal interpretation. Harmonization makes association statistics comparable in orientation; it does not show that either association is causal, ensure that the studies measure identical phenotypes, or guarantee that their populations and models are otherwise comparable.

Common Mistakes and Practical Checks

  • Assuming identical variant IDs guarantee alignment. IDs can refer to different builds or be inconsistently assigned. Check position, alleles, and build as well.
  • Flipping signs whenever alleles are complemented. Complementing a pair changes strand notation; the sign changes only when the chosen effect allele changes to the other allele.
  • Guessing the orientation of A/T or C/G variants. Their allele strings do not resolve strand. Use reliable, comparable allele-frequency information or exclude unresolved variants.
  • Treating every N field as equivalent. Total, per-variant, and effective sample sizes can differ. Verify the definition required for the analysis.
  • Ignoring inconsistent effect and Z fields. A mismatch is a quality-control signal, not a reason to choose whichever field seems more convenient.
Key takeaway: For every retained variant, establish that the two rows describe the same genomic site, orient both effects to the same allele, and verify the meaning and plausibility of effect, uncertainty, frequency, and sample-size fields. Drop variants whose identity or orientation cannot be established reliably.

Check Your Understanding

Answer each question by applying the harmonization rules to the stated information.

  1. One file reports an effect for allele G and another for allele A at the same confirmed biallelic variant. What change is needed to express both effects per G allele?
  2. Why can the allele letters alone fail to resolve strand orientation for an A/T variant?
  3. A dataset reports \(\beta=0.15\) and \(SE=0.05\). What Z statistic follows, and what should be checked if the file reports a different sign?
  4. Why is matching by variant identifier alone insufficient when genome builds may differ?
  5. A palindromic variant has comparable effect-allele frequencies of 0.48 and 0.52 in two files. What makes orientation difficult, and what is a defensible action if no other information resolves it?
  6. Explain briefly why an incorrect sign at a shared variant changes its cross-trait Z-statistic product.
Clinical Biostats