Skip to main content

Ruff ty Tests License: MIT Python 3.11+ PyPI version Docs

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 and interactive viewing through atomview.

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 using uv:

uv add pocketeer

Install with development dependencies:

uv add 'pocketeer[dev]'

Quick Start

Example pocketeer output

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_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
    sasa_threshold=25.0,  # SASA threshold for buried spheres (Ų)
)

Merging Pockets

You can combine multiple pockets into a single merged pocket:

import pocketeer as pt

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

# Merge the top 3 pockets
merged = pt.merge_pockets(pockets[:3])
print(f"Merged pocket volume: {merged.volume:.1f} ų")

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 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 - Calculate SASA (solvent accessible surface area) for atoms defining each sphere
  4. Surface Filtering - Filter to buried spheres using SASA threshold (spheres with mean SASA < threshold)
  5. Clustering - Group buried spheres into pockets using graph connectivity
  6. 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 (or run just all)
  5. 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.

Metadata

Release files for pocketeer 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pocketeer 0.4.0
File Size Uploaded Provenance Actions
pocketeer-0.4.0.tar.gz 4.5 MB With provenance Details for pocketeer-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pocketeer 0.4.0
File Interpreter ABI Platform Actions
pocketeer-0.4.0-py3-none-any.whl Python 3 none any Details for pocketeer-0.4.0-py3-none-any.whl

Total release size: 4.6 MB

Release files / pocketeer-0.4.0.tar.gz

Download URL pocketeer-0.4.0.tar.gz
Size 4.5 MB
Tags Source
SHA-256 checksum
How to use checksums
8fb95677c5458dcacce7749ef7d6130bdb5d5c36761afe4a894311bacf8d8f39
BLAKE2b-256 checksum
How to use checksums
b3febab25768af8d68d8a66a15ec7dd23f4f181642a84279d555a1adab2e319f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 22, 2026.

Transparency log

Release files / pocketeer-0.4.0-py3-none-any.whl

Download URL pocketeer-0.4.0-py3-none-any.whl
Size 27.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c814c4eadc461c15b032fbca84a7a2a862dc0654cbea1ad8c541bacf849bd897
BLAKE2b-256 checksum
How to use checksums
7e9ed7d2d13cef2e360fd1022f4c81045bb101e521d82689cfe627657ddff49c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 22, 2026.

Transparency log

Security for pocketeer 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pocketeer-0.4.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 22, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page