Why Genotype Coding Matters
A rare-variant test begins with a numerical representation of each person’s genotype at each variant. That representation determines what one unit of a predictor means, how variant-level contributions combine, and which effect patterns a set-level statistic can detect. A coding choice is therefore part of the statistical model, not just a formatting detail.
For an autosomal biallelic variant in a diploid sample, a common choice is the count of one specified allele: 0, 1, or 2 copies per person. With imputed genotypes, the predictor is often the expected count of that allele given the genotype data. Set tests then use these counts or dosages to construct person-level burdens or variant-level score statistics.
Allele Counts, Dosages and Their Assumptions
The allele being counted must be stated. For example, if the two alleles are A and G, coding the number of G alleles gives 0, 1 or 2; coding A instead gives 2, 1 or 0. This convention defines the direction of a variant’s effect. In a regression model with a linear predictor containing \(\beta_j g_{ij}\), \(\beta_j\) describes the change in that predictor per additional counted allele, conditional on the model’s other terms.
This additive coding treats the difference between counts 0 and 1 as the same size as the difference between 1 and 2 on the model’s linear-predictor scale. It does not represent a separate dominance effect. Nor does dosage coding mean that a person literally carries a fractional allele: a dosage is an expectation over possible genotypes given uncertain data.
For a diploid genotype with probabilities \(P(G=0\mid D)\), \(P(G=1\mid D)\), and \(P(G=2\mid D)\), the dosage is \(g=P(G=1\mid D)+2P(G=2\mid D)\). A dosage summarizes the posterior mean, but not all the uncertainty: two people can have the same dosage and different posterior genotype distributions. Analyses must therefore use a test implementation appropriate to how genotype uncertainty is represented. A common dosage-regression analysis treats the dosage as the predictor; other procedures can incorporate posterior genotype uncertainty explicitly. These approaches need not yield identical standard errors or calibration.
The usual 0-to-2 convention assumes diploidy. Sex chromosomes, sex-specific ploidy, and other non-diploid settings require a representation consistent with the sample’s ploidy and the statistical model. For multiallelic sites, the counted allele must likewise be defined; treating different alternate alleles as one predictor is not automatically equivalent to analyzing their counts separately.
Worked Example: Converting Genotype Probabilities to Dosage
Suppose a hypothetical participant has imputed genotype probabilities \(P(G=0\mid D)=0.20\), \(P(G=1\mid D)=0.50\), and \(P(G=2\mid D)=0.30\) for the counted allele. The probabilities sum to 1, so they form a valid distribution. Calculate the dosage and the posterior variance of the allele count.
The dosage is the probability-weighted allele count: \(g=0(0.20)+1(0.50)+2(0.30)=1.10\) copies.
To quantify uncertainty, first calculate \(E(G^2\mid D)=0^2(0.20)+1^2(0.50)+2^2(0.30)=1.70\). Thus \(\operatorname{Var}(G\mid D)=E(G^2\mid D)-E(G\mid D)^2=1.70-(1.10)^2=0.49\) copies squared.
A hard-call rule selecting the most probable genotype would assign \(G=1\), since 0.50 is the largest probability. That is a different representation from the dosage of 1.10. The dosage retains information about uncertainty and expected allele count, but the variance calculation shows that the mean alone does not describe the full posterior distribution.
How Coding Enters a Burden Score
Let \(p\) be the number of variants in a set and let \(w_j\) be a prespecified weight for variant \(j\). A weighted dosage burden for person \(i\) is \(b_i=\sum_{j=1}^{p}w_jg_{ij}\). It is a single summary of that person’s coded alleles across the set. The weights and allele orientations must be defined consistently: changing the counted allele at one variant changes its contribution unless the corresponding weight or effect direction is changed as well.
For a score-based test, let \(U_j\) be the score contribution for variant \(j\) under a null model, and write \(U=(U_1,\ldots,U_p)^T\). The burden score is the weighted combination \(U_B=\sum_j w_jU_j=w^TU\), where \(w=(w_1,\ldots,w_p)^T\). Its null variance is \(w^TVw\), where \(V\) is the null covariance matrix of \(U\). This expression makes the coding dependence visible: changing the genotype coding changes the score contributions and, in general, their covariance. The specific score and covariance depend on the phenotype model and its assumptions.
Worked Example: Calculating a Dosage Burden and Its Score
Consider three hypothetical participants and two variants. Their dosages are \(g_{i1}=(0.8,1.2,0.0)\) and \(g_{i2}=(0.1,0.6,1.4)\). Use weights \(w_1=1\) and \(w_2=2\), and suppose the null-model residuals for this illustration are \(r=(1,-0.5,-0.5)\). These residuals sum to zero, as expected for a null model with an intercept. Calculate each burden and the combined score contribution.
For participant 1, \(b_1=1(0.8)+2(0.1)=1.0\). For participant 2, \(b_2=1(1.2)+2(0.6)=2.4\). For participant 3, \(b_3=1(0.0)+2(1.4)=2.8\).
Using these residuals, the burden score is \(U_B=\sum_i b_ir_i=1.0(1)+2.4(-0.5)+2.8(-0.5)=1.0-1.2-1.4=-1.6\).
The variant-level contributions are \(U_1=\sum_i g_{i1}r_i=0.8(1)+1.2(-0.5)+0.0(-0.5)=0.2\) and \(U_2=\sum_i g_{i2}r_i=0.1(1)+0.6(-0.5)+1.4(-0.5)=-0.9\). Combining them gives \(w_1U_1+w_2U_2=1(0.2)+2(-0.9)=-1.6\), matching the person-level calculation. This identity follows by exchanging the order of summation. The score alone is not a test result: a null variance is needed to standardize it.
How Coding Enters a Variance-Component Statistic
A variance-component approach retains variant-level score contributions rather than combining them into one signed burden score. One common quadratic form is \(Q=U^TW^2U=\sum_jw_j^2U_j^2\), where \(W\) is the diagonal matrix with entries \(w_j\). Unlike a signed burden score, this statistic does not cancel positive and negative variant contributions simply because their signs differ. Its null distribution depends on the covariance of the scores, including correlation between variants.
For example, if \(U\) has mean zero and covariance \(V\) under the null, then \(WU\) has covariance \(WVW\). A quadratic form in these scores is generally not a single chi-squared random variable. Its null distribution is a weighted sum of independent chi-squared variables, with weights given by the eigenvalues of \(WVW\) under the usual score-test conditions. Thus the variant coding, weights, linkage disequilibrium, and null-model covariance all matter to calibration.
Worked Example: A Two-Variant Variance-Component Statistic
Suppose a hypothetical analysis gives score vector \(U=(2,-1)^T\), weights \(w_1=1,w_2=2\), and null score covariance \(V=\begin{pmatrix}4&1\\1&2\end{pmatrix}\). The covariance is symmetric, with positive diagonal variances. Compute \(Q\) and its null mixture weights.
The weighted scores are \(WU=(2,-2)^T\). Therefore \(Q=(WU)^T(WU)=2^2+(-2)^2=8\).
The covariance of the weighted scores is \(WVW=\begin{pmatrix}1&0\\0&2\end{pmatrix}\begin{pmatrix}4&1\\1&2\end{pmatrix}\begin{pmatrix}1&0\\0&2\end{pmatrix}=\begin{pmatrix}4&2\\2&8\end{pmatrix}\). Its eigenvalues solve \((4-\lambda)(8-\lambda)-4=0\), or \(\lambda^2-12\lambda+28=0\), giving \(\lambda=(12\pm\sqrt{32})/2\), approximately 8.828 and 3.172. Under the stated score-test approximation, the null distribution of \(Q\) is \(8.828\chi^2_1+3.172\chi^2_1\), with independent chi-squared variables in the sum. The observed value 8 is not itself a p-value; a calibrated tail probability from this mixture is required.
Allele Flips, Scaling and Interpretation
For a diploid autosomal variant, reversing the counted allele replaces \(g_{ij}\) by \(g'_{ij}=2-g_{ij}\). In a score calculation with an intercept, the constant part contributes no score because the residuals sum to zero. Consequently \(U'_j=\sum_i(2-g_{ij})r_i=-U_j\). More generally, nuisance-adjusted score constructions must transform the score and its covariance consistently.
This sign change has different implications for different statistics. A one-variant burden contribution changes sign, so a multi-variant burden can change substantially if one allele is flipped while the other variants’ orientations remain fixed. By contrast, in a diagonal-weight quadratic statistic \(Q=\sum_jw_j^2U_j^2\), changing the sign of one \(U_j\) leaves its squared contribution unchanged. The full covariance also changes sign in the corresponding off-diagonal entries; transforming both scores and covariance consistently preserves the statistic and its null calibration.
Scaling also matters. Replacing allele counts by standardized genotypes changes their units and usually changes their contributions to both kinds of set statistic. A corresponding change in weights may preserve a chosen analysis, but weights should not be adjusted casually after observing the outcome. The coding and weights together define the tested combination.
Diagnostics, Alternatives and Limitations
Before testing, verify that the dosage column counts the intended allele, is on the expected scale, and matches the sample’s ploidy. Check that dosage distributions are plausible for the variant and that missingness, allele frequency, and imputation quality are not anomalous. Confirm consistent allele harmonization across files and participants. In particular, allele labels alone can be ambiguous for variants whose two alleles are complements; use reliable reference and strand information rather than guessing.
Hard calls and dosages are alternatives for representing genotype data, not interchangeable values. Hard calls are integer counts selected by a calling rule, while dosages are conditional expected counts. Dosages can retain uncertainty information lost by a hard call, but they can also be poorly estimated. If imputation is weak, treating noisy dosages as precise predictors can reduce power or impair calibration; the appropriate response is to investigate data quality and use an analysis that matches the available uncertainty information.
Burden and variance-component statistics are also different ways of combining variant-level evidence. A burden compresses variants into a signed combination and is sensitive to allele orientation and aligned effect direction. A quadratic variance-component statistic uses squared score contributions and is less sensitive to sign cancellation, but its calibration depends on the full score covariance. Neither choice repairs incorrect allele coding, population structure, poor-quality genotypes, or an unsuitable null model. A significant set statistic does not by itself identify which variant is associated or establish a causal effect.
Record which allele is counted, whether values are hard counts or dosages, and the applicable ploidy.
Inspect allele alignment, dosage range, missingness, frequency, and imputation quality before forming set statistics.
Use the same coding and prespecified weights in the burden or variance-component score and its covariance calculation.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions.
- For genotype probabilities 0.40, 0.40, and 0.20 at counts 0, 1, and 2, respectively, calculate the dosage.
- What happens to a diploid genotype count when the other allele is counted instead?
- Why is a burden score sensitive to an allele flip at only one variant?
- For \(U=(1,-2)^T\) and \(W=\operatorname{diag}(1,0.5)\), calculate \(Q=U^TW^2U\).
- Name two checks that should be made before treating imputed values as dosages in a set test.
Solutions. (1) \(0(0.40)+1(0.40)+2(0.20)=0.80\) copies. (2) The count becomes \(2-G\), so counts 0, 1, and 2 become 2, 1, and 0. (3) The corresponding signed variant score changes direction; unless the weight or orientation is transformed consistently, its contribution can reinforce or oppose the other burden terms differently. (4) \(Q=(1\cdot1)^2+(0.5\cdot(-2))^2=1+1=2\). (5) Examples include checking which allele is counted, confirming the dosage scale and ploidy, inspecting missingness, and reviewing imputation quality.