Tutorials › High-Dimensional Genomic Data Analysis › Kernel Construction and Variant Weights in SKAT

Rare-Variant Burden and Variance-Component Tests · Tutorial 335 of 795

Kernel Construction and Variant Weights in SKAT

Construct and interpret a weighted SKAT kernel, including the role of dosage centering, variant weights, and allele coding.

Advanced 12 min read

What You'll Learn

  • Express a weighted SKAT kernel as a sum of variant-specific contributions.
  • Distinguish variance weights from the scaling used to transform genotype columns.
  • Interpret minor-allele-frequency and annotation weights as assumptions about effect variability.
  • Check that a constructed kernel is positive semidefinite and dimensionally consistent.
  • Identify how centering and allele recoding affect the kernel.
  • Diagnose common kernel-construction errors and compare weighted kernels with simpler alternatives.

Why Kernel Construction Matters

SKAT combines information across variants without requiring all their effects to point in the same direction. Its kernel summarizes how similar individuals are across a variant set, with each variant contributing according to a chosen weight. Thus, kernel construction is not merely a computational detail: it determines which patterns of genetic variation receive more influence and encodes assumptions about how variant effects vary.

The kernel is not itself a p-value, nor is it a direct estimate of the effect of the set. It is an \(n \times n\) matrix used in the quadratic score statistic. The genotype representation, centering, and weights must therefore be specified before interpreting the test.

Definition: Let \(G\) be an \(n \times m\) genotype-dosage matrix, with one row per individual and one column per variant. Let \(g_j\) denote the \(j\)th column after the chosen centering or adjustment, and let \(a_j \geq 0\) be its variance weight. The weighted SKAT kernel is $$ K = G \operatorname{diag}(a_1,\ldots,a_m)G^{\mathsf T} = \sum_{j=1}^{m} a_j g_j g_j^{\mathsf T}. $$ Each \(K_{ik}\) summarizes weighted genetic similarity between individuals \(i\) and \(k\) across the set.

Dosages, Centering, and the Random-Effects Interpretation

A genotype dosage is typically the number of copies of a designated allele, taking values from 0 to 2 for a diploid variant; imputed dosages can be fractional. The rows of \(G\) must refer to the same individuals in the same order as the phenotype and covariate data. For a simple centered construction, subtract each variant’s sample mean dosage: \(g_{ij}=G_{ij}-\bar G_j\). In a covariate-adjusted score test, the relevant genotype columns may instead be residualized with respect to the nuisance covariates. The kernel must use the genotype representation corresponding to the score construction being calibrated.

The weights have a standard random-effects interpretation. Suppose variant effects satisfy \(\boldsymbol{\beta}\sim N(\mathbf{0},\tau\operatorname{diag}(a_1,\ldots,a_m))\), where \(\tau\geq0\) is a common variance component. Then variant \(j\)'s effect has variance \(\tau a_j\). Larger \(a_j\) allows greater prior variability in that effect; \(a_j=0\) excludes its contribution. The kernel above is the covariance structure induced across individuals by these weighted genetic features, apart from the common factor \(\tau\).

An equivalent construction rescales column \(g_j\) by \(\sqrt{a_j}\), then takes the ordinary inner-product kernel of the rescaled matrix. This square root is important: if \(a_j\) is the variance weight, multiplying the genotype column by \(a_j\) instead would give a contribution of \(a_j^2g_jg_j^{\mathsf T}\), not \(a_jg_jg_j^{\mathsf T}\). Some software describes column multipliers as “weights”; check whether the stated quantities are variance weights or column multipliers.

Worked Example: Constructing a Centered Weighted Kernel

Consider three hypothetical individuals and two variants with raw dosages \(G_{\mathrm{raw}}=\begin{pmatrix}0&1\\1&0\\2&1\end{pmatrix}\). The sample means are 1 and \(2/3\), respectively. Use centered columns and variance weights \(a_1=2\) and \(a_2=0.5\).

The centered columns are \(g_1=(-1,0,1)^{\mathsf T}\) and \(g_2=(1/3,-2/3,1/3)^{\mathsf T}\). Their outer products, multiplied by the weights, give

$$ 2g_1g_1^{\mathsf T} = \begin{pmatrix} 2&0&-2\\ 0&0&0\\ -2&0&2 \end{pmatrix}, \qquad 0.5g_2g_2^{\mathsf T} = \begin{pmatrix} 1/18&-1/9&1/18\\ -1/9&2/9&-1/9\\ 1/18&-1/9&1/18 \end{pmatrix}. $$

Adding the matrices gives

