ChimeraX docs icon

Command: alphafold

AlphaFold is an artificial intelligence method for predicting protein structures that has been highly successful in recent tests. The method is described in:

Highly accurate protein structure prediction with AlphaFold. Jumper J, Evans R, Pritzel A, et al. Nature. 2021 Aug;596(7873):583-589.
Protein complex prediction with AlphaFold-Multimer. Evans R, O'Neill M, Pritzel A, et al. bioRxiv 2021.

The alphafold command:

AlphaFold-predicted structures vary in confidence levels (see coloring) and should be interpreted with caution. The alphafold command is also implemented as the tools AlphaFold and AlphaFold Error Plot. Several ChimeraX presentations and videos show modeling with AlphaFold and related analyses. See also: esmfold, blastprotein, modeller, swapaa

Getting Models from the AlphaFold Database

Usage: alphafold fetch  uniprot-id  alignTo  chain-spec [ trim  true | false ]]colorConfidence  true | false ] [ ignoreCache  true | false ] [ pae  true | false ] [ version  1 | 2 | 3 | 4 ]
Usage: alphafold match  sequence  [ search  true | false ] [ trim  true | false ] [ colorConfidence  true | false ] [ ignoreCache  true | false ] [ pae  true | false ]
Usage: alphafold search  sequence  [ matrix  similarity-matrix ] [ cutoff  evalue ] [ maxSequences  M ] [ version  1 | 2 | 3 | 4 ]


alignTo  chain-spec
Superimpose the predicted structure from alphafold fetch onto a single chain in an already-open structure, and make its chain ID the same as that chain's. See also the trim option.
colorConfidence  true | false
Whether to color the predicted structures by the pLDDT confidence measure in the B-factor field (default true): other words, using

color bfactor palette alphafold

The Color Key graphical interface or a command can be used to draw a corresponding color key, for example:

key red:low orange: yellow: cornflowerblue: blue:high  [other-key-options]
directory  results-folder
For alphafold predict, specify a results-folder pathname (name and location) or the word browse to specify it interactively in a file browser window. The directory or folder does not need to exist already, as it will be created by the command. The pathname can include [N] to indicate substitution with the smallest positive integer that makes a new directory (default ~/Downloads/ChimeraX/AlphaFold/prediction_[N]). If the specified pathname does not include [N] but a directory of that name and location already exists and contains a file, _[N] will be appended automatically to avoid overwriting the existing directory.
ignoreCache  true | false
The fetched models are stored locally in ~/Downloads/ChimeraX/AlphaFold/, where ~ indicates a user's home directory. If a file specified for opening is not found in this local cache or ignoreCache is set to true, the file will be fetched and cached.
search  true | false
When fetching models with alphafold match, whether to search the database for the most similar sequence if the UniProt accession number for a chain is not provided in the experimental structure's input file, or is provided but not found in the AlphaFold Database (true, default). A fast but low-sensitivity (requiring high % identity) K-mer search of the the database is performed. The closest sequence match for which a model is available will be retrieved. With search false, only the experimental structure's input file will be used as a potential source of UniProt accession numbers. When present, these are given in DBREF records in PDB format and in struct_ref and struct_ref_seq tables in mmCIF.
minimize  true | false
This option allows skipping energy-minimization of the result from alphafold predict, for faster job completion and/or to avoid failures that may occur during minimization.
templates  true | false
Whether a calculation run with alphafold predict should use known structures from the PDB as templates. AlphaFold can use up to four structures as templates; when this option is true, ColabFold will search the PDB sequences for similarity to the target and report in the Colab log which entries (if any) are used as templates.
trim  true | false
Whether to trim a predicted protein structure to the same residue range as the corresponding experimental structure given with the alphafold match command or the alignTo option of alphafold fetch. With trim true (default):

Using trim false indicates retaining the full-length models for the UniProt sequences, which could be longer.

version  1 | 2 | 3 | 4
The AlphaFold Database contains single-chain models for protein sequences in UniProt. This option specifies which version of the database to use with alphafold fetch, alphafold pae, or alphafold search (as well as blastprotein with database alphafold):

The alphafold match command always uses version 4 and does not have this option.

Running an AlphaFold Prediction

The alphafold predict command runs a calculation on Google Colab using ColabFold, an open-source, optimized version of AlphaFold 2. Users should cite:

ColabFold: making protein folding accessible to all. Mirdita M, Schütze K, Moriwaki Y, Heo L, Ovchinnikov S, Steinegger M. Nat Methods. 2022 Jun;19(6):679-682.

