Skip to main content
License: AlphaFold DB retrieves data from the AlphaFold Protein Structure Database, distributed under CC-BY-4.0. Attribution to the AlphaFold Protein Structure Database is required when the data is redistributed. The client wrapper code is MIT-licensed. Please refer to the data terms for full terms.

Proto is not affiliated with Google DeepMind and EMBL-EBI. This toolkit is open source and builds on the implementations produced by these organizations. Product names, logos, and trademarks are the property of their respective owners.


google-deepmind/alphafold
google-deepmind/alphafold
View repo
AlphaFold Protein Structure Database: massively expanding the structural coverage of protein-sequence space with high-accuracy models
Mihaly Varadi, Stephen Anyango, … Sameer Velankar
Nucleic Acids Research (2022)
Read paper
Copy citation
evo-design/proto-tools/proto_tools/tools/database_retrieval/alphafold_db
View source
Open Notebook
Open notebook
Toolkit contributors

Background

The AlphaFold Protein Structure Database (AFDB) (Varadi et al., 2022) is a freely accessible archive of protein structures predicted by AlphaFold2 (Jumper et al., 2021), maintained by Google DeepMind and EMBL-EBI. It hosts predicted atomic coordinates for the UniProt reference proteomes. Each entry carries a per-residue confidence score (pLDDT, 0 to 100) and a pairwise predicted aligned error (pAE) matrix in angstroms. AFDB hosts AlphaFold2 single-chain predictions only. Multi-chain complexes are produced by separate pipelines and are not part of this database. Internally, the tool issues a GET request to the AFDB prediction endpoint at https://alphafold.ebi.ac.uk/api/prediction/{accession}, which returns a JSON list of prediction records. It selects the canonical record (AF-{accession}-F1) by default, or the record matching the requested isoform, then follows the URLs carried in that record: pdbUrl or cifUrl for the structure body, plddtDocUrl for the per-residue pLDDT array, paeDocUrl for the pAE matrix, and msaUrl for the input multiple-sequence alignment (an A3M file). The mean pLDDT is read from the record’s globalMetricValue field. Records and their provenance come directly from the official AlphaFold DB REST API. Results reflect the live database, which always serves the latest version of each prediction.

Learning Resources

Tools

AlphaFold DB Fetch (alphafold-db-fetch)

Retrieves a single AlphaFold DB prediction record by UniProt accession and returns the predicted sequence and its 1-indexed coordinates, gene and organism metadata, mean pLDDT, the AFDB artifact URLs, the full JSON record, and an optional parsed Structure carrying per-residue pLDDT and optional pAE on structure.metrics.

API Reference

