ChimeraX docs icon

Command: esmfold

ESMFold (Evolutionary Scale Modeling) is an artificial intelligence method for predicting protein structures. The method is described in:

Evolutionary-scale prediction of atomic-level protein structure with a language model. Lin Z, Akin H, Rao R, Hie B, Zhu Z, Lu W, Smetanin N, Verkuil R, Kabeli O, Shmueli Y, Dos Santos Costa A, Fazel-Zarandi M, Sercu T, Candido S, Rives A. Science. 2023 Mar 17;379(6637):1123-1130.

The esmfold command:

ESMFold-predicted structures vary in confidence levels (see coloring) and should be interpreted with caution. The esmfold command is also implemented as the tools ESMFold and ESMFold Error Plot. See the ChimeraX ESMFold example, alphafold, blastprotein, modeller, swapaa

Getting Models from the ESM Metagenomic Atlas

Usage: esmfold fetch  mgnify-id  alignTo  chain-spec [ trim  true | false ]]colorConfidence  true | false ] [ ignoreCache  true | false ] [ pae  true | false ] [ version  N ]
Usage: esmfold match  sequence  [ trim  true | false ] [ colorConfidence  true | false ] [ ignoreCache  true | false ] [ pae  true | false ]
Usage: esmfold search  sequence  [ matrix  similarity-matrix ] [ cutoff  evalue ] [ maxSequences  M ] [ version  N ]

Options

alignTo  chain-spec
Superimpose the predicted structure from esmfold 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 (same as for AlphaFold except mapped to 0-1 instead of 0-100) in the B-factor field (default true):

...in other words, using

color bfactor palette esmfold

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]
ignoreCache  true | false
The fetched models are stored locally in ~/Downloads/ChimeraX/ESMFold/, 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.
trim  true | false
Whether to trim a predicted protein structure to the same residue range as the corresponding experimental structure given with the esmfold match command or the alignTo option of esmfold fetch. With trim true (default):

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

version  N
Which version of the ESM Metagenomic Atlas to use with esmfold fetch and esmfold pae or esmfold search (as well as blastprotein with database esmfold). The default is the most recent version found at the website (currently 0). The esmfold match command always uses the current version and does not have this option.

Running an ESMFold Prediction

The esmfold predict command runs a calculation on the prediction server provided by the from the ESM Metagenomic Atlas.

Usage: esmfold predict  sequencesubsequence  start,end ] [ residueRange  start,end ] [ chunk  N ] [ overlap  M ]

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

The server has a maximum sequence length of 400 residues. The first three methods above specify an entire sequence, but a subsequence can be:

Alternatively, a single command can be used to predict a long sequence as a series of shorter chunks with overlaps (to allow their superposition). Example:
esmfold predict #1 chunk 400 overlap 20

The predicted structure 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...).

Caveats

ESMFold Predicted Aligned Error (PAE)

Besides per-residue confidence values, ESMFold 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 predicted aligned error or PAE values are not provided by the prediction server or esmfold predict, but are available for structures already in the ESM Metagenomic Atlas and can be shown as a 2D plot by using esmfold fetch or esmfold match with the option pae true, or the command esmfold pae:

Usage: esmfold paemodel-spec ] ( mgnifyId  mgnify-id | file  filename ) [ palette  palette ] [ range  low,high | full ] [ plot  true | false ] [ colorDomains  true | false ] [ minSize  M ] [ connectMaxPae  N ] [ cluster  resolution ] [ version  N ]

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

The corresponding ESMfold structure (already open) can be given as a model-spec in the esmfold pae command 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 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

ESMFold Predicted Aligned Error Plot

Besides per-residue confidence values, ESMFold 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 predicted aligned error or PAE values are not provided by the prediction server or esmfold predict, but are available for structures already in the ESM Metagenomic Atlas and can be shown as a 2D plot by using esmfold fetch with the option pae true, or the command esmfold pae.

The plot window has buttons for coloring the associated structure:

The plot's context menu includes:

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: esmfold contacts  res-spec1  [ toResidues  res-spec2  [ flip  true | false ] [ distance  d ] [ palette  palette ] [ range  low,high | full ] [ radius  r ] [ dashes  N ] [ name  model-name ] [ replace  true | false ] [ outputFile  pae-file ]

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 allows limiting 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 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. 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.

Examples:

esmfold contacts #1
esmfold contacts /A to /B distance 8
esmfold 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].residue.name} {0.atoms[0].residue.number} to {0.atoms[1].residue.name} {0.atoms[1].residue.number}"

UCSF Resource for Biocomputing, Visualization, and Informatics / March 2023