For research use only · We delete your sequences and results from our servers within 1 hour of your job finishing · Details

Learn/Similarity Maps: Visualizing Protein Relationships
What NeuroAutomata Does

Similarity Maps: Visualizing Protein Relationships

5 min read

When NeuroAutomata analyzes a set of proteins, it produces a numerical fingerprint — a high-dimensional embedding — for each one. Those numbers encode everything the model understood about the sequence: its evolutionary context, structural preferences, and functional constraints. The problem is that no human can look at a list of hundreds or thousands of numbers and say "these two proteins are similar." Similarity maps solve that problem by compressing the embeddings into a 2D scatter plot you can actually read.


Why dimensionality reduction is necessary

A protein embedding is a vector of hundreds to thousands of numbers depending on the model used (1280 for ESM-2 650M, 1152 for ESMC 600M). Each number is a coordinate in a high-dimensional mathematical space. Proteins that share function, fold, or evolutionary history tend to cluster near each other in that space. Proteins that are unrelated tend to sit far apart.

The challenge is purely perceptual: humans can see in three dimensions, and interpret two. To go from hundreds of dimensions down to 2, we need dimensionality reduction — algorithms that project high-dimensional data into a lower-dimensional space while preserving as much meaningful structure as possible.

In plain terms: Think of it like casting a shadow. A 3D sculpture casts a 2D shadow on a wall. The shadow loses information — you can't reconstruct the sculpture from the shadow alone — but it still tells you something real about the original shape. Dimensionality reduction is the mathematical equivalent: a meaningful 2D projection of a high-dimensional object.

NeuroAutomata offers two projection algorithms: PCA and UMAP. They make different trade-offs, and understanding those trade-offs will help you interpret what you see in the plot.

Note on cross-model projections: Embeddings from different models (e.g. ESM-2 650M and ESMC 600M) live in different dimensional spaces and cannot be projected together. If you switch models and re-generate embeddings, you must also re-run the dimensionality reduction. NeuroAutomata will warn you if the stored projection was computed from a different model than your current embeddings.


PCA: the global view

PCA (Principal Component Analysis) is a linear dimensionality reduction method. It finds the directions of greatest variation across your dataset and projects all points onto those directions. The result preserves global structure — the overall spread and relative positioning of protein groups. Two proteins that are far apart in 1280-dimensional space will tend to be far apart in the PCA plot.

PCA is deterministic (the same input always produces the same output), fast, and the axes have a defined meaning. This makes it useful for quick overviews and for comparing runs reproducibly.

Limitation: PCA's linear projection can blur fine-grained cluster structure. Distinct protein families may overlap in a PCA plot even when their embeddings are genuinely separable in higher dimensions.


UMAP: the local view

