alphafold
DownloadableFormat = Literal['bcif', 'cif', 'pdb', 'paeImage', 'paeDoc', 'amAnnotations', 'amAnnotationsHg19', 'amAnnotationsHg38']
module-attribute
Types of formats that can be downloaded from the AlphaFold web service.
downloadable_formats = {'bcif', 'cif', 'pdb', 'paeImage', 'paeDoc', 'amAnnotations', 'amAnnotationsHg19', 'amAnnotationsHg38'}
module-attribute
Set of formats that can be downloaded from the AlphaFold web service.
AlphaFoldEntry
dataclass
AlphaFoldEntry represents a minimal single entry in the AlphaFold database.
See https://alphafold.ebi.ac.uk/api-docs for more details on the API and data structure.
fetch_many(ids, save_dir, what=None)
Synchronously fetches summaries and pdb and pae files from AlphaFold Protein Structure Database.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ids
|
Iterable[str]
|
A set of Uniprot IDs to fetch. |
required |
save_dir
|
Path
|
The directory to save the fetched files to. |
required |
what
|
set[DownloadableFormat] | None
|
A set of formats to download (e.g., "pdb", "cif"). Defaults to {"pdb"}. |
None
|
Returns:
Type | Description |
---|---|
list[AlphaFoldEntry]
|
A list of AlphaFoldEntry dataclasses containing the summary, pdb file, and pae file. |
fetch_many_async(ids, save_dir, what=None)
async
Asynchronously fetches summaries and pdb and pae (predicted alignment error) files from AlphaFold Protein Structure Database.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ids
|
Iterable[str]
|
A set of Uniprot IDs to fetch. |
required |
save_dir
|
Path
|
The directory to save the fetched files to. |
required |
what
|
set[DownloadableFormat] | None
|
A set of formats to download. Defaults to {"pdb"}. |
None
|
Yields:
Type | Description |
---|---|
AsyncGenerator[AlphaFoldEntry]
|
A dataclass containing the summary, pdb file, and pae file. |
relative_to(entry, session_dir)
Convert paths in an AlphaFoldEntry to be relative to the session directory.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
entry
|
AlphaFoldEntry
|
An AlphaFoldEntry instance with absolute paths. |
required |
session_dir
|
Path
|
The session directory to which the paths should be made relative. |
required |
Returns:
Type | Description |
---|---|
AlphaFoldEntry
|
An AlphaFoldEntry instance with paths relative to the session directory. |
url2name(url)
Given a URL, return the final path component as the name of the file.