Tutorials › High-Dimensional Genomic Data Analysis › Computing Scores From Genotype Dosages

Polygenic Risk Scores · Tutorial 563 of 795

Computing Scores From Genotype Dosages

Calculate an individual’s polygenic score from allele dosages and GWAS effects, and verify that allele coding and score direction are consistent.

Advanced 12 min read

What You'll Learn

  • Write the raw polygenic score as a weighted sum of effect-allele dosages.
  • Interpret fractional imputed dosages as expected allele counts, not observed fractional genotypes.
  • Recode a dosage when the target data count the allele opposite to the GWAS effect allele.
  • Check the direction and units of score contributions against GWAS weights.
  • Compare dosage-based scores with scores from hard genotype calls and identify when they can differ.
  • Diagnose common alignment, variant-matching, and score-interpretation errors.

From Dosages and GWAS Weights to an Individual Score

Once variants and their weights have been selected, calculating a polygenic score is a weighted-sum operation. The crucial detail is that every weight must multiply a dosage for the same allele whose effect that weight represents. A correct sum with mismatched alleles can give a systematically wrong score, even when the arithmetic is flawless.

The score in this tutorial is the raw sum of weighted dosages. It is a genetic predictor component, not by itself a complete prediction of an outcome: a fitted prediction model may also have an intercept or covariate terms. The weights are treated as fixed inputs here; their estimation and selection are separate from this calculation.

Definition: For individual \(i\) and included variant \(j\), let \(D_{ij}\) be the dosage of the GWAS effect allele, measured as an allele count from 0 to 2, and let \(\beta_j\) be that allele’s GWAS weight. With \(m\) included variants, the raw polygenic score is $$ S_i=\sum_{j=1}^{m} D_{ij}\beta_j. $$ If \(D_{ij}\) is an imputed dosage, it may be fractional. The score has the units of the outcome scale associated with \(\beta_j\), per weighted additive contribution.

Here, \(i\) indexes individuals and \(j\) indexes variants. A dosage of 0 means no copies of the counted allele, 2 means two copies, and a value such as 1.35 is an imputed expected count rather than a literal fractional genotype. The effect allele and weight must be paired consistently at every included variant. Earlier material on allele harmonization establishes why this matching must be checked before calculating the sum.

The additive interpretation is important. A weight \(\beta_j\) is the change in the modeled outcome scale per additional copy of the effect allele at variant \(j\), under the model used to obtain that weight. The score adds those weighted contributions. A positive \(\beta_j\) contributes more as the effect-allele dosage increases; a negative \(\beta_j\) contributes less. Neither sign alone says that a person’s total score is high or low: that depends on all included dosage-weight pairs.

Why Fractional Dosages Enter the Sum Directly

An imputed dosage summarizes uncertainty about the unobserved genotype. If \(G_{ij}\) is the number of effect-allele copies and the imputation assigns probabilities to the three possible counts, then the dosage is the conditional expected count. It is not necessary to round it to 0, 1, or 2 before applying the weight.

$$ D_{ij}=E(G_{ij}\mid \text{imputation data}) =P(G_{ij}=1\mid \text{data})+2P(G_{ij}=2\mid \text{data}). $$

The reason to use a dosage in a linear score follows directly from linearity of expectation. Conditional on the imputation data, the expected weighted contribution at one variant is \(\beta_j E(G_{ij}\mid\text{data})\). Summing over variants gives the expected additive genetic component under the dosage representation.

1
Write the genotype-scale contribution.
For a fully observed genotype, variant \(j\) contributes \(G_{ij}\beta_j\), where \(G_{ij}\) is its effect-allele count.
2
Take the conditional expectation.
Given imputation data, \(E(G_{ij}\beta_j\mid\text{data})=\beta_j E(G_{ij}\mid\text{data})\), because \(\beta_j\) is fixed.
3
Substitute the dosage and sum.
Since \(D_{ij}=E(G_{ij}\mid\text{data})\), the expected additive component is \(\sum_{j=1}^{m}D_{ij}\beta_j\). This justifies using fractional dosages directly in the score.

