Tutorials › Multi-Omics Data Integration › Constructing Patient Similarity Networks

Similarity Network Fusion and Kernel Methods · Tutorial 323 of 597

Constructing Patient Similarity Networks

You will learn to represent the same patients in separate, aligned similarity networks for each omics block and interpret their nodes, edges, and weights.

Advanced 11 min read

What You'll Learn

  • Define a patient-by-patient similarity matrix separately for each omics block.
  • Distinguish a network's patient nodes, weighted edges, and matrix entries.
  • Check when a similarity matrix represents an undirected weighted network.
  • Align patient identities and ordering across omics layers.
  • Diagnose common construction errors without prematurely fusing networks.

Why Construct One Network per Omics Block?

A multi-omics study may measure several molecular layers on the same patients, such as gene expression, methylation, and protein abundance. A patient similarity network represents each patient as a node and records how similar pairs of patients are according to one layer. Constructing a separate network for each block preserves the fact that similarity in expression data and similarity in methylation data are different statements, even when they concern the same pair of patients.

The objective here is to define and construct those block-specific networks, not to choose the best distance or to diffuse information between networks. Each block supplies its own patient profiles and its own pairwise similarity values. The networks can then be considered together as an aligned collection: their nodes refer to the same patients, while their edge weights retain block-specific meanings.

Definition: Suppose \(M\) omics blocks measure the same \(n\) patients. Let \(X^{(m)}\) be the data matrix for block \(m\), with one row per patient and \(p_m\) measured features. A patient similarity matrix for block \(m\) is an \(n \times n\) matrix \(S^{(m)}\), whose entry \(s_{ij}^{(m)}\) records the similarity between patients \(i\) and \(j\) using block \(m\). In the corresponding weighted network, patients are nodes and an off-diagonal entry \(s_{ij}^{(m)}\) is the weight assigned to the edge between patients \(i\) and \(j\).

What the Matrix Represents

For a fixed block \(m\), the row vector \(x_i^{(m)}\) contains patient \(i\)'s measured profile in that block. A block-specific rule \(g_m\) maps a pair of profiles to a similarity:

$$ s_{ij}^{(m)}=g_m\!\left(x_i^{(m)},x_j^{(m)}\right). $$

The value of \(s_{ij}^{(m)}\) is a statement about a pair of patients under the chosen representation and similarity rule. It is not a measurement of a molecular feature, and by itself it does not indicate a causal relationship. In a common convention, larger values indicate greater similarity; the rule should be defined so that this interpretation is clear. The exact rule may depend on the block, since feature types and preprocessing can differ across omics layers.

If the rule is symmetric, so that \(g_m(x_i^{(m)},x_j^{(m)})=g_m(x_j^{(m)},x_i^{(m)})\), then \(S^{(m)}\) is symmetric. Its network is undirected: the edge between \(i\) and \(j\) has the same weight whichever endpoint is named first. The diagonal describes each patient's similarity to themself. In many constructions this is set to one, but the diagonal is not ordinarily interpreted as a connection between distinct patients.

A matrix of pairwise values does not, on its own, specify that only some patient pairs are connected. If every off-diagonal pair has a value, it can be viewed as a complete weighted network. Selecting or rescaling edges to obtain a sparse affinity graph is a further operation; it should not be confused with computing the original pairwise similarities.

Assumptions and Construction Checks

The interpretation of a network depends on how its data were assembled. Before computing similarities, verify that each row represents one patient, each block has a defined set of features, and patient identities are known. A pairwise value is meaningful only if both profiles refer to the intended patients and the similarity rule is appropriate for the representation supplied to it.

  • Consistent patient identity: the same patient must be identified correctly in every block. Matching rows by position alone is unsafe if the source tables use different orders.
  • Within-block feature consistency: a pair of profiles compared in block \(m\) must refer to the same feature set, in the same order and with compatible preprocessing.
  • Clear weight interpretation: specify whether larger values mean greater similarity and the range of values the rule can produce. Do not assume weights from different blocks are directly comparable merely because they are both numerical.
  • Appropriate handling of unavailable values: missing profiles or undefined pairwise values require an explicit strategy. Silently treating a missing value as zero can turn “unknown” into “maximally dissimilar.”
  • Appropriate symmetry: for an undirected patient similarity network, use a symmetric rule or otherwise justify symmetrizing the pairwise values.

