
AF-Cluster
Cluster MSAs to predict alternative protein conformations with AlphaFold2
What is AF-Cluster?
AF-Cluster is a method for predicting multiple protein conformations by clustering a multiple sequence alignment (MSA) before running AlphaFold2. Standard AlphaFold2 predictions converge on a single dominant structure, even for proteins that adopt two or more biologically relevant folds. AF-Cluster addresses this by splitting the MSA into sequence subgroups using the DBSCAN density-based clustering algorithm, then generating separate AlphaFold2 predictions from each cluster.
The approach was developed by Hannah Wayment-Steele and colleagues and published in Nature (volume 625) in 2024. The authors validated the method on metamorphic proteins, including the cyanobacterial clock protein KaiB, where AF-Cluster correctly predicted both the ground-state and fold-switched conformations. NMR spectroscopy confirmed that a KaiB variant predicted by AF-Cluster was indeed stabilized in the opposite fold.
How does AF-Cluster work?
Proteins evolve under selective pressure to maintain function, and function often requires switching between conformational states. Homologous sequences in an MSA may carry co-evolutionary signals for different conformations. When the full MSA is fed to AlphaFold2, these conflicting signals average out and the prediction collapses onto a single state.
AF-Cluster separates these signals by clustering the MSA:
- A3M normalization: Lowercase insertion characters are removed. The first non-query sequence sets the encoded alignment width; an empty or shorter query is zero-padded, and unrecognized uppercase symbols contribute an all-zero encoded position.
- Gap filtering: A non-query sequence is retained only when its fraction of
-characters is strictly below the selected cutoff. - Feature encoding and DBSCAN clustering: Each aligned sequence is one-hot encoded over the 20 standard amino acids plus gap, and DBSCAN uses Euclidean distance in that feature space. Each cluster must contain at least
min_samplessequences; sequences outside dense regions are labeled as noise. - Epsilon optimization: When epsilon is not specified, AF-Cluster scans values from 3 to 20 in steps of 0.5. The source implementation samples 25% of the retained sequences independently for each scan value and selects the value that yields the most clusters.
- Consensus generation: A consensus sequence is derived from each cluster, representing the dominant residue at each position within that subgroup.
Each cluster's alignment can then be used as input to AlphaFold2 independently, producing structure predictions that may capture different conformational states.
How to use AF-Cluster online
ProteinIQ runs the commit-pinned AF-Cluster source on cloud infrastructure, so no software installation is needed. The current source revision is 6b22451. The runtime applies the identified proteiniq-cli-numeric-types-v1 parser correction and verifies the original and corrected entrypoint digests before publishing the image.
Input
| Input | Description |
|---|---|
Multiple Sequence Alignment | A protein MSA in FASTA or A3M format. The first sequence is the query, and the first non-query sequence sets the source encoding width after lowercase A3M insertions are removed. With controls enabled, at least 10 non-query sequences must remain after gap filtering. With zero controls, fixed-epsilon clustering needs at least 1 retained non-query sequence, automatic scanning needs 3, PCA needs 2, and t-SNE needs 30. Jobs accept up to 5,000 sequences, 2,000,000 aligned sequence cells, and 5,000,000 submitted characters; uploaded files are limited to 5 MiB. |
MSAs can be generated from tools like Clustal Omega or MAFFT, or obtained from databases such as UniRef or ColabFold search.
The native FASTA parser accepts leading text before the first record and empty record identifiers. A longer non-query record is checked for encoding width only if it survives gap filtering. Sequence identifiers, including names such as 001, remain text in the results.
Settings
| Setting | Description |
|---|---|
Min samples per cluster | Positive integer controlling the minimum number of sequences required to form a DBSCAN cluster (default 3). Higher values produce fewer, more populated clusters. |
Gap fraction cutoff | Positive cutoff that removes each non-query sequence when its gap fraction is at or above the selected value (default 0.25). Lower values enforce stricter filtering; values above 1 retain every sequence. |
DBSCAN epsilon | Non-negative Euclidean-distance threshold for DBSCAN neighborhood membership (default 0 for automatic). At 0, AF-Cluster scans 3–20 in 0.5 increments. |
Minimum epsilon | Positive first epsilon tested during automatic scanning (default 3). |
Maximum epsilon | Endpoint of the native scan range (default 20). Use a smaller endpoint with a negative step for a descending scan. |
Epsilon step | Nonzero increment between automatic epsilon candidates (default 0.5). Hosted automatic scans are limited to 100 candidates. The first tested epsilon must be positive. Scan bounds do not select the clustering epsilon when a fixed epsilon is supplied. |
Control alignment count | Number of independently sampled U10 controls and, when enough sequences remain, U100 controls (0–20, source default 10). Select 0 to skip control generation. |
Shuffle sequence order | Apply the source resample option, which randomly shuffles non-query rows before clustering. Despite the source option name, it does not sample with replacement. The shuffled first row defines the encoder width. Unequal widths can therefore succeed or fail depending on the source's shuffled order; source failures are reported directly. |
Visualization
| Setting | Description |
|---|---|
Generate PCA plot | Project clustered sequences onto their first two principal components. Useful for seeing how clusters separate in sequence space. |
Generate t-SNE plot | Generate the source t-SNE embedding. This source revision represents the appended query as an all-zero vector in this branch. At least 30 retained non-query sequences are needed by the source t-SNE defaults. |
Output
AF-Cluster produces several files:
- Cluster alignments: Separate A3M files for each identified cluster, ready for structure prediction with AlphaFold2 or other folding tools.
- Submitted alignment snapshot: A byte-preserving ProteinIQ copy of the exact submitted MSA for provenance and workflow reuse. This is clearly labeled because the pinned AF-Cluster source does not emit the
_REF.a3mfile described in its README. - Control alignments: The selected number of independently sampled U10 control MSAs generated by AF-Cluster. U100 controls are also generated when more than 100 non-query sequences remain after filtering.
- Clustering assignments: A table mapping each post-filter sequence to its assigned cluster (or -1 for noise/unassigned sequences), including PCA coordinates when PCA is enabled.
- Cluster metadata: Source metadata for each cluster, including consensus sequence, average identity to the cluster consensus, average identity to the query, and cluster size.
- Visualization: Source PCA and t-SNE PDFs when their respective settings are enabled.
- Run logs: The AF-Cluster log with epsilon scanning, cluster counts, and filtering summary, plus captured source standard-output and warning streams when present.
All of these artifacts are available to workflows. Cluster and control alignments are emitted as separate sequence artifacts so each alignment can be connected directly to a downstream folding step.
The on-screen assignments table previews up to 1,000 rows. The downloadable clustering-assignments TSV always retains every source row.
Applications
AF-Cluster is most valuable for proteins suspected of adopting multiple folds:
- Metamorphic proteins: Proteins like KaiB, lymphotactin, and RfaH that switch between entirely different folds. Standard AlphaFold2 typically predicts only the dominant state.
- Conformational ensembles: Enzymes or receptors with open/closed states, active/inactive forms, or ligand-induced rearrangements.
- Protein family surveys: Screening an entire protein family for members that may adopt alternative folds, even when fold-switching has not been experimentally observed.
- Mutation design: Identifying residue positions where mutations might shift the conformational equilibrium. The original study designed three mutations predicted to flip KaiB into its fold-switched state, confirmed by NMR.
Limitations
- Depends on MSA quality: The method requires an MSA with sufficient sequence diversity. Small or shallow alignments may not contain enough signal for meaningful clustering.
- No guarantee of biological relevance: Not every cluster corresponds to a true conformational state. Some clusters may reflect phylogenetic divergence rather than structural differences.
- Single-domain focus: AF-Cluster was developed and validated primarily on single-domain proteins and metamorphic switches. Multi-domain or disordered proteins may not benefit from this approach.
- Sensitivity to parameters: The choice of epsilon and minimum samples affects which clusters emerge. Automatic epsilon selection works well in many cases but is not infallible.
- Stochastic outputs: Automatic epsilon scanning and control-MSA sampling are not seeded in this source revision, so repeated runs can select a different epsilon or return different controls.
- Source t-SNE query representation: In this revision's t-SNE branch, the appended query is represented as an all-zero vector rather than its amino-acid encoding. ProteinIQ preserves that source behavior.
- Downstream prediction required: AF-Cluster prepares MSA subsets but does not itself predict structures. A separate folding step with AlphaFold2 or a similar tool is needed to generate 3D models from each cluster.
Related tools
RAxML-NG
Infer maximum-likelihood phylogenetic trees from aligned protein, DNA, or binary character data with bootstrap support.
DR-BERT
Predict intrinsically disordered regions and per-residue disorder probabilities from protein sequences.
AbLang
Restore residues and generate antibody-specific representations or likelihood scores.
AbLang-2
Predict non-germline residues and generate embeddings for paired or unpaired antibody sequences.
Aggrescan3D
Analyze aggregation-prone regions in a protein structure.
AllMetal3D
Predict metal and water binding sites in proteins with 3D CNN models.
CANYA
Predict protein aggregation nucleation propensity from amino acid sequences.
DeepEMhancer
Sharpen and denoise cryo-EM maps.
DeepRank-Ab
Score antibody and nanobody complexes with predicted DockQ.
ESM-2
Analyze protein sequences and generate embeddings.