This justification concerns the expected additive component, not certainty about an individual’s true genotypes or outcome. Dosage scores can still be affected by imputation quality, inaccurate effect estimates, and variants that have not been matched correctly. Dosages also do not make a non-additive genetic model additive; the sum above is specifically the additive score defined by its weights.

Worked Example: Calculating a Score for Two Hypothetical Individuals

Suppose a hypothetical score contains three variants, with GWAS weights on the systolic blood pressure scale. The effect-allele dosages and weights are:

VariantEffect-allele dosage for AWeight (mmHg per allele)Effect-allele dosage for B
11.70.400.4
20.2-0.501.2
32.00.150.5

For individual A, multiply each dosage by its corresponding weight and add:

$$ S_A=(1.7)(0.40)+(0.2)(-0.50)+(2.0)(0.15) =0.68-0.10+0.30=0.88\text{ mmHg}. $$

For individual B:

$$ S_B=(0.4)(0.40)+(1.2)(-0.50)+(0.5)(0.15) =0.16-0.60+0.075=-0.365\text{ mmHg}. $$

The score difference is \(S_A-S_B=0.88-(-0.365)=1.245\) mmHg. Under the additive interpretation of these weights, A’s weighted genetic component is 1.245 mmHg higher than B’s on this score scale. This is not a claim that their measured blood pressures must differ by that amount: other predictors and outcome variation are not represented by this score alone.

Checking Allele Alignment and Score Direction

A dosage column can be valid and still be the wrong input for a particular GWAS weight. The dosage must count the effect allele named by the weight. If the target data instead report the dosage of the other allele at a biallelic variant, recode the dosage before multiplying. If \(D_{\text{other}}\) counts the allele opposite the effect allele, then \(D_{\text{effect}}=2-D_{\text{other}}\).

A sign check complements this allele check. Given a weight reported per effect allele, an increased dosage should increase that variant’s contribution when the weight is positive and decrease it when the weight is negative. This check can reveal a coding error, but it cannot replace verifying variant identity and allele labels. Score direction refers to the direction on the outcome scale represented by the weights; it is not automatically a direction of benefit or harm.

Worked Example: Recoding the Dosage and Checking the Direction

Consider a hypothetical score with two variants. At variant 1, the GWAS effect allele is G, its weight is \(+0.25\) mmHg per G allele, and the target dosage of G is 1.2. At variant 2, the GWAS effect allele is C, its weight is \(-0.40\) mmHg per C allele, but the target data report a dosage of A equal to 1.5.

At variant 1, the dosage already counts the effect allele. Its contribution is:

$$ (1.2)(+0.25)=+0.30\text{ mmHg}. $$

At variant 2, convert the A dosage to the C dosage before using the C weight:

$$ D_C=2-D_A=2-1.5=0.5, \qquad (0.5)(-0.40)=-0.20\text{ mmHg}. $$

The correctly aligned score is therefore \(S=0.30-0.20=0.10\) mmHg. The negative weight means that more C dosage makes this variant’s contribution more negative. Using the A dosage directly with the C weight would instead give \(0.30+(1.5)(-0.40)=-0.30\) mmHg, which is wrong because that multiplication pairs a C effect with an A count.

One can also express the second variant using A as the counted allele, but then the weight must change sign: the per-A weight is \(+0.40\) mmHg. That representation gives a contribution of \((1.5)(+0.40)=0.60\) mmHg, which differs from the C-coded contribution by \(0.80\) mmHg. The difference is a constant \(2(0.40)\), because the two allele counts sum to 2. If the same recoding is applied consistently to all individuals, this constant shifts all raw scores equally; it does not reverse their ordering. Mixing the C weight with the A dosage is not a consistent recoding and does not have this property.

Using Imputed Dosages Rather Than Hard Calls

A hard call assigns one genotype count, usually the most likely one, while a dosage retains the imputation probabilities as an expected allele count. When the intended score uses additive per-allele weights, the dosage is inserted directly. Replacing it with a hard call discards information about uncertainty and can change a person’s score. Neither a fractional dosage nor a hard call should be confused with a measured phenotype.

Worked Example: From Imputation Probabilities to a Score