These checks concern construction and interpretation. Other choices, such as which distance or neighborhood rule to use, require separate consideration. The matrix should document the rule used rather than hide it.

Worked Example: Computing a Small Similarity Matrix

Suppose three hypothetical patients, A, B, and C, have two-feature profiles in one omics block. The profiles have already been placed on a common scale, and for this example we use cosine similarity. The profiles are A \(=(1,0)\), B \(=(1,1)\), and C \(=(0,1)\). All three vectors are nonzero, so the cosine calculations are defined.

For nonzero vectors \(u\) and \(v\), cosine similarity is their dot product divided by the product of their lengths. For A and B, the dot product is \(1\), and each vector's length is \(1\) and \(\sqrt{2}\), respectively. Thus \(s_{AB}=1/(1\sqrt{2})\approx0.7071\).

For A and C, the dot product is \(0\), and both lengths are \(1\), so \(s_{AC}=0/(1\cdot1)=0\). For B and C, the dot product is \(1\), and their lengths are \(\sqrt{2}\) and \(1\), so \(s_{BC}=1/(\sqrt{2}\cdot1)\approx0.7071\). The cosine of a nonzero vector with itself is \(1\).

Using patient order A, B, C, the resulting matrix is:

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

The matrix is symmetric because the dot product is symmetric, and its off-diagonal entries are nonnegative. Under this rule, A and B have similarity \(0.7071\), as do B and C, while A and C have similarity \(0\). Those are comparisons of profiles under this block's chosen representation; they do not establish that the patients have identical clinical outcomes or that one patient's measurements caused another's.

Aligned Networks Preserve Block-Specific Meaning

When the same patients appear in every block, use one common node set and a consistent patient order for all matrices. The matrices can differ in their numerical values and in what those values represent. Their shared indexing lets an analyst refer to the same patient pair across layers without claiming that the corresponding similarities have the same scale or biological interpretation.

Worked Example: Two Blocks, One Patient Set

Consider three hypothetical patients A, B, and C measured in two omics blocks. Assume each block has already produced finite, symmetric, nonnegative pairwise similarities, with larger values denoting greater similarity. The values below are illustrative inputs; they need not have been computed using the same rule.

In block 1, the pairwise similarities are \(s_{AB}^{(1)}=0.8\), \(s_{AC}^{(1)}=0.2\), and \(s_{BC}^{(1)}=0.4\). In block 2, they are \(s_{AB}^{(2)}=0.3\), \(s_{AC}^{(2)}=0.7\), and \(s_{BC}^{(2)}=0.5\). Setting the diagonals to one for display, the matrices are:

$$ S^{(1)}= \begin{pmatrix} 1&0.8&0.2\\ 0.8&1&0.4\\ 0.2&0.4&1 \end{pmatrix}, \qquad S^{(2)}= \begin{pmatrix} 1&0.3&0.7\\ 0.3&1&0.5\\ 0.7&0.5&1 \end{pmatrix}. $$

For A and B, the edge weight is \(0.8\) in block 1 and \(0.3\) in block 2. It is correct to say that the pair is assigned a larger similarity in block 1 under the stated conventions. It is not automatically correct to conclude that the pair is “more similar overall”: the scales, preprocessing, and interpretation of the two block-specific rules may differ.

The representation is therefore a pair of aligned networks, not one network with a single shared edge weight. Combining these weights would require an explicit integration rule and a justification that its inputs can be combined meaningfully. Keeping the matrices separate makes the source of each patient-pair comparison transparent.

A Short Justification for Symmetry

For an undirected network, symmetry is not just a visual preference. It follows directly when the similarity rule treats the two input profiles interchangeably. If \(g_m(u,v)=g_m(v,u)\) for every pair \(u,v\), then:

$$ s_{ij}^{(m)} =g_m\!\left(x_i^{(m)},x_j^{(m)}\right) =g_m\!\left(x_j^{(m)},x_i^{(m)}\right) =s_{ji}^{(m)}. $$

Thus \(S^{(m)}\) is symmetric, and a single weight can represent the edge between \(i\) and \(j\). For cosine similarity, the numerator is the dot product and \(u^\mathsf{T}v=v^\mathsf{T}u\); the denominator, the product of the two vector lengths, is also unchanged when the vectors are exchanged. The cosine rule therefore satisfies the required symmetry for nonzero vectors.

Worked Example: Reordering Patients Before Comparing Blocks

