Tutorials › High-Dimensional Genomic Data Analysis › Jointly Representing Ancestry and Kinship

Population Structure, Ancestry and Relatedness · Tutorial 123 of 795

Jointly Representing Ancestry and Kinship

Use PCA coordinates to describe broad genetic structure and a kinship matrix to represent pairwise dependence, while keeping their meanings and scales distinct.

Intermediate 10 min read

What You'll Learn

  • Define sample-level PCA coordinates and pairwise entries of a kinship or genomic relationship matrix.
  • Explain how PCA and a relationship matrix can arise from the same standardized genotypes.
  • Interpret ancestry-patterned positions separately from evidence of close genetic relatedness.
  • Align sample identifiers across PCA results and kinship matrices before joint interpretation.
  • Recognize when a low-dimensional PCA view cannot represent the full pairwise dependence structure.
  • Identify common interpretation and data-alignment failures in joint displays.

Two Views of the Same Samples

Genomic analyses often need to describe two features of the same set of people. Principal components (PCs) summarize broad patterns of genetic variation: samples with similar coordinates across leading PCs tend to have similar profiles along those variation axes. A kinship matrix, in contrast, records pairwise genetic dependence, with one entry for each pair of samples. These views are related, but they answer different questions. A PCA plot is a low-dimensional map; a kinship matrix is a sample-by-sample collection of pairwise estimates.

The distinction matters in genomic comparisons. Two people can occupy nearby positions in a broad ancestry pattern without being close relatives. Conversely, close relatives can have similar genotypes for reasons that are not captured by a plot of only the first two PCs. A useful joint representation therefore preserves both kinds of information and makes it possible to inspect them together without treating one as a substitute for the other.

Definition: A joint sample-level representation associates each sample’s PCA coordinates with its row and column in a kinship or genomic relationship matrix. The coordinates describe the sample’s position along selected genetic-variation axes; the matrix entries describe estimated pairwise genetic dependence on the matrix’s stated scale.

Definitions and Assumptions

Let \(n\) samples be typed at \(m\) genetic markers. For illustration, suppose genotypes are diploid allele dosages \(g_{ij}\in\{0,1,2\}\), where \(g_{ij}\) is the dosage for sample \(i\) at marker \(j\). If \(p_j\) is the allele frequency used for marker \(j\), a commonly used standardized value is

$$ z_{ij}=\frac{g_{ij}-2p_j}{\sqrt{2p_j(1-p_j)}}. $$

This scaling centers dosage at its expected value under the allele frequency and scales it by its binomial standard deviation. A common genomic relationship matrix is \(K=ZZ^\mathsf{T}/m\), where \(Z\) is the \(n\times m\) matrix of standardized genotypes. Other estimators and marker weightings are used, so a reported matrix must be interpreted using its actual definition. In particular, a kinship coefficient and a genomic relationship matrix entry are not automatically on the same numerical scale. Under the conventional pedigree definition, the additive relationship for a pair is \(2\phi\), where \(\phi\) is their kinship coefficient; genomic estimators may use that or another stated scaling.

PCA of standardized genotypes identifies orthogonal directions that explain variation across samples. A sample’s score on a PC is its coordinate along that direction. The first few PCs give a compact view of leading variation, but do not preserve every feature of the genotype data. The kinship matrix retains pairwise entries for all sample pairs, including information that is not visible in a two-dimensional plot.

Joint interpretation assumes that the PCA results and matrix refer to the same samples and compatible genotype data, and that sample identifiers are correctly aligned. The marker set, allele-frequency choices, scaling, and any sample exclusions should be documented. If these differ across the two calculations, the outputs may still be compared, but they are not two summaries of precisely the same input representation. The genotype data should also have passed the quality checks appropriate to the analysis; artifacts in genotypes can affect both summaries.

Why the Views Are Related but Not Interchangeable

When PCA is computed from the same standardized genotype matrix used to form \(K=ZZ^\mathsf{T}/m\), the relationship is exact. Let \(K u_k=\lambda_k u_k\), where \(u_k\) is a unit-length eigenvector and \(\lambda_k\) its eigenvalue. The eigenvectors give sample directions and the eigenvalues quantify variation along those directions. If \(U\) contains all eigenvectors and \(\Lambda\) is the diagonal matrix of eigenvalues, then

