Skip to main content

A minimal, fpocket-style pocket finder in pure Python/Numpy.

Project description

Ruff ty Tests License: MIT Python 3.11+

Pocketeer

Pocketeer Logo

A lightweight, fast pocket finder in Python.

Pocketeer detects binding pockets and cavities in protein structures using the alpha-sphere method based on Delaunay tessellation—similar to the popular fpocket, but with a modern, Pythonic interface. It's lightweight, fast, and easy to use as both a Python library and a command-line tool. Pocketeer natively supports atomarrays from biotite, making it fully compatible with atomworks.

🚧 Warning: This software is in alpha. Some features (e.g., similarity calculation) are not yet implemented and there may be bugs. If you encounter any issues, please open an issue on the repository. 🚧

Installation

pip install pocketeer
Other options

Install with notebook viewer:

pip install pocketeer[vis]

Install using uv:

uv add pocketeer

Install with extra dependencies, e.g. for notebook/visualization support:

uv add 'pocketeer[vis]'
uv add 'pocketeer[dev, vis]'

Quick Start

A couple quick tips before you start:

  • Pocketeer automatically removes hydrogens from your structure, and is designed to work with them absent, so you don't need to worry about them.
  • By default, Pocketeer removes all waters and hetero atoms from your input structure. Set ignore_hetero to False if you don't want this behavior (e.g. to take into account a metal ion in the pocket).

Python API

import pocketeer as pt

# Load structure from PDB file
atomarray = pt.load_structure("protein.pdb")

# Detect pockets with default parameters
pockets = pt.find_pockets(atomarray)

# Print results
for pocket in pockets:
    print(f"Pocket {pocket.pocket_id}:")
    print(f"  Score: {pocket.score:.2f}")
    print(f"  Volume: {pocket.volume:.1f} ų")
    print(f"  Spheres: {pocket.n_spheres}")

Custom Parameters

import pocketeer as pt

# Load structure
atomarray = pt.load_structure("protein.pdb")

# Find pockets with custom parameters
pockets = pt.find_pockets(
    atomarray,
    r_min=3.0,           # Minimum sphere radius (Å)
    r_max=6.0,           # Maximum sphere radius (Å)
    min_spheres=30,      # Minimum spheres per pocket cluster
    merge_distance=2.5,  # Distance threshold for clustering
)

Command-Line Interface

# Basic usage
pocketeer protein.pdb # also works with .cif files 

# Custom output directory
pocketeer protein.pdb --o results/

# Adjust parameters
pocketeer protein.pdb --r-min 2.5 --r-max 7.0 --min-spheres 25

Output Files

The CLI generates these output files:

  • pockets.json - All pocket descriptors in JSON format
  • json/ - Subdirectory with individual JSON files for each pocket (pocket_0.json, pocket_1.json, etc.)
  • summary.txt - Human-readable summary (unless --no-summary is used)

Algorithm

Pocketeer implements a simplified version of the fpocket algorithm:

  1. Delaunay Tessellation - Compute Delaunay triangulation of protein atoms
  2. Alpha-Sphere Detection - Extract circumspheres of tetrahedra within radius bounds
  3. Polarity Labeling - Classify spheres as buried (interior) or surface
  4. Clustering - Group buried spheres into pockets using graph connectivity
  5. Scoring - Rank pockets by volume and geometric features

Limitations

  • Simplified scoring compared to fpocket (no hydrophobicity, flexibility, etc.)
  • Volume estimation is approximate (voxel-based)

Visualization in Notebooks

Pocketeer integrates smoothly with Jupyter and scientific Python notebooks. You can directly visualize detected pockets for rapid exploration:

import pocketeer as pt

# Load structure
atomarray = pt.load_structure("protein.pdb")
pockets = pt.find_pockets(atomarray)

# Visualize the pockets in your notebook
pt.view_pockets(atomarray, pockets)
Pocketeer notebook visualization example

Example notebook visualization of predicted binding pockets colored by cluster.

Citation

If you use Pocketeer in your research, please cite the original fpocket paper:

Le Guilloux, V., Schmidtke, P., & Tuffery, P. (2009). Fpocket: An open source platform for ligand pocket detection. BMC Bioinformatics, 10(1), 168.

License

MIT License - see LICENSE file for details.

Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Add tests for new functionality
  4. Run ruff check --fix && ruff format before committing
  5. Submit a pull request

Development installation

git clone https://github.com/cch1999/pocketeer.git
cd pocketeer
pip install -e ".[dev]"

Support

For bugs and feature requests, please open an issue on GitHub.

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

pocketeer-0.0.2.tar.gz (3.2 MB view details)

Uploaded Source

Built Distribution

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

pocketeer-0.0.2-py3-none-any.whl (22.2 kB view details)

Uploaded Python 3

File details

Details for the file pocketeer-0.0.2.tar.gz.

File metadata

  • Download URL: pocketeer-0.0.2.tar.gz
  • Upload date:
  • Size: 3.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pocketeer-0.0.2.tar.gz
Algorithm Hash digest
SHA256 bfd039101941cb33c709f936c1a18dac2861c3b6f8fe3dfca7c649d1b5c98bea
MD5 be2a2e00a2d3ae9fadf4234c46060e94
BLAKE2b-256 817632a79b8d2d9dae3265e44f494d1c9b1a4a90218c90af5c43b68d01095dce

See more details on using hashes here.

Provenance

The following attestation bundles were made for pocketeer-0.0.2.tar.gz:

Publisher: deploy.yml on cch1999/pocketeer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pocketeer-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: pocketeer-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 22.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pocketeer-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ce32034422c736577d526dac9348fdfda2f7be1e34fe3b41547cd65d28cdad1e
MD5 be5c5eaed63135d98aa11c201de02a96
BLAKE2b-256 4d73fb3c85902aa57ed6c55f86dc0101135418dd711d8d0fa8344226f0282b74

See more details on using hashes here.

Provenance

The following attestation bundles were made for pocketeer-0.0.2-py3-none-any.whl:

Publisher: deploy.yml on cch1999/pocketeer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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