Suppose block 1 is recorded in patient order A, B, C, while block 2 is recorded in order C, A, B. In block 2, the reported off-diagonal similarities are \(s_{CA}^{(2)}=0.6\), \(s_{CB}^{(2)}=0.4\), and \(s_{AB}^{(2)}=0.2\). Assume these values are finite and symmetric, and set the diagonal to one.

To align block 2 with block 1, reorder its rows and columns together to A, B, C. The A–B value is \(0.2\); the A–C value is \(0.6\); and the B–C value is \(0.4\). Therefore the aligned matrix is:

$$ S^{(2)}_{\text{aligned}}= \begin{pmatrix} 1&0.2&0.6\\ 0.2&1&0.4\\ 0.6&0.4&1 \end{pmatrix}. $$

The entries themselves have not changed; only their positions have been made consistent with the common patient order. If the rows were reordered but the columns were not, the result would generally no longer represent the intended pairwise comparisons. A quick check is to confirm that the row and column labels match, in the same order, across every block.

Diagnostics, Alternatives, and Limitations

Construction checks can catch errors before an aligned set of networks is used downstream. Inspect the patient identifiers and matrix dimensions first: each \(S^{(m)}\) should have one row and column per included patient, in the declared order. Check that entries are finite, confirm symmetry if the network is intended to be undirected, and inspect the diagonal separately from off-diagonal weights. Verify from the definition of \(g_m\) that larger values have the intended interpretation.

A symmetry check can be written as \(s_{ij}^{(m)}=s_{ji}^{(m)}\) for all pairs. If it fails, first look for indexing mistakes, an asymmetric rule, or an error in how values were assembled. A high diagonal is not evidence of strong between-patient connections: self-similarities are not the off-diagonal edges of interest. Also inspect whether one block has a very different numerical range from another. That difference may reflect legitimate block-specific scaling rather than an error, but it warns against unexamined comparisons or pooling.

One alternative is to concatenate features from several blocks and compute a single patient similarity matrix. That produces one network, but it can obscure which layer contributes to a pairwise comparison, and blocks with more features or larger numerical scales may dominate unless addressed. A separate-network representation instead retains one matrix per block. It does not, by itself, resolve how to combine evidence across networks; that is a later integration decision.

A further limitation is that the matrix summarizes pairwise relationships but does not explain why two patients are similar. It does not automatically account for covariates, missingness, measurement error, or feature dependence. Nor does a large edge weight imply a causal connection or a clinical relationship. Interpretation is conditional on the profiles, preprocessing, and similarity rule used to generate that weight.

  • Wrong reasoning: “The weight between two patients is 0.8 in one block and 0.3 in another, so they are definitively more similar in the first block.”
  • Correction: This comparison is warranted only if the block-specific weights have suitably comparable scales and meanings. Otherwise, report the two values in their respective networks without ranking them as a common measure.
  • Wrong reasoning: “The matrices have the same dimensions, so their rows must refer to the same patients.”
  • Correction: Matching dimensions do not establish matching identities or order. Align and verify patient labels in both rows and columns.
Key takeaway: Construct one clearly defined \(n \times n\) patient similarity matrix per omics block, with verified patient identity and order. Its nodes are patients, and its off-diagonal entries are block-specific edge weights whose interpretation depends on the similarity rule.

Check Your Understanding

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

  1. What does the entry \(s_{ij}^{(m)}\) represent, and what do the corresponding node and edge represent?
  2. A symmetric similarity rule is applied to all patient pairs in a block. What property does the resulting matrix have, and what network interpretation follows?
  3. Two blocks contain the same patients but use different row orders. What must be done before comparing their matrices entry by entry?
  4. Why is it not generally valid to average two block-specific similarity weights without further justification?
  5. A pairwise similarity is missing for one patient pair. Why might replacing it with zero be misleading?

Solutions. (1) \(s_{ij}^{(m)}\) is the similarity assigned to patients \(i\) and \(j\) using block \(m\); the patients are nodes and the off-diagonal value is the edge weight. (2) The matrix is symmetric, so the network is undirected and the edge has the same weight in either order. (3) Reorder both rows and columns using the same verified patient order. (4) The weights may have different scales or meanings, so averaging them can create a number with no justified interpretation. (5) Zero may mean dissimilarity under the rule, whereas a missing value means the comparison is unavailable; treating them alike confounds unknown with observed dissimilarity.

Clinical Biostats