Tutorials › Multi-Omics Data Integration › Worked SNF Example with Two Omics Blocks

Similarity Network Fusion and Kernel Methods · Tutorial 333 of 597

Worked SNF Example with Two Omics Blocks

You will calculate and interpret a complete one-step Similarity Network Fusion update for two small patient networks.

Advanced 10 min read

What You'll Learn

  • Convert symmetric patient affinities into row-stochastic transition matrices.
  • Construct local affinity matrices by retaining each patient's strongest neighbor.
  • Apply the SNF update using the other omics network's transition matrix.
  • Normalize updated rows and symmetrize the fused weights for an undirected network.
  • Diagnose how neighborhood choices, isolated nodes, and directionality affect interpretation.

From Two Patient Networks to One Update

Similarity Network Fusion (SNF) combines patient-to-patient information from multiple omics views by letting each network update its relationships using information from the others. In this tutorial, the calculation is deliberately small: three hypothetical patients, two omics blocks, and one diffusion update. The small size makes each matrix operation inspectable, but the same sequence of calculations applies to larger networks.

The goal is not to treat an updated edge as a direct measurement in either block. An updated weight reflects both the other network's transition structure and the local neighborhoods used to diffuse that information. Keeping those ingredients distinct is essential when interpreting the fused result.

Definition: For omics view \(v\), let \(W^{(v)}\) be a nonnegative patient-affinity matrix, where \(W^{(v)}_{ij}\) measures the similarity of patients \(i\) and \(j\). The row-normalized transition matrix \(P^{(v)}\) has entries \(P^{(v)}_{ij}=W^{(v)}_{ij}/\sum_j W^{(v)}_{ij}\), when the row sum is positive. A local affinity matrix \(S^{(v)}\) retains selected neighbors in each row and normalizes the retained weights to sum to one. An SNF update uses \(S^{(v)}\) to diffuse the average transition information from the other views through view \(v\)'s local structure.

The calculation requires the same patients in the same order in every view. Each starting affinity must be nonnegative, and each transition row to be normalized must have positive sum. For the examples below, diagonal affinities are set to zero, there are no isolated patients, and local neighborhoods are selected by largest affinity. We use \(k=1\): each patient retains its single strongest other patient, with ties resolved by a pre-specified rule. A row of \(S^{(v)}\) is normalized over the retained neighbors; because \(k=1\), its retained entry is one.

With two views, one diffusion update for view \(v\) uses the other view's transition matrix. Write \(Q^{(v)}\) for the matrix before row normalization:

$$ Q^{(1)}=S^{(1)}P^{(2)}S^{(1)T}, \qquad Q^{(2)}=S^{(2)}P^{(1)}S^{(2)T}. $$

Each updated transition matrix \(P_{\mathrm{new}}^{(v)}\) is obtained by dividing each row of \(Q^{(v)}\) by that row's sum. This version of the update makes explicit that one view's local structure surrounds the transition information supplied by the other view. For a final undirected network, we first average the two updated transition matrices and then symmetrize: the fused edge weight for \(i\ne j\) is the mean of the two directed entries in that average. This final symmetrization is a stated reporting convention, not an extra diffusion step.

Worked Calculations Before Diffusion

Worked Example: Row-Normalizing the First Omics Block

Suppose patients are A, B, and C. In a hypothetical first omics block, the symmetric affinities are \(W^{(1)}_{AB}=3\), \(W^{(1)}_{AC}=1\), and \(W^{(1)}_{BC}=2\), with zero diagonal. The row sums are 4, 5, and 3, respectively. Row normalization gives:

$$ P^{(1)} = \begin{pmatrix} 0 & 3/4 & 1/4\\ 3/5 & 0 & 2/5\\ 1/3 & 2/3 & 0 \end{pmatrix} = \begin{pmatrix} 0 & 0.7500 & 0.2500\\ 0.6000 & 0 & 0.4000\\ 0.3333 & 0.6667 & 0 \end{pmatrix}. $$

For instance, \(P^{(1)}_{AB}=3/(3+1)=0.7500\), while \(P^{(1)}_{BA}=3/(3+2)=0.6000\). The starting affinity is symmetric, but its row-normalized transition matrix need not be: each entry is a fraction of its own row's total. Each row sums to one, so it can be read as the distribution of one-step transition weight from that patient to other patients.

Worked Example: Selecting Local Neighbors in Both Blocks