$$ K= \begin{pmatrix} 2.0556&-0.1111&-1.9444\\ -0.1111&0.2222&-0.1111\\ -1.9444&-0.1111&2.0556 \end{pmatrix}. $$

For example, \(K_{13}=2(-1)(1)+0.5(1/3)(1/3)=-2+1/18=-1.9444\). Negative off-diagonal entries are possible for a centered kernel; they do not imply that the kernel is invalid. Validity requires positive semidefiniteness, not that every entry be nonnegative.

Why the Kernel Is Positive Semidefinite

A kernel used for the SKAT quadratic form must be positive semidefinite. This means that \(x^{\mathsf T}Kx\geq0\) for every real vector \(x\) of length \(n\). Nonnegative variant weights guarantee this property, regardless of whether the centered genotype columns are correlated.

1
Start with the quadratic form.
For an arbitrary \(x\in\mathbb{R}^n\), write \(x^{\mathsf T}Kx\) using the sum-of-outer-products definition of \(K\).
2
Separate the variant contributions.
Since \(x^{\mathsf T}g_jg_j^{\mathsf T}x=(g_j^{\mathsf T}x)^2\), the expression becomes a weighted sum of squares.
3
Use the weight condition.
Each \(a_j(g_j^{\mathsf T}x)^2\geq0\) when \(a_j\geq0\). Therefore their sum is nonnegative for every \(x\), proving \(K\) is positive semidefinite.
$$ x^{\mathsf T}Kx =\sum_{j=1}^{m}a_j(g_j^{\mathsf T}x)^2 \geq 0. $$

This argument also explains why a zero weight removes a variant and why a negative weight is not allowed in this construction. The rank of \(K\) is at most \(m\), and can be smaller if there are fewer independent genotype patterns than individuals or if some weights are zero.

Choosing Variant Weights

Weights should represent a defensible assumption or prespecified prioritization, rather than an attempt to make the observed association statistic large. A common choice gives rarer variants larger variance weights, based on the expectation that rare functional variants may have larger effects. Another uses functional annotation to give greater weight to variants judged more likely to affect the phenotype. These are assumptions that shape the test, not facts established by the kernel.

For example, a frequency-based choice may use a beta-density function of minor allele frequency \(p_j\). With parameters 1 and 25, the density is proportional to \((1-p_j)^{24}\), and the density itself may be used as a variance weight after any specified normalization. Different implementations may instead define a column multiplier, so the variance-weight versus column-multiplier distinction remains essential.

Worked Example: Frequency Weights and Score Contributions

Suppose two hypothetical variants have minor allele frequencies \(0.01\) and \(0.05\), and use the Beta(1,25) density as the variance-weight rule. Its density is \(f(p)=25(1-p)^{24}\). The ratio of the rarer variant’s weight to the other variant’s weight is

$$ \frac{f(0.01)}{f(0.05)} =\left(\frac{0.99}{0.95}\right)^{24} \approx 2.691. $$

To show the corresponding score scaling more simply, normalize the weight at frequency \(0.01\) to 1. The weight at frequency \(0.05\) is then approximately \(1/2.691=0.3716\). Suppose the two genotype-score inner products with the phenotype residual vector are 2 and 3. The weighted quadratic statistic is

$$ Q=1(2^2)+0.3716(3^2)=4+3.3444=7.3444. $$

Without these frequency weights, the same two inner products would yield \(2^2+3^2=13\). This comparison describes how the weights alter the statistic’s contributions; it does not by itself compare p-values, since the null distribution must be calibrated using the same kernel. Normalizing all weights by one common positive constant also rescales \(Q\) and its null distribution together.

Annotation weights work in the same mathematical way: a larger variance weight increases a variant’s contribution for a given score component. A practical construction should document the annotation, frequency estimate, transformation, and normalization used. If weights are chosen after examining phenotype associations, the nominal calibration may no longer reflect the selection process.

Centering and Allele Coding

Centering determines which genotype variation the kernel represents. With an intercept in the phenotype model, nuisance adjustment accounts for the mean component; in simple examples, centering each column makes that choice visible. In a covariate-adjusted analysis, residualizing genotypes against nuisance covariates is one way to express the relevant adjustment, but the actual score procedure and kernel must be paired consistently.

Allele coding requires particular care. For a centered column, changing its sign leaves its outer product unchanged:

$$ (-g_j)(-g_j)^{\mathsf T}=g_jg_j^{\mathsf T}. $$

