Skip to main content

A package to download PDB and EMDB files and process protein/map data

Project description

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
  1. Clone this repository:

    git clone https://github.com/chenwei-zhang/BioFetcher.git
    cd BioFetcher
    
  2. 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

BioFetcher-0.1.1.tar.gz (18.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

BioFetcher-0.1.1-py3-none-any.whl (17.8 kB view details)

Uploaded Python 3

File details

Details for the file BioFetcher-0.1.1.tar.gz.

File metadata

  • Download URL: BioFetcher-0.1.1.tar.gz
  • Upload date:
  • Size: 18.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.13

File hashes

Hashes for BioFetcher-0.1.1.tar.gz
Algorithm Hash digest
SHA256 74b730da2ab81f0e562898999504225f8530d216753682db8fe3a102b5608b16
MD5 8cf8ec49c5f7a1a0fc912f71e875f706
BLAKE2b-256 8aefc78c8decdcda5734e4b7c517b424f9d6272060682252b6e69b0edcf0da4f

See more details on using hashes here.

File details

Details for the file BioFetcher-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: BioFetcher-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 17.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.13

File hashes

Hashes for BioFetcher-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e30d50ef9903ed03dedfc7ceae31882852c269163e3814d211808aca6939d74b
MD5 4920bcdc5343a556b3e55172dcb9e051
BLAKE2b-256 3d2da467a1c36dfcd52a7458b71e22ef651baefb4451e8137586711e2baf7e94

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page