A minimal, fpocket-style pocket finder in pure Python/Numpy.
Project description
Pocketeer
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.
Read the full documentation here.
🚧 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
Example output image from Pocketeer
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_heterotoFalseif 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
sasa_threshold=25.0, # SASA threshold for buried spheres (Ų)
)
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
# Fine-tune buried sphere detection
pocketeer protein.pdb --sasa-threshold 25.0 --polar-probe 1.6
Output Files
The CLI generates these output files:
pockets.json- All pocket descriptors in JSON formatjson/- Subdirectory with individual JSON files for each pocket (pocket_0.json,pocket_1.json, etc.)summary.txt- Human-readable summary (unless--no-summaryis used)
Algorithm
Pocketeer implements a simplified version of the fpocket algorithm:
- Delaunay Tessellation - Compute Delaunay triangulation of protein atoms
- Alpha-Sphere Detection - Extract circumspheres of tetrahedra within radius bounds
- Polarity Labeling - Calculate SASA (solvent accessible surface area) for atoms defining each sphere
- Surface Filtering - Filter to buried spheres using SASA threshold (spheres with mean SASA < threshold)
- Clustering - Group buried spheres into pockets using graph connectivity
- 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)
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:
- Fork the repository
- Create a feature branch
- Add tests for new functionality
- Run
ruff check --fix && ruff formatbefore committing (or runjust all) - Submit a pull request
Development installation
git clone https://github.com/cch1999/pocketeer.git
cd pocketeer
pip install -e ".[dev]" # or uv sync --dev
Support
For bugs and feature requests, please open an issue on GitHub.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pocketeer-0.1.0.tar.gz.
File metadata
- Download URL: pocketeer-0.1.0.tar.gz
- Upload date:
- Size: 3.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5d92fc714fcd72ebc4007f91dab720fe592c53d480bfa575a90dd53365a059b0
|
|
| MD5 |
9a9315ad9feaeb21cbd9e5486c5b62f2
|
|
| BLAKE2b-256 |
8e2aa42e4158e91cf1d7d8b57b7bce722c4e8d278a85caf6709ddd138dfb92c9
|
Provenance
The following attestation bundles were made for pocketeer-0.1.0.tar.gz:
Publisher:
deploy.yml on cch1999/pocketeer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pocketeer-0.1.0.tar.gz -
Subject digest:
5d92fc714fcd72ebc4007f91dab720fe592c53d480bfa575a90dd53365a059b0 - Sigstore transparency entry: 723322872
- Sigstore integration time:
-
Permalink:
cch1999/pocketeer@5fb289e3b39f9e8face988863c76e1a6da3c0004 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/cch1999
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
deploy.yml@5fb289e3b39f9e8face988863c76e1a6da3c0004 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pocketeer-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pocketeer-0.1.0-py3-none-any.whl
- Upload date:
- Size: 23.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
60ba7e530667142636aac753c00db4d8e1b4007dbc29d50cc129ced2cf9a42a8
|
|
| MD5 |
516f848865c4464b10ff7f6230bd3493
|
|
| BLAKE2b-256 |
3b700c2a8836a9b17a9830e13f97ffceb8d53afe73e57cf893bf65cfd8003016
|
Provenance
The following attestation bundles were made for pocketeer-0.1.0-py3-none-any.whl:
Publisher:
deploy.yml on cch1999/pocketeer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pocketeer-0.1.0-py3-none-any.whl -
Subject digest:
60ba7e530667142636aac753c00db4d8e1b4007dbc29d50cc129ced2cf9a42a8 - Sigstore transparency entry: 723322881
- Sigstore integration time:
-
Permalink:
cch1999/pocketeer@5fb289e3b39f9e8face988863c76e1a6da3c0004 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/cch1999
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
deploy.yml@5fb289e3b39f9e8face988863c76e1a6da3c0004 -
Trigger Event:
push
-
Statement type: