Skip to content

Add AFDBList class for PDBList-like AlphaFold downloads (#3990)#5176

Open
Abdeltoto wants to merge 2 commits intobiopython:masterfrom
Abdeltoto:feat/afdblist-pdblist-interface
Open

Add AFDBList class for PDBList-like AlphaFold downloads (#3990)#5176
Abdeltoto wants to merge 2 commits intobiopython:masterfrom
Abdeltoto:feat/afdblist-pdblist-interface

Conversation

@Abdeltoto
Copy link
Copy Markdown

Hi,

I worked on issue #3990. The idea was to add a PDBList-like interface for the AlphaFold database, so users can download predicted structures by UniProt ID in a familiar way.

I added an AFDBList class that mirrors the main PDBList workflow:

  • __init__(server, pdb, verbose) – same pattern as PDBList
  • retrieve_pdb_file(uniprot_id, pdir, file_format, overwrite) – same idea as PDBList’s retrieve_pdb_file, but for UniProt accessions

Supported formats are mmCIF (default) and PDB. When there are multiple models for a single accession (e.g. isoforms), the canonical one is preferred by default, with an optional model_index parameter to choose another.

I also switched the API base URL from alphafold.com to alphafold.ebi.ac.uk (the official EBI server) and added the missing AFDBList export to Bio.PDB.

Example usage::

from Bio.PDB import AFDBList

afdb = AFDBList()
path = afdb.retrieve_pdb_file("P00520")
# or as PDB format
path = afdb.retrieve_pdb_file("P00520", file_format="pdb")

Closes #3990

Add AFDBList class to Bio.PDB.alphafold_db with retrieve_pdb_file
method for downloading AlphaFold structures by UniProt ID. Supports
mmCIF and PDB formats. Switch API URL to alphafold.ebi.ac.uk.
Export AFDBList from Bio.PDB.

Closes biopython#3990

Made-with: Cursor
Copy link
Copy Markdown
Author

@Abdeltoto Abdeltoto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perfect

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Access to Alphafold database of 3D modules in a PDBList-like interface

1 participant