For monomer prediction:

Usage: alphafold predict  sequenceminimize  true | false ] [ templates  true | false ] [ directory  results-folder ]

The protein sequence to predict can be given as any of the following:

  1. a chain-spec corresponding to a single chain in an atomic structure open in ChimeraX
  2. the sequence-spec of a sequence in the Sequence Viewer, in the form:  alignment-ID:sequence-ID  (details...)
  3. a UniProt name or accession number
  4. plain text pasted directly into the command line

These methods specify the entire sequence only, although a truncated version could be pasted.

For multimer (protein complex) prediction:

Usage: alphafold predict  chain-specminimize  true | false ] [ templates  true | false ] [ directory  results-folder ]
– or –
Usage: alphafold predict  sequence1,sequence2[,sequence3...,sequenceN] [ minimize  true | false ] [ templates  true | false ] [ directory  results-folder ]

The sequences of two or more protein chains can be specified either collectively as a chain-spec (for atomic-structure chains already open in ChimeraX), or individually within a comma-separated list using any combination of specifier types #2-4 listed above. The comma-separated list should not contain any spaces. If the same protein chain occurs multiple times in the complex, its sequence should be repeated that number of times. For example, to predict a homodimer, the same sequence (or its specifier) would need to be given twice. Prediction may only be feasible for smaller complexes (details...).

A warning will appear saying that this Colab notebook is from github (was not authored by Google), with a button to click to run anyway. Users will need to have a Google account and to sign into it via a browser. Once that is done, the sign-in may be remembered depending on the user's browser settings; it is not kept in the ChimeraX preferences. See the example video for an explanation of the images/plots from ColabFold that appear in the Colab log and where to find downloaded files.

The model will be opened automatically and colored by confidence value. The model for a sequence that was specified by structure chain will be superimposed on that chain and assigned structure-comparison attributes for further analysis (details...).

See also: batch predictions


AlphaFold Predicted Aligned Error (PAE)

Besides the per-residue pLDDT confidence measure, AlphaFold gives for each pair of residues (X,Y) the expected position error at residue X if the predicted and true structures were aligned on residue Y. These residue-residue “predicted aligned error” or PAE values can be shown as a 2D plot using the command alphafold pae (details below), the AlphaFold Error Plot tool, or alphafold fetch or alphafold match with the option pae true. See also the AlphaFold Error Estimates example and video.

Usage: alphafold paemodel-spec ] ( uniprotId  uniprot | file  filename ) [ palette  palette ] [ range  low,high | full ] [ plot  true | false ] [ colorDomains  true | false ] [ minSize  M ] [ connectMaxPae  N ] [ cluster  resolution ] [ dividerLines  true | false ] [ version  1 | 2 | 3 | 4 ]

With alphafold pae, the matrix of PAE values can be either:

The corresponding AlphaFold structure (already open) can be given as a model-spec to associate it with the plot. This association allows coloring by domain as described below, and for selections on the plot to highlight the corresponding parts of the structure.

By default, the PAE plot is drawn when domain coloring is not done (plot is default true when colorDomains is false) and vice versa.

Setting colorDomains to true clusters the residues into coherent domains (sets of residues with relatively low pairwise PAE values) and uses randomly chosen colors to distinguish these domains in the structure. The residues are assigned an integer domain identifier (starting with 1) as an attribute named pae_domain that can be used to specify them in commands (for example, to recolor or select specific domains). Residues not grouped into any domain are assigned a pae_domain value of None. The clustering uses the NetworkX greedy_modularity_communities algorithm with parameters:

The dividerLines option (default true) indicates whether, for multimer predictions, to draw lines on the plot demarcating the end of one chain and the start of another. The lines may obscure a few chain-terminal residues in the plot, and dividerLines false can be used if this is problematic.

The default palette for coloring the PAE plot is pae, with colors assigned to values as follows:

0 5 10 15 20 25 30

Another palette with value range suitable for PAE plots is paegreen:

0 5 10 15 20 25 30

Although these palettes include value-color pairs, it may be helpful to give a value range if a colors-only palette is used instead (default 0,30). A range can also be used to override the values in a value-color palette, instead spacing the colors evenly across the specified range.

The plot window has a context menu with options for recoloring the plot and associated structure, hiding/showing the divider lines, and saving the plot as an image, as well as buttons for recoloring the structure:

The Color Key graphical interface or a command can be used to draw (in the main graphics window) a color key for the PAE plot. For example, to make a color key that matches the pae or paegreen scheme, respectively:

key pae :0 : : :15 : : :30  showTool true
key paegreen :0 : : :15 : : :30  showTool true

A title for the color key (e.g., “Predicted Aligned Error (Å)”) would need to be created separately with 2dlabels.

Pseudobonds Colored by PAE

Residue-residue PAE values can also be shown with colored pseudobonds in the predicted structure:

Usage: alphafold contacts  res-spec1  [ toResidues  res-spec2  [ flip  true | false ] [ distance  d ] [ maxPae  max-error ] [ palette  palette ] [ range  low,high | full ] [ radius  r ] [ dashes  N ] [ name  model-name ] [ replace  true | false ] [ outputFile  pae-file ]

See the AlphaFold Contacts example and video. See also: size, style, contacts, crosslinks, rename

A PAE plot containing the specified residues must already be shown. The PAE matrix is not symmetrical. The first specification res-spec1 gives the aligned residues, whereas toResidues res-spec2 gives the residues whose error values are reported, except that using flip true swaps the meaning of res-spec1 and res-spec2. If one set of residues is higher-confidence (lower in pLDDT) than the other, it is usually best to specify them as the aligned residues so that the coloring will show the error values of the lower-confidence set.

Omitting the toResidues option defines res-spec2 as all residues covered by the PAE plot except for those in res-spec1; however, if toResidues is omitted and res-spec1 includes all residues in the plot, res-spec2 will also be defined as all residues in the plot.

The distance option limits the number of pseudobonds by only drawing them between pairs of residues with any interresidue distance ≤ d Å (default 3.0). These pseudobonds are drawn between α-carbons regardless of which atoms were within the distance cutoff. The maxPae option can be used to further limit the pseudobonds to only those representing PAE values ≤ max-error (no default value; if the option is omitted, there is no restriction by PAE).

The default palette for coloring the pseudobonds by PAE value is paecontacts, with colors assigned to values as follows:

0 5 10 15 20

Although this palette includes value-color pairs, it may be helpful to give a value range if a colors-only palette is used instead (default 0,30). A range can also be used to override the values in a value-color palette, instead spacing the colors evenly across the specified range.

The pseudobond stick radius (default 0.2 Å) and number of dashes (default 1, meaning a solid stick) can also be specified.

The name option allows specifying the pseudobond model-name (default PAE Contacts). If a model by that name already exists, any pre-existing pseudobonds will be removed from that model and replaced by the new ones (replace true, default) unless replace false is used.

The outputFile option allows saving a list of the residue pairs (those meeting the distance criterion) and their PAE values to a plain text file. The pae-file argument is the output file pathname, enclosed in quotation marks if it includes spaces, or the word browse to specify it interactively in a file browser window.


alphafold contacts #1
alphafold contacts /A to /B distance 8
alphafold contacts sel palette blue:red range 1,5

The following would select all pseudobonds and label them with the names and numbers of the residues that they connect:
sel pbonds
label sel pseudobonds text "{0.atoms[0]} {0.atoms[0].residue.number} to {0.atoms[1]} {0.atoms[1].residue.number}"

Batch Prediction Commands

The following commands facilitate batch predictions by advanced users who have access to running ColabFold directly (outside of ChimeraX) from the Linux shell. ColabFold [github] [citation] runs on Linux computers with Nvidia graphics. See also: alphafold predict, predicting dimers with AlphaFold

alphafold monomerssequence-list | open  results-folder ) [ maxLength  L ] [ recycles  N ] [ models  NN-list ] [ outputFasta  filename ]
Given a sequence-list, alphafold monomers estimates the time it would take ColabFold to run monomer predictions for the sequences on an Nvidia 3090 GPU. It also reports in the Log the colabfold_batch command that would be used to run the predictions from the Linux shell, but it does not actually run the predictions. Alternatively, if the monomer predictions have already been run, alphafold monomers can be used with the open option to display the results in ChimeraX.

The sequence-list can be given as either of the following:

Only protein sequences are considered, and duplicates are eliminated. The maxLength option excludes sequences with more than L residues (no default, i.e. unlimited length). The recycles option controls the number of iterations for each prediction (default 3), with smaller values giving shorter run times. The models option controls which of the five neural networks (called “models” in AlphaFold) to use, where NN-list is a comma-separated list of integers in the range 1-5 (default 1,2,3,4,5). Normally all five are used, producing five predicted structures for each sequence, but using fewer neural networks will decrease the run time. The sequences for which predictions would be run (filtered by uniqueness and maximum length, if any) can be written to a new FASTA file using the outputFasta option; if this option is not used, no FASTA file will be written.