$$ K=U\Lambda U^\mathsf{T},\qquad K_{i\ell}=\sum_{k=1}^{n}\lambda_k u_{ik}u_{\ell k}. $$

Thus each matrix entry is assembled from contributions across all eigen-directions. Keeping only the first \(q\) PCs gives the approximation \(K_{i\ell}\approx\sum_{k=1}^{q}\lambda_k u_{ik}u_{\ell k}\), not generally the full entry. If PCs are calculated from a different marker set, weighting, or scaling than the matrix, even this exact decomposition need not apply to the reported pair.

This also explains why a PC scatterplot cannot be read as a kinship matrix. The plot shows selected coordinates, often only two, while a matrix entry depends on the combined contributions from all directions in the decomposition. And neither PC distance nor visual proximity is itself a kinship coefficient.

Worked Example: Reading a PCA Plot Alongside Pairwise Kinship

Suppose four hypothetical samples have the following scores on the first two PCs. The listed pairwise entries are kinship coefficients \(\phi\), not entries on an unspecified genomic relationship scale.

SamplePC1PC2Kinship with A
A-1.200.10—
B-1.000.200.125
C1.10-0.100.004
D0.90-0.200.003

A and B are close on the displayed PCs. Their two-coordinate Euclidean distance is \( \sqrt{(-1.20-(-1.00))^2+(0.10-0.20)^2}=\sqrt{0.05}=0.224 \). Their estimated kinship coefficient, \(0.125\), is also elevated relative to the coefficients shown for A–C and A–D. Under conventional pedigree interpretation, \(0.125\) is consistent with some second-degree relationships, but the estimate alone does not identify a particular pedigree.

A and C are far apart on the displayed axes: their distance is \( \sqrt{(-1.20-1.10)^2+(0.10-(-0.10))^2}=\sqrt{5.33}=2.309 \). Their estimated kinship coefficient is \(0.004\), close to zero on this scale. The two views agree in this pair’s broad contrast, but they are not interchangeable: the PCA distance is measured in PC-score units, whereas \(0.004\) is a kinship estimate. The PC positions alone do not establish ancestry labels or a pedigree.

Building a Joint Sample-Level Display

A practical representation links each sample’s PC coordinates to the corresponding row and column of the matrix. The linkage can be a sample table beside a PC scatterplot and a kinship heatmap, or an interactive display in which selecting a plotted sample highlights its matrix row and column. Whichever format is used, sample identifiers and matrix ordering must be explicit.

1
Choose the shared sample set.
Confirm which samples are included in both outputs and use unique, stable identifiers. Record any exclusions rather than silently dropping rows from only one result.
2
Check the order.
Verify that the \(i\)th PC record refers to the same sample as row \(i\) and column \(i\) of the matrix. Matching dimensions alone does not establish matching order.
3
Show each quantity on its own scale.
Label the PC axes with the PC number and, where available, the proportion of variation explained. Label the matrix as kinship or genomic relationship and state its scale and color legend.
4
Inspect both summaries together.
Use the PC plot to describe broad sample patterns and the matrix to find pairs or groups with elevated pairwise estimates. Treat either pattern as a prompt for interpretation, not as proof of a specific population or pedigree.

Worked Example: Finding Elevated Pairs Without Confusing the Scales

Consider a hypothetical four-sample kinship matrix, with rows and columns in the order A, B, C, D. Its diagonal is included, but the question here concerns off-diagonal pairs.

$$ \Phi= \begin{pmatrix} 0.50 & 0.125 & 0.004 & 0.003\\ 0.125 & 0.50 & 0.005 & 0.004\\ 0.004 & 0.005 & 0.50 & 0.090\\ 0.003 & 0.004 & 0.090 & 0.50 \end{pmatrix}. $$

Suppose the analyst uses \(0.0884\) as a reporting threshold to flag pairs for review. This is a chosen screening rule, not a universal boundary or a hypothesis test. The off-diagonal values at or above the threshold are \(\phi_{AB}=0.125\) and \(\phi_{CD}=0.090\); all other listed pairs are below it. The result is two flagged pairs.

The matrix suggests examining A–B and C–D as pairs with elevated estimated dependence. The threshold does not prove that either pair has a particular relationship. If the linked PC plot places A and B near one another, that is compatible with the matrix result but does not add a second independent estimate of kinship. If C and D are separated on leading PCs despite their elevated pairwise value, the two displays are reporting different features: broad variation in selected directions and pairwise dependence. Neither observation should be discarded merely because it does not match the other.

