~/aixsci
weekly updates

fields/structural-biology/model families

k-nearest neighbours in structural biology and protein science

How k-nearest neighbours, which classifies a protein by finding the most similar sequences already labelled and copying their answer, is used in structural biology and protein science.

How it is used

Structural biology and protein science ask what a chain of amino acids does: which part of it folds into a helix, where a sugar gets attached, whether the whole protein defends a plant against infection, what it binds. k-nearest neighbours answers such questions by comparison. Each protein, or each short window within one, is first turned into a fixed list of numbers: how often each kind of residue appears, how charged or water-repelling the segment is, how strongly it tends towards a helix, a sheet or a turn, or a vector produced by a language model trained on protein sequences. A new case is then placed among the stored, already-labelled cases, and the labels of its closest matches are read off as the prediction.

In the work described here, that comparison step sits inside a longer pipeline. Most of the effort goes into the numbers rather than the classifier: curating positive and negative sets, removing near-duplicate sequences, and choosing descriptors. Nearest-neighbour voting is one of several classifiers tried on the same vectors, often as a plain yardstick against which tree ensembles, support vector machines and stacked combinations are measured, and sometimes as one base member feeding a second-stage learner.

Why researchers use it

Proteins already come with a natural notion of similarity: sequences that resemble each other usually behave alike, and the field has long read function off close relatives by hand. Nearest neighbours is that habit written as code, which makes it an obvious first choice. It fits nothing, so there are almost no settings to tune and no risk of an elaborate model quietly memorising a small training set. Labelled data in this field is scarce and expensive, since each positive case may rest on a solved structure or a mass-spectrometry measurement, and a method that needs only the stored examples suits that scarcity.

In the record

Limits

Everything rests on the distance measure, and proteins give no single right one. Hand-built descriptors and language-model embeddings run to many dimensions, where distances flatten out and all stored cases look roughly equally far away. Sequence databases are also heavily redundant, so a test protein's nearest neighbour can be a near-copy of a training protein, which flatters the score; the clustering at fixed identity thresholds seen in these studies guards against that, imperfectly. The method weights all features alike, says little about why a case was labelled, and grows slower as the stored set grows.

Written by AIxSci: the background from general knowledge, the examples from checked records.

Related

Every article