Skip to main content

2.2 Use biological databases

Retrieve structured records and keep their identifiers attached to interpretations.

Records before interpretation

UniProt provides protein sequence and annotation records. The Protein Data Bank provides experimentally determined structures and associated metadata. They answer different questions: an annotation record and a structure record are not interchangeable.

Start with a stable identifier, confirm the organism and inspect the record directly. Common names alone may be ambiguous. For a public example, the reviewed human p53 UniProt entry is P04637.

An original, minimal lookup

This standard-library Python example downloads a public UniProt record and prints a few fields. Run it in your own Python environment or notebook. It makes a public network request and uses no AI provider or API key.

Python
import json
from urllib.request import urlopen

accession = "P04637"
url = f"https://rest.uniprot.org/uniprotkb/{accession}.json"
with urlopen(url, timeout=20) as response:
    record = json.load(response)

print(record["primaryAccession"])
print(record["organism"]["scientificName"])
print("Sequence length:", record["sequence"]["length"])
print("Source:", url)

Carry provenance through the workflow

If you ask a model to interpret a record, preserve the accession, retrieval date and fields used. Label a database annotation as an annotation and a model-generated hypothesis as a hypothesis.

Missing fields should stay missing. Do not let a model fill an absent experimental detail from its general knowledge and present it as part of the retrieved record.

Further reading

Original reference materials. External notebooks run on their own services, not on this site.