Thus, reversing the sign of a centered dosage column does not change its kernel contribution. By contrast, complementing raw diploid dosages from \(G_{ij}\) to \(2-G_{ij}\) is not just a sign flip of the raw column: it also adds a constant. A raw-dosage kernel can change under this transformation unless the analysis accounts for the recoding, for example through consistent centering or nuisance adjustment.

Worked Example: Sign Reversal Versus Raw Dosage Complement

For one hypothetical variant, take raw dosages \(g=(0,1,2)^{\mathsf T}\). Its uncentered outer product is

$$ gg^{\mathsf T} = \begin{pmatrix} 0&0&0\\ 0&1&2\\ 0&2&4 \end{pmatrix}. $$

Complementing the raw dosage gives \(\tilde g=(2,1,0)^{\mathsf T}\), and

$$ \tilde g\tilde g^{\mathsf T} = \begin{pmatrix} 4&2&0\\ 2&1&0\\ 0&0&0 \end{pmatrix}, $$

which is not the same raw kernel contribution. But the centered original column is \(g_c=(-1,0,1)^{\mathsf T}\), while the centered complement is \(-g_c=(1,0,-1)^{\mathsf T}\). Their outer products are identical, as the sign-reversal identity requires. This is why allele orientation and centering should be checked separately rather than conflated.

Diagnostics, Alternatives, and Limitations

Before testing, check that \(K\) is symmetric, has dimension \(n\times n\), and is positive semidefinite up to numerical rounding. Verify the variant order, sample order, dosage allele definition, missing-genotype handling, centering, and weight convention. An unexpected negative eigenvalue beyond numerical tolerance can indicate a coding or construction error. Also inspect the distribution of weights: a highly concentrated set may mean that the test is effectively driven by only a few variants.

The kernel formulation offers a flexible alternative to collapsing all dosages into one burden score. A burden approach combines genotype columns into a single score and is most aligned with a shared-direction effect pattern; a SKAT kernel retains separate squared variant-score contributions and permits effects to vary. An unweighted SKAT kernel sets all \(a_j=1\), while a weighted kernel prioritizes selected variants. Standardizing genotype columns before applying weights is another possible construction, but it changes the relative influence of variants and must be defined explicitly; it is not interchangeable with weighting alone.

No weighting rule is universally optimal. Incorrect allele-frequency estimates, unreliable annotations, or overly aggressive weights can downweight relevant variation or allow a small number of variants to dominate. Correlated genotype columns can also make contributions redundant; assessing the consequences of linkage disequilibrium requires separate consideration. A kernel encodes a model, so conclusions should be understood relative to the chosen genotype representation and weights.

Common Pitfall

Common mistake: “I multiplied each genotype column by its variance weight \(a_j\), so its contribution to the kernel is \(a_j\).” In fact, forming an outer product after that multiplication gives \(a_j^2g_jg_j^{\mathsf T}\). To obtain the variance-weight contribution \(a_jg_jg_j^{\mathsf T}\), multiply the column by \(\sqrt{a_j}\), or directly compute \(G\operatorname{diag}(a_j)G^{\mathsf T}\). A separate coding mistake is to claim a sign flip of a centered column changes the kernel; its outer product is unchanged.
Key takeaway: Specify the dosage matrix, adjustment or centering, and nonnegative variance weights together. The resulting kernel is a weighted sum of genotype outer products; its construction encodes how much effect variability each variant is allowed to contribute.

Check Your Understanding

Answer each question, then check the concise solutions below.

  1. Write the kernel for three variants with variance weights \(1\), \(0.4\), and \(0\). What does the zero weight imply?
  2. Why does a nonnegative-weight kernel remain positive semidefinite even if some centered-kernel entries are negative?
  3. If a variance weight is \(0.25\), what column multiplier produces the corresponding kernel contribution?
  4. Does reversing the sign of a centered dosage column change its kernel contribution? Explain.
  5. What must be checked if a raw dosage is complemented to \(2-G_{ij}\)?

Solutions. (1) \(K=g_1g_1^{\mathsf T}+0.4g_2g_2^{\mathsf T}\); the third variant contributes nothing. (2) For every \(x\), \(x^{\mathsf T}Kx=\sum_j a_j(g_j^{\mathsf T}x)^2\geq0\); individual entries need not be nonnegative. (3) Use \(\sqrt{0.25}=0.5\), since the column multiplier is squared in its outer product. (4) No: \((-g_j)(-g_j)^{\mathsf T}=g_jg_j^{\mathsf T}\). (5) Check how the allele recoding interacts with centering or nuisance adjustment and ensure the kernel uses that recoding consistently; raw outer products generally differ.

Clinical Biostats