Why Compare Genes Through Their Neighbors?
A co-expression network represents genes as nodes and their pairwise relationships as edges. A direct edge can be weak or absent even when two genes connect strongly to many of the same genes. Topological overlap (TO) summarizes this local network context: it combines the edge between a pair with the extent to which their other connections are shared. It can therefore provide a less edge-by-edge view of how a network is organized.
TO is calculated from an adjacency matrix, not directly from expression measurements. The choice of correlation measure, transformation, and signed or unsigned network convention determines the adjacency values supplied to the calculation. The introductory material on signed, unsigned, and signed-hybrid networks establishes that these choices change what an edge represents; TO does not remove that dependence.
Each term has a specific role. The product \(a_{iu}a_{uj}\) gives a large contribution when both links through a third gene \(u\) are strong, and a small contribution when either link is weak. The sum \(l_{ij}\) adds these contributions over all possible third genes. The direct edge \(a_{ij}\) is then included in the numerator. The denominator scales this combined amount using the smaller of the two total connection strengths, with an adjustment for the direct edge.
For an unweighted network, every edge is either present (\(a_{ij}=1\)) or absent (\(a_{ij}=0\)). Then \(l_{ij}\) is the number of shared neighbors. If \(i\) and \(j\) are linked, the formula reduces to the number of shared neighbors plus one, divided by the smaller degree. If they are not linked, it is the number of shared neighbors divided by one plus the smaller degree.
Assumptions and a Useful Property
The standard weighted formula assumes a symmetric, nonnegative adjacency matrix whose entries are bounded above by one, with no self-edges. These conditions are natural for many transformed co-expression networks, but they should be checked rather than presumed. In particular, a signed correlation matrix with negative entries cannot be inserted unchanged into this formula: first use the network convention that defines appropriate nonnegative adjacency values.
The formula has values between zero and one under these assumptions. To see why, write \(s_i=k_i-a_{ij}\) and \(s_j=k_j-a_{ij}\) for the strengths excluding the direct edge. Because every adjacency is at most one, \(a_{iu}a_{uj}\leq a_{iu}\) and \(a_{iu}a_{uj}\leq a_{uj}\). Summing over third genes gives \(l_{ij}\leq s_i\) and \(l_{ij}\leq s_j\). Thus \(l_{ij}\leq\min(k_i,k_j)-a_{ij}\). It follows that $$ 0\leq l_{ij}+a_{ij}\leq\min(k_i,k_j)\leq\min(k_i,k_j)+1-a_{ij}. $$ The denominator is positive, so \(0\leq\operatorname{TOM}_{ij}\leq1\). This bound is a property of the specified formula and assumptions; a computed value outside the range is a warning to inspect the implementation or the input.
Worked Example: Counting Shared Neighbors in a Binary Network
Consider five genes \(A,B,C,D,E\), with undirected edges \(AB, AC, BC, AD, BD,\) and \(CE\), and no other edges. For \(A\), the neighbors are \(B,C,D\), so \(k_A=3\). For \(B\), the neighbors are \(A,C,D\), so \(k_B=3\). The shared neighbors of \(A\) and \(B\) are \(C\) and \(D\), giving \(l_{AB}=2\), and \(a_{AB}=1\).
Therefore, $$ \operatorname{TOM}_{AB}=\frac{2+1}{\min(3,3)+1-1}=\frac{3}{3}=1. $$ The value is one because the two genes are directly connected and share every other neighbor of either gene.
For comparison, \(A\) and \(E\) have no direct edge, so \(a_{AE}=0\). Their neighbor sets are \(\{B,C,D\}\) and \(\{C\}\), respectively; hence \(l_{AE}=1\), \(k_A=3\), and \(k_E=1\). Thus $$ \operatorname{TOM}_{AE}=\frac{1+0}{\min(3,1)+1-0}=\frac{1}{2}=0.5. $$ Although \(A\) and \(E\) have no direct edge, they receive positive overlap because they share \(C\) as a neighbor.
Calculating Weighted Overlap
For weighted networks, the same formula applies, but each shared neighbor contributes a product rather than a count. This distinction matters: two moderately strong links through a gene contribute less than two links that are both strong. A single weak link in a proposed shared path also limits that path’s contribution.
Worked Example: A Weighted Four-Gene Network
Suppose the nonzero adjacencies in a hypothetical network are \(a_{AB}=0.6\), \(a_{AC}=0.8\), \(a_{BC}=0.5\), \(a_{BD}=0.4\), and \(a_{CD}=0.7\). The remaining distinct pair, \(A,D\), has \(a_{AD}=0\). The matrix is symmetric and all entries are between zero and one, as required.
The strengths are \(k_A=0.6+0.8=1.4\), \(k_B=0.6+0.5+0.4=1.5\), \(k_C=0.8+0.5+0.7=2.0\), and \(k_D=0.4+0.7=1.1\). For \(A,B\), the possible third genes are \(C\) and \(D\). Their shared-neighbor weight is $$ l_{AB}=a_{AC}a_{CB}+a_{AD}a_{DB}=(0.8)(0.5)+(0)(0.4)=0.4. $$ Therefore, $$ \operatorname{TOM}_{AB}=\frac{0.4+0.6}{\min(1.4,1.5)+1-0.6} =\frac{1.0}{1.8}=0.5556. $$
For \(A,D\), the direct adjacency is zero. The shared-neighbor paths run through \(B\) and \(C\): $$ l_{AD}=a_{AB}a_{BD}+a_{AC}a_{CD}=(0.6)(0.4)+(0.8)(0.7)=0.24+0.56=0.80. $$ Thus, $$ \operatorname{TOM}_{AD}=\frac{0.80+0}{\min(1.4,1.1)+1-0} =\frac{0.80}{2.1}=0.3810. $$ This positive value does not mean that \(A\) and \(D\) have a direct edge. It summarizes their weighted shared-neighbor structure.
How Shared Neighbors Can Stabilize Comparisons
A network edge is a pairwise quantity. If a small change in the data or network construction weakens one pairwise association, the corresponding adjacency may change substantially, especially after a hard threshold. TO adds information about whether the pair remains embedded in a similar local neighborhood. When two genes connect to many of the same genes, their overlap can remain appreciable even if their own direct edge is weak or absent.
This is a form of structural smoothing, not a statistical guarantee. TO is a deterministic function of the adjacency matrix: it does not estimate sampling uncertainty, test a hypothesis, or prove that two genes have a biological interaction. It can make comparisons less dependent on one edge, but it can also reflect a shared response to a confounder or a feature of the chosen network construction.
Worked Example: A Pair With Shared Neighbors but No Direct Edge
Consider a hypothetical network with four genes and only these nonzero edges: \(a_{AC}=0.9\), \(a_{AD}=0.8\), \(a_{BC}=0.85\), and \(a_{BD}=0.75\). In particular, \(a_{AB}=0\). The strengths are \(k_A=0.9+0.8=1.7\) and \(k_B=0.85+0.75=1.6\).
Genes \(A\) and \(B\) share two neighbors, \(C\) and \(D\). Their weighted shared-neighbor term is $$ l_{AB}=(0.9)(0.85)+(0.8)(0.75)=0.765+0.600=1.365. $$ Since their direct adjacency is zero, $$ \operatorname{TOM}_{AB}=\frac{1.365+0}{\min(1.7,1.6)+1} =\frac{1.365}{2.6}=0.5250. $$ The raw edge value is zero, yet the overlap is positive because both genes connect strongly to the same two genes. If a weak direct edge between \(A\) and \(B\) were sensitive to a threshold, their shared-neighbor evidence would still be present. This illustrates why TO can help stabilize local comparisons; it does not establish that the pairwise association is real or that the genes have a direct relationship.
Comparison, Diagnostics, and Limitations
| Summary | What it uses | What it emphasizes |
|---|---|---|
| Direct adjacency | The edge \(a_{ij}\) | Pairwise connection only |
| Shared-neighbor count | Number of common neighbors in a binary network | Neighborhood overlap, without weighting edge strength |
| Topological overlap | Direct adjacency, weighted shared neighbors, and a strength-based denominator | Pairwise connection in the context of local network structure |
| Jaccard similarity | Intersection divided by union of two neighbor sets | Relative overlap of sets; it is not the weighted TO formula |
These summaries answer different questions. Direct adjacency retains the original pairwise edge measure. A shared-neighbor count is easy to interpret for a binary network but treats all present edges equally. Jaccard similarity normalizes the size of the intersection by the union of neighbor sets. TO instead incorporates weighted paths through shared neighbors and scales by the smaller total strength. It should not be described as a correlation, a probability, or a measure of causal connection.
Useful implementation checks include verifying that the adjacency matrix is symmetric, has a zero diagonal, and contains only finite values in \([0,1]\); confirming that the intended network convention was applied; and checking that the resulting TO matrix is symmetric, bounded between zero and one, and has a sensible diagonal convention. The formula above is for distinct pairs. Some software sets diagonal entries to one for downstream use, while other implementations may use a different convention; state the convention when reporting a matrix.
A further diagnostic is to inspect pairs whose TO values are high despite weak direct adjacency. This may be the intended consequence of shared-neighbor structure, but it may also reflect a dense network in which many genes have similar neighborhoods. Values also depend on the adjacency transformation and network density. A TO value from one threshold, weighting rule, or gene set is not automatically comparable to a value from another. Alternative TOM variants exist, so formula and software settings should be documented rather than assumed interchangeable.
A common mistake is to read a high TO value as evidence that the two genes have a strong direct correlation. That reasoning confuses a neighborhood summary with an edge. In the weighted example, \(\operatorname{TOM}_{AD}=0.3810\) despite \(a_{AD}=0\); the overlap comes from paths through other genes. The correction is to report direct adjacency and TO as distinct quantities and state that TO summarizes shared local network structure.
Check Your Understanding
Answer each question, then compare with the solutions below.
- In a binary network, genes \(P\) and \(Q\) have degrees 4 and 3, are not directly connected, and share two neighbors. Calculate their topological overlap.
- For a weighted pair with \(a_{ij}=0.4\), \(k_i=1.2\), \(k_j=1.0\), and \(l_{ij}=0.3\), calculate \(\operatorname{TOM}_{ij}\).
- Why can two genes have positive topological overlap when their direct adjacency is zero?
- Name two checks to make before interpreting a computed topological-overlap matrix.
- Does a high topological-overlap value establish a direct biological interaction? Explain.
Solutions. (1) The formula gives \((2+0)/(\min(4,3)+1)=2/4=0.5000\). (2) The numerator is \(0.3+0.4=0.7\); the denominator is \(\min(1.2,1.0)+1-0.4=1.6\). Thus \(\operatorname{TOM}_{ij}=0.7/1.6=0.4375\). (3) The pair may connect to the same other genes, so one or more products \(a_{iu}a_{uj}\) are positive even though \(a_{ij}=0\). (4) For example, check symmetry and a zero diagonal in the input, confirm all adjacency values lie in \([0,1]\), and verify the output is symmetric and bounded between zero and one. (5) No. High TO describes direct adjacency together with shared-neighbor structure; it does not establish a direct interaction or causation.