Source
string
required
UniProt accession to look up (e.g. ‘P04637’).
integer
Isoform number to select from the multi-record AFDB response. None (default) returns the canonical entry (AF-{accession}-F1); 2 selects AF-{accession}-2-F1, etc. AFDB typically exposes isoforms 2-9 for human proteins. Raises ValueError if the requested isoform doesn’t exist.
Source
enum
default:"pdb"
Structure file format.Available options: pdb, cif
boolean
default:"True"
If True (default), fetch the structure body and the per-residue pLDDT array, returning a parsed Structure on the output. Set to False for metadata-only probes (URLs, mean pLDDT, gene, sequence) — saves ~100-500 KB per call, meaningful for batch sweeps.
boolean
default:"False"
If True, also fetch the PAE (predicted aligned error) matrix and attach it to output.structure.metrics["pae"]. Disabled by default — PAE files can be tens of MB for long proteins. No-op when include_structure=False.
boolean
default:"False"
If True, fetch the A3M MSA used as input to the AlphaFold prediction. Disabled by default — A3M files can be hundreds of KB to several MB for highly conserved proteins.
integer
default:"0"
Verbosity level (0=quiet, 1=info, 2=debug, 3=raw subprocess stderr). True is coerced to 1 and False to 0.
string
default:"cpu"
Device to run the tool on.
integer
default:"3600"
Maximum execution time in seconds. None waits indefinitely.
integer
Random seed. When set, tools run reproducibly up to small GPU float noise (see BaseToolOutput.approx_equal), and the seed participates in cache keys. When None, cacheable seed-sensitive tools skip cache until seeded.
Source
string
required
Primary UniProt accession that was looked up.
string
required
AlphaFold entry identifier (e.g. ‘AF-P04637-F1’).
string
Gene symbol from the AlphaFold record.
string
Source organism scientific name.
integer
NCBI taxonomy ID.
string
required
Amino-acid sequence covered by the prediction.
integer
required
Length of the predicted sequence.
integer
required
1-indexed start residue of the prediction (relative to the full UniProt sequence; >1 only for non-first fragments of very long proteins).
integer
required
1-indexed inclusive end residue of the prediction.
integer
required
Latest version of the AlphaFold DB prediction (this is the version of the served prediction; AlphaFold DB always serves the latest).
string
ISO 8601 timestamp when this prediction was generated.
number
Mean per-residue pLDDT for the prediction (AlphaFold DB’s globalMetricValue field). Always populated from the metadata response, regardless of include_structure; when include_structure=True it is also mirrored at structure.metrics["avg_plddt"].
string
required
URL to the PDB structure file on AlphaFold DB.
string
required
URL to the mmCIF structure file on AlphaFold DB.
string
URL to the BinaryCIF structure file; None on legacy entries that predate the bcif export.
string
required
URL to the PAE JSON document on AlphaFold DB.
string
required
URL to the per-residue pLDDT JSON document on AlphaFold DB.
string
required
URL to the rendered PAE PNG on AlphaFold DB.
string
URL to the MSA A3M used for prediction, when present.
string
AlphaMissense pathogenicity CSV URL (sequence coords); None for non-human or unscored entries.
string
AlphaMissense annotations on GRCh37.
string
AlphaMissense annotations on GRCh38.
string
CRC64 checksum of the predicted sequence.
Structure
Parsed AlphaFold structure (PDB or mmCIF body in structure_format, b_factor_type=BFactorType.PLDDT) with an :class:AlphaFoldDBMetrics metrics container carrying avg_plddt, plddt_per_residue, and (when include_pae=True) pae. None when include_structure=False.
string
A3M-format MSA contents used as input to the AlphaFold prediction. None when include_msa is False or when the entry has no associated MSA URL.
string
required
AlphaFold DB API URL used for the metadata lookup.
Dict[string, any]
Complete AlphaFold DB JSON record for advanced programmatic access.
Metrics

Applications

Use this to pull an AlphaFold-predicted structure into a pipeline when no experimental entry is needed: fetch a target by accession before inverse folding, docking, or binder design, screen accessions for AFDB coverage with metadata-only requests, or assess per-residue and pairwise confidence before structure-based work. The returned Structure feeds directly into structure-consuming tools such as TM-align, US-align, and structure scoring. The UniProt tool supplies the UniProt accession from a gene name and organism, and the PDB tool provides the experimental counterpart when one exists.

Usage Tips

  • Coverage is broad but not universal. When AFDB has no prediction for an accession the tool raises ValueError. Catch that error and fall back to predicting the structure from sequence.
  • A high mean_plddt can hide locally unreliable regions. Inspect the per-residue pLDDT on structure.metrics before trusting any specific residue.
  • latest_version advances when AFDB refreshes a prediction. Cache it alongside any structure you persist and refetch when it moves past the cached value.
  • Multiple records signal isoforms or fragments. The canonical record is selected by default and a warning lists the alternatives. To select a non-canonical isoform, pass the isoform input, and check entry_id, sequence_start, and sequence_end to confirm which record was returned.
  • Low-confidence regions are usually real disorder, not a prediction error. Disordered or flexibly linked regions get very low per-residue confidence (pLDDT) and high predicted aligned error (pAE) between regions because they have no single fixed shape. Find those residue ranges from the per-residue pLDDT array and trim or down-weight just those residues. Do not throw away the whole prediction, because the confident domains are still reliable.

Toolkit Notes

These apply to every AlphaFold DB tool in this toolkit (alphafold-db-fetch).
  • Requires network access. The tool calls the live AlphaFold DB REST API. It does not run offline and keeps no local copy of the database.
  • Subject to AlphaFold DB rate limits. The EMBL-EBI API is unauthenticated and applies per-IP fair-use limits (EMBL-EBI Terms of Use). Space out high-volume requests.
Example notebook: See the full working example for a copy-paste-ready walkthrough.

Infrastructure Guides

The following guides cover how to run tools efficiently and at scale.

Tool Persistence

Keep a tool’s model warm across calls instead of reloading it every invocation.

Device Management

How GPUs are allocated to tools and how to target specific devices.

Parallel Execution

Fan a batch of inputs out across multiple GPUs.