AlphaFetcher
AlphaFetcher facilitates fetching and downloading protein metadata and related files from the
AlphaFold Protein Structure Database
using Uniprot access codes.
🌟 Features
-
Batch Import: Input single or multiple Uniprot access codes seamlessly.
-
Parallel Processing: Efficiently fetch metadata using multithreading.
-
Flexible Downloads: Choose among various file types - PDB, CIF, BCIF, PAE image, and PAE data files.
-
Optimal Performance: Easily adjust the number of workers for threaded tasks.
🔧 Installation
We recommend PyPI installation:
pip install alphafetcher
💡 Usage
from alphafetcher import AlphaFetcher
# Instantiate the fetcher
# The base_savedir parameter allows you to set a base directory where files will be saved.
# Inside this directory, two separate directories for pdb and cif files will be created.
fetcher = AlphaFetcher(base_savedir="my_savedir")
# Add desired Uniprot access codes
fetcher.add_proteins(["A1KXE4", "H0YL14", "B2RXH2", "A8MVW5"])
# Retrieve metadata
fetcher.fetch_metadata(multithread=True, workers=4)
# Metadata available at fetcher.metadata_dict
# Commence download of specified files
fetcher.download_all_files(pdb=True, cif=True, multithread=True, workers=4)
📜 Documentation
Initialization
AlphaFetcher(base_savedir: str)- Description: Initialize the fetcher with a base save directory. The
base_savediris where the downloaded pdb and cif files will be stored. Inside this directory, two subdirectories will be automatically created: one for pdb files and another for cif files. - Parameters:
base_savedir: The base directory where the pdb and cif files will be saved.
- Description: Initialize the fetcher with a base save directory. The
Methods
-
add_proteins(proteins: Union[str, List[str]])- Description: Add the provided Uniprot access codes for fetching. A single string or a list of strings are accepted.
-
fetch_metadata(multithread: bool = False, workers: int = 10)- Description: Extracts metadata corresponding to the supplied Uniprot access codes. This metadata is used to
download the relevant files and is stored in
fetcher.metadata_dict, assuming the notation of the example above is followed.
- Description: Extracts metadata corresponding to the supplied Uniprot access codes. This metadata is used to
download the relevant files and is stored in
-
download_all_files(uniprot_access: str, pdb: bool = False, cif: bool = False, bcif: bool = False, pae_image:bool = False, pae_data: bool = False)- Description: Initiates download for the specified file types linked to the given Uniprot codes.
- Specify the types of files to be downloaded by changing the values of their parameters to True.
For a comprehensive guide, users are encouraged to view the docstrings incorporated within the source code.
⚠️ Limitations
Always respect the AlphaFold Protein Structure Database terms of service, ensuring not to flood it with excessive concurrent requests. Consider adjusting the number of workers to reduce the requests density.
🙌 Contributing
We welcome your contributions! To collaborate:
- Fork this repository.
- Commit your changes.
- Open a pull request with your updates.
📖 Authors and Acknowledgment
- Jose Gavalda-Garcia - Author - jose.gavalda.garcia@vub.be
- Wim Vranken - Supervisor - wim.vranken@vub.be
📄 License
This project is licensed under the GNU General Public License v3 (GPLv3).
Metadata
Release files for AlphaFetcher 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| AlphaFetcher-0.2.0.tar.gz | 6.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| AlphaFetcher-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.6 kB
Release files / AlphaFetcher-0.2.0.tar.gz
| Download URL | AlphaFetcher-0.2.0.tar.gz |
|---|---|
| Size | 6.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c641984999fbcece38dcb3676baf0553f143687d68f0e069da7a0759908aa346
|
|
BLAKE2b-256 checksum How to use checksums |
23dc29cb4113277eda5721cf0ea9fbabb14c5a70453c1227f1859834600e2b05
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.12
|
Release files / AlphaFetcher-0.2.0-py3-none-any.whl
| Download URL | AlphaFetcher-0.2.0-py3-none-any.whl |
|---|---|
| Size | 6.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6d22bdca137978dbd551ba82408af533ee6f949ad3f8ad39b628499d687611f1
|
|
BLAKE2b-256 checksum How to use checksums |
b8f953e88af0dd9b8fb79c7fe16b05da73363db821c94c464a6ff28c919fdd9c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.12
|