UMAP (Uniform Manifold Approximation and Projection) is a non-linear algorithm introduced by McInnes, Healy, and Melville in 2018 (arXiv:1802.03426, https://doi.org/10.48550/arXiv.1802.03426). Rather than finding global directions of variance, UMAP builds a graph of local neighborhood relationships in the high-dimensional space — which proteins are nearest neighbors of which — and optimizes a 2D layout that preserves those neighborhoods. The result is tighter, more visually distinct clusters.

In plain terms: PCA asks "what is the dominant direction of variation across the whole dataset?" UMAP asks "for each protein, who are its nearest neighbors?" The resulting plots look different: UMAP clusters are crisper, but the space between clusters is less interpretable than in PCA.

The trade-off is global distances. In PCA, the distance between clusters reflects overall variance. In UMAP, cluster positions are optimized for local structure, not global layout. Two clusters that look far apart in UMAP may be no more biologically distant than two clusters that appear close.

Why this matters: UMAP is usually the better choice for visually identifying protein families and spotting outliers. Use PCA when you want a globally consistent view where inter-cluster distances carry more meaning.

Limitation: UMAP is stochastic. By default, different runs on the same dataset can produce different layouts — clusters may appear in different positions, and points near boundaries may shift between groups. This is not an error; it is inherent to the algorithm. Cluster memberships tend to be stable, but the visual arrangement is not guaranteed to be identical across runs. For reproducibility, use PCA or fix the random seed.


Reading the scatter plot

Once you have a 2D projection, here is how to interpret what you see.

What clusters mean

A cluster indicates proteins that are similar in embedding space — they share evolutionary history, structural fold, or functional class. The tighter the cluster, the more similar the members. A diffuse cloud suggests a heterogeneous group.

What distance means

Within a cluster: distance is meaningful. Two proteins close together are more similar to each other than two at opposite edges.

Between clusters: interpret with caution, especially in UMAP. The placement of clusters in the 2D plane is influenced by the projection algorithm, not purely by biology. A cluster that appears isolated in a corner is not necessarily more unusual than one near the center. PCA inter-cluster distance is somewhat more interpretable (the axes represent directions of maximum variance), but even PCA is a 2D slice of a 1280-dimensional space.

What outliers mean

A protein that sits far from all clusters has an embedding that differs substantially from everything else in your dataset. Common causes:

  • The protein belongs to a different family or fold than the rest of your set
  • The sequence has unusual composition (very short, highly repetitive, or extreme amino acid bias)
  • A quality issue — truncated sequence, mis-annotated entry, or a synthetic sequence unlike anything in ESM-2's training data

Why this matters: Running a similarity map before mutation scoring or embedding-based classification is good practice. It surfaces quality issues early, before you invest compute time in deeper analysis.


A concrete example

Suppose you submit 20 variants of a human kinase alongside five unrelated control proteins. In UMAP, the 20 kinase variants would be expected to cluster tightly together — they share a conserved kinase domain fold, and ESM-2 encodes those shared structural constraints into similar embedding coordinates. The control proteins would scatter to different regions of the plot.

If the 20 kinase variants appear scattered with no visible cluster, that is a signal worth investigating: it might mean the sequences are from different subfamilies, have very different lengths, or there is a labeling error in your FASTA file. The similarity map catches those problems before you spend compute time on mutation scoring.


Interactive features

Hovering over any point in the NeuroAutomata similarity map shows the sequence name. Zooming in lets you examine dense clusters more closely. If you have labeled your sequences, colors make group membership visible at a glance.

These features are most useful during exploratory analysis — when you are orienting yourself in a new dataset before deciding which proteins to score for mutations or analyze in 3D.


Limitations of 2D projections

No 2D projection fully captures 1280-dimensional relationships. The information loss is real and unavoidable. Specific things a similarity map cannot tell you:

  • Exact similarity. The plot shows relative relationships, not precise distances. For quantitative similarity, compare embeddings directly using cosine or Euclidean distance in the full embedding space.
  • Function from proximity. Two proteins that cluster together share embedding similarity, but that does not prove they share function. Fold and function are correlated, not identical.
  • Causality. If a mutant variant lands at the edge of a cluster, the plot does not tell you whether that shift is caused by the specific mutations you introduced or by other sequence features.
  • Fine distinctions within a homogeneous set. When all proteins in your dataset are highly similar — for example, a series of single-point mutants of one protein — the 2D projection may compress them into an indistinguishable cloud. In that case, direct embedding comparison is more useful than a scatter plot.

Limitation: Similarity maps are exploratory tools. They are excellent for orientation, quality checking, and hypothesis generation. They are not a substitute for quantitative analysis of the underlying embedding vectors.


Summary

PCAUMAP
Algorithm typeLinearNon-linear
PreservesGlobal variance structureLocal neighborhood structure
Cluster separationOften overlappingUsually well-separated
DeterministicYesNo (stochastic by default)
Inter-cluster distanceMore interpretableLess interpretable
Best forQuick global overview, reproducibilityCluster identification, exploratory analysis

Both projections are available in NeuroAutomata. When in doubt, run UMAP first for cluster visualization, then switch to PCA if you need a consistent reference layout across multiple runs.


UMAP citation: McInnes, L., Healy, J., & Melville, J. (2018). UMAP: Uniform Manifold Approximation and Projection for Dimension Reduction. arXiv:1802.03426. https://doi.org/10.48550/arXiv.1802.03426