For a hypothetical individual, suppose the imputation probabilities at variant 1 are \(P(G=0)=0.10\), \(P(G=1)=0.60\), and \(P(G=2)=0.30\), where \(G\) counts the GWAS effect allele. At variant 2, suppose the corresponding probabilities are 0.50, 0.40, and 0.10. Let the weights be \(+0.50\) and \(-0.25\) units of the outcome per effect allele.

The probabilities at each variant sum to 1. The dosages are:

$$ D_1=(0.60)(1)+(0.30)(2)=1.20, \qquad D_2=(0.40)(1)+(0.10)(2)=0.60. $$

The dosage-based score is:

$$ S=(1.20)(0.50)+(0.60)(-0.25)=0.60-0.15=0.45 $$

in the outcome units associated with the weights. The most likely genotype at variant 1 has one effect-allele copy, and at variant 2 it has zero, so using those hard calls would produce \((1)(0.50)+(0)(-0.25)=0.50\). The difference, \(0.45-0.50=-0.05\), arises because the dosage retains uncertainty in the genotype probabilities. The example does not establish that one score is always closer to an individual’s eventual outcome; it shows how the two representations yield different additive scores.

Checks, Comparisons, and Limitations

Before interpreting a computed score, check that each weight and dosage refer to the same variant and that the dosage counts the weight’s effect allele. Then verify that the sum includes the intended set of variants and that the reported units match the weight scale. If weights are log-odds effects, for example, the sum is on a log-odds scale, not a probability scale. A score on that scale is not itself a predicted probability.

The main alternatives in the calculation are using hard calls instead of dosages, or changing the allele coding while changing the weights consistently. Hard calls simplify the inputs but discard uncertainty; dosage-based sums preserve the expected allele count. Consistent allele recoding can produce a shifted raw score, as shown above, while preserving differences between individuals when the recoding is applied uniformly. Scores from different coding conventions should therefore not be compared as raw numbers without checking their definitions.

The score also depends on the weights and the included variants. It does not account automatically for uncertainty in estimated weights, interactions, or other predictors. The formula presumes that the variants have been matched correctly and that all dosages required for the sum are available. Handling missing genotypes is a distinct calculation issue; do not silently treat a missing dosage as zero, since zero means no copies of the effect allele.

Common pitfall: “The target file gives a dosage for the other allele, but the variant is the same, so I can multiply it by the GWAS weight.” The variant identity alone is not enough. First convert to the effect-allele dosage, or equivalently transform the weight to the other-allele scale. Otherwise the contribution can have the wrong magnitude and direction.

Other warning signs include an unexpected score direction, unusually large contributions, or results that change sharply after a seemingly harmless allele recoding. Such findings call for checking variant matching, allele labels, dosage ranges, weight units, and the actual arithmetic. A sign check is especially useful: for a positive weight, increasing its aligned dosage by 1 must increase the score by exactly that weight; for a negative weight, it must decrease the score by the absolute value of that weight.

Check Your Understanding

Answer each question, then compare your reasoning with the solutions.

  1. A variant has weight \(+0.30\) units per effect allele and an aligned dosage of 1.4. What is its score contribution?
  2. A target file reports dosage 0.7 for the allele opposite the GWAS effect allele. What is the effect-allele dosage?
  3. At a variant with weight \(-0.20\), how does the score contribution change if the aligned dosage increases from 0.5 to 1.5?
  4. For genotype probabilities 0.2, 0.5, and 0.3 for allele counts 0, 1, and 2, respectively, calculate the dosage.
  5. Why can consistently changing the counted allele shift raw scores without changing their ordering across individuals?

Solutions. (1) The contribution is \((1.4)(0.30)=0.42\) units. (2) The effect-allele dosage is \(2-0.7=1.3\). (3) The dosage increases by 1.0, so the contribution changes by \((1.0)(-0.20)=-0.20\) units; it decreases by 0.20. (4) The dosage is \((0.5)(1)+(0.3)(2)=1.1\). (5) For a biallelic variant the allele dosages sum to 2, so replacing an effect-allele dosage by its complement and reversing the weight changes each contribution by a constant across individuals. A shared constant shift preserves score differences and ordering, provided the recoding is applied consistently.

Clinical Biostats