Skip to main content

Protein structure Fetcher from online databases

Project description

profet

A Python 3 protein structure fetcher. Retrieves the cif or pdb files from either the RCSB Protein Data Bank (PDB, using pypdb) or Alphafold using the Uniprot ID.

Code style: black PyPI version shields.io PyPI pyversions

Building Publishing Documentation

Dependencies

Please install the latest version of PyPDB using:

pip install pypdb

or

pip install git+git://github.com/williamgilpin/pypdb

Installation

Install profet using pip:

pip install profet

To install the development version, which contains the latest features and fixes, install directly from GitHub using

pip install git+git://github.com/alan-turing-institute/profet

Test the installation, navigate to the root directory and run

pytest

This code has been designed and tested for Python 3.

Usage

This package can be used to retrieve the available protein structure from any Uniprot ID.

The Fetcher class can search the IDs in both PDB and Alphafold, and saves the search results in a dictionary.

get_file returns the structure corresponding to uniprot_id in the defined filetype: (default as 'pdb', option as 'cif'), searching first in the defaulted database db (default as 'pdb', option as 'alphafold'). The files can be saved to a local file with filesave.

set_default_db changes the default database into the given one between 'pdb' and 'alphafold'.

set_directory changes the directory where the files are saved. Files save as <directory>/<id>.<filetype>.

Run search_history() to see the search history of the fetcher.

Example usage:

import profet as pf
fetcher = pf.Fetcher()
fetcher.set_directory("/path/to/directory/folder")
fetcher.get_file(uniprot_id = "P61316", filetype = "pdb", filesave = True, db = "alphafold")

fetcher.search_history()

returns:

{'P61316': ['pdb', 'alphafold']}

Loads Profet and the file-fetcher, then specifies a directory to save the files at. Lastly, downloads the protein with uniprod ID "P61316", in pdb format from the Alphafold databank and saves it in the specified directory.

For more detailed examples consult the following Python notebook.

Documentation

You can find more documentation including a description of the python api here.

Issues and Feature Requests

If you run into an issue, or if you find a workaround for an existing issue, we would very much appreciate it if you could post your question or code as a GitHub issue.

Contributions

If you would like to help contribute to profet, please read our contribution guide and code of conduct.

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

profet-0.0.0.tar.gz (7.2 kB view hashes)

Uploaded Source

Supported by

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