Skip to main content

Python SDK for the POOL / GRASP-Func protein functional site prediction server

Project description

protfunc

Python SDK for the POOL / GRASP-Func protein functional site prediction server, developed by the Ondrechen Research Group at Northeastern University.

POOL (Partial Order Optimum Likelihood) identifies functionally important residues in proteins. GRASP-Func (Graph Representation of Active Sites for the Prediction of Function) classifies protein function by comparing local active-site structures.

Installation

pip install protfunc

Quick Start

from protfunc import Client

client = Client()

# Run POOL on a directory of .pdb files
results = client.run_pool("./structures/", output_dir="./pool_output/")

Usage

POOL

Provide a directory of .pdb files (or a pre-made .zip):

from protfunc import Client

client = Client()
results = client.run_pool("./my_pdb_files/")
# results is a Path pointing to the extracted output directory

GRASP-Func — Step by Step

Run each stage independently. The output of each step feeds into the next:

# Step 1: Pre-processing
preprocessed = client.preprocess("./input/", output_dir="./pre/")

# Step 2: Processing (graph matching)
processed = client.process(preprocessed, output_dir="./proc/")

# Step 3: Visualization
viz = client.visualize(processed, known_proteins=["1a2b", "3c4d"], output_dir="./viz/")

GRASP-Func — Full Pipeline

Or run everything in a single call:

results = client.run_graspfunc(
    "./input/",
    known_proteins=["1a2b", "3c4d"],
    output_dir="./results/",
)

Extract Protein Names

Pull the list of proteins from result files (useful for populating the known_proteins argument):

proteins = client.extract_proteins("./processed/")
# ['protein_a', 'protein_b', ...]

Server Health Check

if client.ping():
    print("Server is up")

Progress Callbacks

By default, the SDK prints progress to the console:

[1/3] preprocess: starting...
[1/3] preprocess: uploading (2.3 MB)...
[1/3] preprocess: running...
[1/3] preprocess: ✓ done (14.2s)
[2/3] process: starting...
...

Custom Callback

Receive structured ProgressEvent objects:

from protfunc import Client, ProgressEvent

def my_callback(event: ProgressEvent):
    print(f"{event.stage}{event.status.value} ({event.elapsed:.1f}s)")

client = Client(on_progress=my_callback)
client.run_pool("./structures/")

Silent Mode

client = Client(base_url="...", on_progress=False)

Per-Call Override

client.run_pool("./structures/", on_progress=my_callback)
client.preprocess("./input/", on_progress=False)  # silent for this call only

Input Formats

Method Expected Input
run_pool() Directory of .pdb files or a .zip containing them
preprocess() ZIP or directory with input/family/g* structure containing .pdb and .tcranks/.TICranks files
process() Output of preprocess() — contains .pdb, .rank, .qhull, .sc, and .tcranks files
visualize() Output of process() — contains results_inter.txt and results_intra.txt

Configuration

Parameter Default Description
base_url http://localhost:8000 Server URL
timeout 1800 (30 min) Request timeout in seconds
on_progress Console output Progress callback, False for silent

Citations

If you use this tool in your research, please cite:

Somarowthu, S. & Ondrechen, M. J. (2012). POOL server: machine learning application for functional site prediction in proteins. Bioinformatics, 28(15), 2078–2079.

Mills, C. L., Garg, R., Lee, J. S., Tian, L., Suciu, A., Cooperman, G. D., Beuning, P. J., & Ondrechen, M. J. (2018). Functional classification of protein structures by local structure matching in graph representation. Protein Science, 27(6), 1125–1135.

License

MIT

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

protfunc-0.1.1.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

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

protfunc-0.1.1-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: protfunc-0.1.1.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for protfunc-0.1.1.tar.gz
Algorithm Hash digest
SHA256 1a31d7ab52c1e0618385e7ddd85f0784c308f1ab9ed7295fd00e00bdb2e61671
MD5 afbcc1fe202b7575f084718df97d888d
BLAKE2b-256 873a43d89bd88f26fa88d8d5e1a9c3be8e42f8e5434e294d129c79fb35e7239b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: protfunc-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 8.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for protfunc-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a3abe57e89a2601d673f00aa6fa1083a983e65d4fd30d40b1bf85763ff213085
MD5 25742955b707067ec72f3acc1c72294d
BLAKE2b-256 4b960b7d4c57094f3552623783416ce01c15cb9383a17de1e5137c11ea316ed6

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