In the hypothetical second block, take \(W^{(2)}_{AB}=1\), \(W^{(2)}_{AC}=2\), and \(W^{(2)}_{BC}=4\), again with zero diagonal. Its row sums are 3, 5, and 6, so:

$$ P^{(2)} = \begin{pmatrix} 0 & 1/3 & 2/3\\ 1/5 & 0 & 4/5\\ 1/3 & 2/3 & 0 \end{pmatrix}. $$

With \(k=1\), patient A's strongest neighbor in block 1 is B; B's strongest is A; and C's strongest is B. In block 2, A's strongest neighbor is C, B's is C, and C's is B. Retaining just those neighbors and normalizing each retained row gives:

$$ S^{(1)} = \begin{pmatrix} 0&1&0\\ 1&0&0\\ 0&1&0 \end{pmatrix}, \qquad S^{(2)} = \begin{pmatrix} 0&0&1\\ 0&0&1\\ 0&1&0 \end{pmatrix}. $$

These matrices are row-stochastic, but they are not symmetric. For example, A selects B in block 1, and B also selects A; C selects B, but B's selected neighbor is A. The construction is patient-specific, so a local-neighbor relation does not generally imply the reverse relation.

One Complete SNF Diffusion Update

Worked Example: Updating and Interpreting the Fused Edges

Use the two transition matrices and local affinity matrices just calculated. The patients are ordered A, B, C in all four matrices. Since each row of \(S^{(1)}\) selects a single patient, its selected patients are B, A, B. Thus the entry in row \(i\), column \(j\) of \(S^{(1)}P^{(2)}S^{(1)T}\) is the entry of \(P^{(2)}\) connecting the patient selected by row \(i\) to the patient selected by row \(j\). This gives:

$$ Q^{(1)} = S^{(1)}P^{(2)}S^{(1)T} = \begin{pmatrix} 0&1/5&0\\ 1/3&0&1/3\\ 0&1/5&0 \end{pmatrix}. $$

The row sums are \(1/5\), \(2/3\), and \(1/5\). Dividing each row by its sum produces:

$$ P_{\mathrm{new}}^{(1)} = \begin{pmatrix} 0&1&0\\ 1/2&0&1/2\\ 0&1&0 \end{pmatrix}. $$

For the second update, the selected patients in the rows of \(S^{(2)}\) are C, C, B. The corresponding entries of \(P^{(1)}\) give:

$$ Q^{(2)} = S^{(2)}P^{(1)}S^{(2)T} = \begin{pmatrix} 0&0&2/3\\ 0&0&2/3\\ 2/5&2/5&0 \end{pmatrix}. $$

The row sums are \(2/3\), \(2/3\), and \(4/5\). After row normalization:

$$ P_{\mathrm{new}}^{(2)} = \begin{pmatrix} 0&0&1\\ 0&0&1\\ 1/2&1/2&0 \end{pmatrix}. $$

Average the two updated matrices entrywise. The resulting directed transition weights are:

$$ \overline{P}_{\mathrm{new}} = \frac{P_{\mathrm{new}}^{(1)}+P_{\mathrm{new}}^{(2)}}{2} = \begin{pmatrix} 0&1/2&1/2\\ 1/4&0&3/4\\ 1/4&3/4&0 \end{pmatrix}. $$

To report an undirected fused network, average each pair of opposing entries. Therefore, the fused A-B weight is \((1/2+1/4)/2=0.3750\); the A-C weight is also \((1/2+1/4)/2=0.3750\); and the B-C weight is \((3/4+3/4)/2=0.7500\). Under this one-step calculation, B-C has the largest fused edge weight. It is not a probability that the patients belong to the same group, nor evidence of a biological mechanism. It is a relative network weight produced by this choice of affinities, neighborhoods, and update rule.

Why the Update Has This Form

The matrix product can be understood one entry at a time. Before row normalization, the \((i,j)\) entry of the update for view \(v\) is:

$$ Q^{(v)}_{ij} = \sum_{a=1}^{n}\sum_{b=1}^{n} S^{(v)}_{ia}P^{(-v)}_{ab}S^{(v)}_{jb}, $$

where \(P^{(-v)}\) is the other view's transition matrix in a two-view calculation. Each term weights the transition from \(a\) to \(b\) by how strongly patients \(i\) and \(j\) are locally connected to \(a\) and \(b\) in view \(v\). Large contributions arise when the local neighborhoods of \(i\) and \(j\) align with substantial transitions in the other view. This is the sense in which the views exchange information; it does not require that the two blocks have identical edge patterns.

The row normalization has a direct purpose. The matrix product does not generally have rows summing to one, even if its factors are row-stochastic, because the rightmost factor is transposed. Dividing a nonnegative row by its positive sum restores a transition interpretation. In the worked example, the first row sum of \(Q^{(1)}\) is \(1/5\), so its single nonzero value becomes \((1/5)/(1/5)=1\). For its second row, the two nonzero values each become \((1/3)/(2/3)=1/2\).

Key takeaway: Keep three objects distinct: \(P^{(v)}\) represents row-normalized starting affinities, \(S^{(v)}\) specifies local neighborhoods for diffusion, and \(P_{\mathrm{new}}^{(v)}\) contains row-normalized updated weights. Averaging and symmetrizing the updated matrices produces the reported undirected weights in the convention used here.

Diagnostics, Alternatives, and Limitations

Check the arithmetic and the network construction before interpreting a fused edge. Every nonempty row of \(P^{(v)}\), \(S^{(v)}\), and \(P_{\mathrm{new}}^{(v)}\) should sum to one within rounding tolerance. Starting affinities and the pre-normalized products should be nonnegative. Confirm that patient order is identical across views, that diagonal entries were handled consistently, and that the selected neighbors really are the largest affinities in each row. In the worked example, \(S^{(1)}\) is asymmetric by construction; treating it as symmetric would change the update.

A row with zero sum cannot be normalized. This can result from an isolated patient, an empty local neighborhood, or an affinity construction that assigned only zero weights. It must be addressed explicitly—for example, by revisiting the graph construction or applying a stated isolate-handling rule—rather than silently dividing by zero. Ties at the neighborhood boundary can also change \(S^{(v)}\); report the tie rule and examine whether plausible alternatives change the fused edges. Likewise, a small \(k\) can make the result sensitive to individual selected neighbors. Inspect edge rankings across reasonable neighborhood choices and diffusion iterations, and avoid claiming that one edge is robust if its rank changes substantially.

The result depends on the input affinities and their scales, on \(k\), on the number of updates, and on the rule used to create the final undirected network. In particular, row normalization removes overall row magnitude: it retains relative outgoing weights, not the total affinity of a patient to all others. The final symmetrized matrix also need not have rows summing to one, so its entries should be described as fused edge weights, not transition probabilities.

One alternative is to average the starting affinity matrices directly. That is simpler, but it does not use the local-neighborhood diffusion shown here and may be dominated by a block with a larger numerical scale. Another alternative is to concatenate measured features before computing patient similarities; this changes the construction of the network rather than exchanging information between already constructed networks. These approaches answer different construction choices and should not be treated as equivalent to an SNF update.

Common pitfall: “The fused A-B weight is 0.375, so A and B have a 37.5% probability of being biologically related.” This is incorrect: the number is a normalized, symmetrized network weight, not a calibrated probability or a causal effect. The correction is to state how the weight was computed and describe it comparatively: under this specified one-step update, the A-B edge weight is 0.3750, below the B-C weight of 0.7500.

Check Your Understanding

Use the definitions and calculations above to answer each question. Solutions follow the questions.

  1. If a patient has starting affinities 2 and 6 to two other patients, what are the corresponding row-normalized transition weights?
  2. In the hypothetical first block, why does patient C select B when \(k=1\)?
  3. Why is the first row of \(P_{\mathrm{new}}^{(1)}\) equal to \((0,1,0)\), despite the first row of \(Q^{(1)}\) containing \(1/5\) rather than 1?
  4. Using the final averaged directed matrix, calculate the symmetrized A-C edge weight.
  5. Does the fused edge weight of 0.7500 for B-C mean that the probability of a biological relationship is 75%? Explain.

Solutions. 1. The row sum is \(2+6=8\), so the weights are \(2/8=0.2500\) and \(6/8=0.7500\). 2. C's affinities to A and B in block 1 are 1 and 2, respectively; B is the larger, so it is C's selected neighbor. 3. Row normalization divides every entry in that row by its sum. Here the row is \((0,1/5,0)\), with sum \(1/5\), so the normalized row is \((0,(1/5)/(1/5),0)=(0,1,0)\). 4. The directed A-to-C and C-to-A entries are \(1/2\) and \(1/4\), so the symmetrized weight is \((1/2+1/4)/2=0.3750\). 5. No. It is the computed relative edge weight under the stated affinity, neighborhood, update, averaging, and symmetrization choices; it is not a probability of biological relatedness.

Clinical Biostats