A Short Matrix Decomposition

The relationship between a full matrix and all PCs follows directly from the spectral decomposition. For a symmetric matrix \(K\), suppose \(K=U\Lambda U^\mathsf{T}\), with orthonormal columns in \(U\). Its \(i,\ell\) entry is the dot product of row \(i\) and row \(\ell\) of \(U\), weighted by the eigenvalues:

$$ K_{i\ell}=\sum_k \lambda_k u_{ik}u_{\ell k}. $$

For example, take the hypothetical two-sample matrix \(K=\begin{pmatrix}1&0.2\\0.2&1\end{pmatrix}\). Its unit eigenvectors are \(u_1=(1,1)^\mathsf{T}/\sqrt{2}\) and \(u_2=(1,-1)^\mathsf{T}/\sqrt{2}\), with eigenvalues \(1.2\) and \(0.8\). The off-diagonal entry reconstructed from both directions is \(1.2(1/\sqrt{2})(1/\sqrt{2})+0.8(1/\sqrt{2})(-1/\sqrt{2})=0.6-0.4=0.2\). Keeping only the first direction would instead give \(0.6\). This is why a truncated PC representation does not, in general, reproduce the full matrix’s pairwise values.

Diagnostics, Alternatives, and Limitations

Several checks help prevent a visually persuasive but incorrect joint interpretation:

  • Check sample identity and order. A row-order mismatch can attach a valid matrix row to the wrong PC point. Verify identifiers, not just the number of samples.
  • Check the matrix definition and scale. A kinship coefficient, an additive relationship estimate, and a standardized genomic matrix entry should not be compared as if their numerical values were interchangeable.
  • Check what the PCs represent. A leading axis describes variation in the analyzed genotypes; it does not, by itself, assign a sample to a named ancestry group or establish a relationship.
  • Check whether the views share inputs. If the matrix and PCA use different markers, frequency estimates, or samples, explain that difference. Apparent disagreement may reflect construction choices rather than a biological contradiction.
  • Check the display for lost information. A two-PC plot suppresses later directions, while a heatmap can hide fine structure if its color range is poorly chosen. State the scales and inspect the underlying values when needed.

A PCA plot alone is efficient for viewing broad structure, but cannot display all pairwise dependence. A kinship heatmap alone shows pairwise patterns, but can be difficult to scan for broad gradients across many samples and does not show each sample’s location on selected PCs. A linked plot and matrix, or a table that preserves both, is useful when both questions matter. A full matrix is also more information than some analyses need; for a large sample, report or display selected pairs or a well-defined summary while retaining the scale and selection rule.

The two summaries are often computed from overlapping genotype information. They should therefore not be presented as independent confirmations of a finding. Joint representation is a way to compare complementary summaries, not a guarantee that either estimate is unbiased or that population structure and close relatedness have been fully separated. The interpretation depends on marker selection, allele-frequency choices, genotype quality, and the population represented in the analysis.

Common Pitfall

Common mistake: “A and B are close on the first two PCs, so they must be close relatives.” PC proximity indicates similarity along the displayed axes, not a particular kinship coefficient or pedigree. The correction is to inspect the pair’s matrix entry on its stated scale, consider what data and estimator produced it, and describe the PC and matrix evidence separately.

Check Your Understanding

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

  1. What does a PC coordinate describe, and what does an off-diagonal kinship-matrix entry describe?
  2. Why can two samples’ first two PC scores fail to reproduce their full pairwise relationship-matrix entry?
  3. A PC file and a matrix have the same number of samples. Is that enough to ensure their sample-level displays are aligned? What else must be checked?
  4. Suppose two samples are far apart on PC1 and PC2 but have an elevated matrix entry. Give a cautious interpretation that does not treat the results as contradictory.

Solutions. (1) A PC coordinate gives a sample’s position along a selected genetic-variation direction; an off-diagonal entry gives an estimated pairwise dependence on the matrix’s defined scale. (2) The full entry combines contributions across eigen-directions, whereas a two-PC display retains only two. (3) No. Unique sample identifiers and their ordering must agree across the PC records and the matrix rows and columns. (4) The samples differ along the displayed broad-variation axes but may still have elevated pairwise genetic dependence; the matrix scale, estimator, and data construction should be checked before drawing a relationship conclusion.

Clinical Biostats