Alternatively, using the open option to give a results-folder (specified by pathname or the word browse to specify it interactively in a file browser window) opens the resulting structures and displays them in a convenient fashion: tiled, labeled, and colored by pLDDT.

alphafold dimers  sequence-list  [ withSequences  sequence-list2 ] [ homodimers  true | false ] [ maxLength  L ] [ recycles  N ] [ models  NN-list ] [ outputFasta  filename ]
Given a sequence-list, alphafold dimers estimates the time it would take ColabFold to run dimer predictions on an Nvidia 3090 GPU for all pairs of the sequences. If withSequences is used to give a second list of sequences, only pairs with one sequence in the first list and the other in the second list will be considered. The command also reports in the Log the colabfold_batch command that would be used to run the predictions from the Linux shell, but it does not actually run the predictions.

Each sequence list can be given as either of the following:

Only protein sequences are considered, and duplicates are eliminated, except that the homodimers option indicates whether to predict structures for pairs of chains with identical sequences (default true). The sequence pairs for which predictions would be run can be written to a new FASTA file using the outputFasta option; if this option is not used, no FASTA file will be written. The maxLength, recycles, and models options are the same as described for alphafold monomers, except that maxLength applies to the total combined length of the two sequences.
alphafold interfaces  dimer-results-folder  [ distance  d ] [ maxPae  max-error ] [ minConfPairs  N ] [ open  true | false ] [ resultsFile  csv-output-file ] [ shortNames  true | false ]
When AlphaFold (ColabFold) is given two sequences to predict as a complex, it will always place the two chains near each other even if there are no favorable binding interactions. The AlphaFold predicted aligned error (PAE) score indicates confidence in the predicted residue-residue interactions, and thus whether or not the two proteins are really predicted to bind one another.

The alphafold interfaces command considers all PDB files (.pdb suffix) in the dimer-results-folder directory, which can be specified by its pathname or the word browse to specify it interactively in a file browser window. Each PDB file should contain a ColabFold protein-protein dimer prediction and should be named according to the ColabFold convention, which includes the sequence names and the rank and network used for the prediction. The directory will also include a PAE file (suffix .json) for each PDB file. For each predicted dimer:

  1. the PDB file is opened and pairs of residues across the chain-chain interface with any atoms ≤ distance d apart (default 4.0 Å) are considered
  2. of these, residue pairs with PAE ≤ maxPae max-error (default 5.0 Å) are counted
  3. if at least minConfPairs N (default 10) of the interface residue pairs meet both the distance and PAE criteria, the dimer is included in the list of possible binders
  4. the structure is closed
Processing all of the dimer predictions can take a few minutes, and progress is reported in the ChimeraX status line. After the calculation completes, a table listing the possible binders is written to the Log, including the sequence names, number of high-confidence residue pairs, and how many residues in each chain are part of a high-confidence pair. The open option allows opening the highest-ranked model structure for each possible-binder prediction (default false).

Results are also automatically written to a CSV file (filename specified with the resultsFile option, default interfaces.csv). Contents include the numbers of high-confidence residue pairs found for each PDB file and their residue numbers. If the alphafold interfaces command is run a second time, it will look for this file and use it instead of reevaluating the predictions. If it is desired to rerun the evaluation with different criteria, the interface.csv file should be deleted or renamed beforehand.

By default, ColabFold generates five structures for each pair of sequences. The table has one row for each pair of sequences for which at least one “possible binder” structure was found. The Models column lists how many of the five model structures met the binding criteria. In each row of the table, the sequence names are a link to open the highest-ranked model structure for that sequence pair. The Open best link below the table opens the highest-ranked structure for every listed sequence pair (same as the open command option). The links below the table to Hide and Show disordered loops allow hiding or showing the ribbon for residues with pLDDT ≤ 50.

The sequence names are parsed from the PDB filenames, in which they are separated by a “.” character and terminated by “_unrelaxed.” The sequence names may be long if the ColabFold input used long names. The names can be shortened in the possible-binders table using the shortNames option (default true). That option considers words in the sequence names separated by underscore characters (“_”) and looks for a unique word in each sequence that it will use as the short name. If no unique word is found, it will use the full name. It is very helpful to make the FASTA file descriptions in the input to ColabFold as concise as possible, since they will be used as the sequence names in the output. Shorter names make it easier to navigate the hundreds of files that ColabFold produces.

UCSF Resource for Biocomputing, Visualization, and Informatics / February 2024