AI-Driven Research & Agentic Bioinformatics-2026-08-24

Retrieve an AlphaFold DB model and assess pLDDT

NM

Nasir Mahmood Abbasi, PhD

Bioinformatics Educator

Scope boundary. This lesson retrieves a precomputed public AlphaFold DB entry and inspects its PDB metadata and per-residue Cα B-factor values. It does not predict a new structure, design a protein, run AlphaFold 3, evaluate binding, or validate experimental accuracy. The included PDB is a constructed parser fixture, not biological data.

Use R to inspect a local protein structure file or, in a separate explicit network step, query the documented AlphaFold DB API for a UniProt accession and download the exact PDB URL returned by that API. Retrieval is not a new prediction or protein-design workflow.

Format: Hands-on lab. R is the primary route. Offline PDB analysis uses base R and the bundled synthetic fixture; the explicit public API fetch additionally uses the lightweight jsonlite package. The optional Python workflow remains available for equivalent retrieval and inspection.

Goal and prerequisites

Produce a residue-level CSV and a summary CSV for a local PDB, or retrieve an AlphaFold DB entry and preserve its API response, model file, source URL, accession, version metadata, and inspection tables. The R parser supports a single PDB model, integer residue numbers, and blank/A alternate conformers. It is deliberately a small teaching reader, not a general-purpose PDB or mmCIF parser.

Offline analysis uses base R and has no network requirement. The explicit fetch uses internet access and jsonlite; no API key, GPU, paid account, or model weights are needed. The public example is UniProt accession P69905 (hemoglobin subunit alpha). Use R 4.0 or newer.

Database retrieval is not a new prediction

AlphaFold DB archives precomputed predictions and its API returns model metadata and advertised file URLs. This lesson requests that public API only when you run the fetch command. It is different from submitting a sequence to AlphaFold 3 Server; a single-chain database entry is not a new complex or ligand-containing prediction. Structure generation, sequence design, and AlphaFold 3 jobs are out of scope.

R workflow: retrieve the advertised file and inspect it

Download inspect_alphafold.R and the optional Python utility into a new working directory. Offline R inspection needs only base R. For the R API fetch only, install jsonlite if needed with install.packages("jsonlite"); do not install it if you only inspect a local PDB.

Rscript inspect_alphafold.R fetch P69905 results
python3 protein_structure_workflow.py fetch P69905 --outdir results

These are complete optional routes for the same public-entry retrieval and Cα inspection, not structure prediction. The R fetch queries https://alphafold.ebi.ac.uk/api/prediction/P69905, accepts one unambiguous matching record, checks that the returned PDB URL uses the official HTTPS AlphaFold DB host, downloads that advertised file, then parses it. Both routes require an empty/new output directory and do not invent a versioned URL or overwrite prior outputs. The R route saves the API response, PDB, residue CSV, and summary CSV. The Python route retains its API response, PDB, and JSON report with SHA-256 provenance.

The R summary records accession, model identifier and version when supplied, source URL, local filename and byte count, number of parsed Cα residues, chains, and mean/minimum/maximum B-factor. Each residue row records chain, residue number, insertion code, and B-factor. R labels B-factor as pLDDT only on its API-verified fetch path. Retrieval is subject to network and service availability; the offline tests make no live call.

If you already have a local PDB, skip the API. These commands perform the same local Cα metadata inspection offline:

Rscript inspect_alphafold.R analyze path/to/model.pdb local_review
python3 protein_structure_workflow.py analyze path/to/model.pdb --out local_review.json

R writes local_review_residues.csv and local_review_summary.csv; Python writes JSON to local_review.json. Offline provenance is unverified in both routes, so B-factor is reported as given and is not labeled pLDDT. Both modes refuse inputs above 10 MiB, malformed Cα records, repeated same-altloc records, out-of-range values, and unsupported multiple-model files.

Offline software check

Download the constructed synthetic Cα fixture beside the R script, then run:

Rscript inspect_alphafold.R analyze synthetic_ca_fixture.pdb fixture_review

The fixture has three made-up Cα records across two chains with B-factors 60, 80, and 40. Expect a count of 3, mean 60, minimum 40, and maximum 80. Those values exercise parsing only; they are not a structure-quality observation. The optional R Markdown report template displays the same offline summary and residue table. Render it from the example directory with Rscript -e 'rmarkdown::render("protein_structure_review.Rmd")'; that report wrapper requires rmarkdown and Pandoc, not the local parser.

Optional Python route

The existing Python utility performs the same explicit API-advertised retrieval and local PDB Cα inspection. It is a separate, retained standard-library workflow with its existing tests; its JSON report includes a SHA-256 file hash and a detailed interpretation field, whereas the R route writes residue and summary CSVs. Neither route predicts or designs a protein.

Download the existing Python test suite beside its utility to run python3 -m unittest -v test_protein_structure_workflow.py. The tests use constructed PDB text and do not contact the live API.

Interpret B-factor and pLDDT carefully

For a verified AlphaFold-predicted PDB file, the B-factor column stores pLDDT, a per-residue estimate of local model confidence from 0 to 100. Higher pLDDT indicates greater local confidence. AlphaFold DB describes rough bands: above 90 very high, 70–90 confident, 50–70 low, and below 50 very low. These are interpretive guidance, not probabilities of function, binding, or experimental correctness.

Inspect residue patterns rather than relying on a chain-wide average. pLDDT is local and does not establish domain orientation, oligomeric state, binding, function, stability, or experimental accuracy. The R parser does not read PAE, validate geometry, align structures, parse mmCIF, or assess a design. Experimental PDB B-factors are not pLDDT and commonly describe atomic displacement; occupancy is a separate field.

Limitations and official sources

  • The fetch stops if the accession is invalid, the API has no model, the response is ambiguous, or the advertised URL is outside the official HTTPS host. Select a specific official entry before analysis if multiple records match.
  • Offline parsing cannot establish provenance. Confirm an external PDB source before interpreting B-factor as pLDDT.
  • The scripts summarize file fields only. Do not use these outputs alone for biological, therapeutic, or protein-design decisions.
  • AlphaFold DB API documentation.
  • AlphaFold DB FAQs on pLDDT and PAE.
  • EMBL-EBI training on pLDDT.
  • Jumper et al. (2021), AlphaFold, Nature.

Software and package behaviour can change. Please re-check commands against the official documentation. If a command does not work, you find an error, or the tutorial is no longer reproducible, please report it through the Contact page

Author: Nasir Mahmood Abbasi, PhD - Category: AI-Driven Research & Agentic Bioinformatics

Back to topRetrieve an AlphaFold DB model and assess pLDDT