BioFetcher
BioFetcher is a Python package that allows you to download bioinformatics data, including PDB, FASTA, and EMDB files. It also includes utilities to extract resolutions for EMDB data and check if a PDB file corresponds to a protein structure.
Features
- Download PDB files from the RCSB Protein Data Bank.
- Download FASTA files associated with PDB entries.
- Download EMDB map files from the Electron Microscopy Data Bank (EMDB).
- Extract the resolution of an EMDB map.
- Check if a PDB file is a protein structure.
Installation
pip install BioFetcher
Installation - from source codes
-
Clone this repository:
git clone https://github.com/chenwei-zhang/BioFetcher.git cd BioFetcher
-
Install the package:
pip install .
Python Import
Once you have installed the package, you can import and use the functions in your own Python scripts or projects.
Importing Functions
Here’s how to import the key functions from the BioFetcher package:
from BioFetcher import BioDownloader, extract_res, is_protein_structure
Example Usage in Python
You can use the BioDownloader class to download PDB, FASTA, and EMDB files, or use the helper functions to extract EMDB resolution or check if a PDB corresponds to a protein structure.
# Example of using BioDownloader in Python
downloader = BioDownloader(download_path='.', verbose=True)
# Download PDB and FASTA files
downloader.download_pdb('1abc')
downloader.download_fasta('1abc')
# Check if PDB corresponds to a protein structure
is_protein = is_protein_structure('1abc.pdb')
print(f'Is protein structure: {is_protein}')
# Download EMDB file and extract resolution
downloader.download_emdb('1234')
resolution = extract_res('1234')
print(f'Resolution for EMDB 1234: {resolution}')
Functions
extract_res(emdb_id)
Extracts the resolution value of the EMDB entry with the given ID.
is_protein_structure(pdb_file_path)
Checks if the downloaded PDB file corresponds to a protein structure.
Command-Line Usage
You can run BioFetcher from the command line to download files based on the PDB and EMDB IDs, and specify the download path.
Command-Line Arguments
--pdb <PDB_ID>: Download the PDB file associated with the specified PDB ID.--fasta <PDB_ID>: Download the FASTA file associated with the specified PDB ID.--emdb <EMDB_ID>: Download the EMDB map file associated with the specified EMDB ID.--download_path <path>: Specify the directory to save the downloaded files (default is the current directory).
Example Usage
-
To download a PDB file and its associated FASTA file:
biofetcher --pdb 1abc --fasta 1abc --download_path /path/to/save/files
-
To download an EMDB map
biofetcher --emdb 1234 --download_path /path/to/save/files
-
To download all files for a specific PDB and EMDB ID:
biofetcher --pdb 1abc --fasta 1abc --emdb 1234 --download_path /path/to/save/files
License
This project is licensed under the GNU License - see the LICENSE file for details.
Support
Chenwei Zhang, chwzhan@gmail.com
Metadata
Release files for BioFetcher 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| BioFetcher-0.1.1.tar.gz | 18.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| BioFetcher-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 35.9 kB
Release files / BioFetcher-0.1.1.tar.gz
| Download URL | BioFetcher-0.1.1.tar.gz |
|---|---|
| Size | 18.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
74b730da2ab81f0e562898999504225f8530d216753682db8fe3a102b5608b16
|
|
BLAKE2b-256 checksum How to use checksums |
8aefc78c8decdcda5734e4b7c517b424f9d6272060682252b6e69b0edcf0da4f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.13
|
Release files / BioFetcher-0.1.1-py3-none-any.whl
| Download URL | BioFetcher-0.1.1-py3-none-any.whl |
|---|---|
| Size | 17.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e30d50ef9903ed03dedfc7ceae31882852c269163e3814d211808aca6939d74b
|
|
BLAKE2b-256 checksum How to use checksums |
3d2da467a1c36dfcd52a7458b71e22ef651baefb4451e8137586711e2baf7e94
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.13
|