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.0.tar.gz (9.3 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.0-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: protfunc-0.1.0.tar.gz
  • Upload date:
  • Size: 9.3 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.0.tar.gz
Algorithm Hash digest
SHA256 2f4f5b9f767f72ce28f05c6607f208b6356a18f608b33a70fea10dbe694a1137
MD5 896bf4beb14fdd7deaf3863768dddc5e
BLAKE2b-256 1ad31188c1febba68f0c2dfee2108814cec3bfcb7af8daf608e65fd12a033038

See more details on using hashes here.

File details

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

File metadata

  • Download URL: protfunc-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.3 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 236959135ebd13c87faf1c8cd8f72cc20181bb044c709f3cb676c643eb7666f4
MD5 d1db1cad2b1e2a879f7b10f0fb52c1b0
BLAKE2b-256 5ed80484ba1385241e5cc95ee44eb1479775216a96600291357dceb27b79c443

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