Skip to content

SNF: Similarity Network Fusion

MOFA and MCIA work on features. SNF throws the features away and works on patients. It builds one patient-to-patient similarity network per layer, then fuses those networks into a single consensus network by letting strong edges in any one layer reinforce weak edges in the others. Clustering the fused network gives patient subtypes.

SNF represents each layer through patient similarities. The networks in this example have 200 rows and 200 columns, one per patient, rather than one column per molecular feature. That representation changes the calculation; it does not guarantee stable groups when few independent patients are available.

Three steps. Build an affinity matrix per view from patient distances. Fuse the matrices with a message-passing update, where each network is nudged toward the others over several iterations until they agree. Cut the fused network into clusters with spectral clustering. The fusion is the clever part: a similarity that shows up in only one layer fades, while a similarity present across layers is amplified.

SNF expects complete cases, so missing values are imputed to feature medians to keep all 200 patients. This page is R only: SNFtool has no mainstream Python implementation. It runs in the pinned multi-omics container, and the CLL data comes from the MOFAdata package inside it.

Continuous views get a scaled Euclidean distance; the binary Mutations view gets a simple matching distance. The rest is three SNFtool calls.

The CLL matrices come from the MOFAdata data package, distributed by Ricard Argelaguet, Britta Velten, and colleagues under LGPL-3. The package identifies the Dietrich and colleagues study as the source and documents its processed measurement blocks. The data and license notice identifies the original objects and the transformations made for these lessons.

library(SNFtool)
neighbor_count <- 20
sigma <- 0.5
# One affinity matrix per view, then fuse, then cluster.
affinity_matrices <- lapply(
views,
function(view) affinityMatrix(dist_of(view), K = neighbor_count,
sigma = sigma)
)
fused <- SNF(affinity_matrices, K = neighbor_count, t = 20)
clusters <- spectralClustering(fused, K = 2)

Ordered by cluster, the fused network shows two blocks of high within-group similarity, and the annotation bars line them up against IGHV status.

Fused similarity network heatmap, two blocks aligned with IGHV status (R)

The two clusters are almost pure IGHV subtypes. Cluster 1 holds 104 unmutated patients against 2 mutated; cluster 2 holds 82 mutated against 12 unmutated. A Fisher exact test puts the association at p = 3.8e-40.

IGHV composition within each SNF cluster (R)

Because SNF fuses networks rather than stacking features, you can ask which layer’s own clustering most agrees with the fused result. Cluster each view on its own, then measure the normalized mutual information against the fused clusters.

View agreement with the fused clusters, methylation dominant (R)

Methylation carries the fusion, at NMI 0.54, with mutations a distant second at 0.18 and expression and drug response contributing almost nothing to the patient grouping. That matches CLL biology: the IGHV split has a strong epigenetic signature, and SNF finds it through the methylation layer.

The mean silhouette is 0.004 despite the association with IGHV. These summaries measure different properties: separation under the chosen distance and association with a biological annotation. Neither is an independent validation in this example. IGHV remains in the mutation matrix used to build the networks, and the script reads its plotted labels from that matrix after median imputation.

Keep both results when interpreting the fit. Before treating the clusters as new subtypes, check whether they persist under changes to the neighborhood size, cluster count and missing-value treatment. A label excluded from all input layers would provide a separate evaluation; this page does not run that experiment.

SNF returns clusters and nothing else. It does not tell you which genes, CpGs, or mutations separate the groups; for that you run a differential analysis on top of the labels. It also asks you to choose the number of clusters, so record that choice and evaluate both cluster stability and biological associations. When you need the driving features rather than the grouping, reach for MOFA or DIABLO.

The runnable script and the container are in the companion code repo under guides/multi-omics/snf/.

The SNFtool package implements similarity network fusion in R.

  • SNFtool 2.3.1 source and reference files

    The SNF help defines affinity matrices, neighborhood size, and diffusion iterations. Its example separates network fusion from the later spectral clustering step.

  • MOFAdata dataset overview

    The vignette identifies the processed CLL assays and their dimensions. Use that provenance when interpreting the four patient networks and their shared sample labels.