Multi-method binding pocket detection and druggability assessment. Grid-based, fpocket, and P2Rank detection with druggability scoring, visualization, and cross-structure comparison.
64
78%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Medium
Suggest reviewing before use
Fix and improve this skill with Tessl
tessl review fix ./backend/cli/skills/chemistry/pocket-detection/SKILL.mdThis skill provides multi-method binding pocket detection on protein structures, druggability scoring, pocket visualization, and cross-structure pocket comparison. It is the first dedicated step in any structure-based drug design workflow — identifying where on a protein a small molecule can bind before docking or de novo design begins.
Key capabilities:
Use the pocket-detection skill when you need to:
Trigger phrases: "find binding pocket", "detect active site", "druggability assessment", "pocket detection", "where does the ligand bind", "compare binding sites"
Do NOT use this skill for:
molecular-docking)binding-affinity)structure-prediction first, then this)dock.py --center_x/y/z.# Core (required for all modes)
pip install biopython numpy scipy# fpocket method (external binary)
# Ubuntu/Debian: sudo apt-get install fpocket
# macOS: brew install fpocket
# Or build from source: https://github.com/Discngine/fpocket
# P2Rank method (external binary)
# Download from: https://github.com/rdk/p2rank/releases
# Set P2RANK_HOME environment variable to installation directory
# Visualization
pip install matplotlib
# RDKit (optional, for enhanced hydrogen bond analysis)
pip install rdkit-pypipython -c "from Bio.PDB import PDBParser; print('BioPython OK')"
python -c "import numpy; print('NumPy OK')"
python -c "from scipy.spatial import ConvexHull; print('SciPy OK')"
python -c "import shutil; print('fpocket:', 'OK' if shutil.which('fpocket') else 'not found')"Before running pocket detection, verify the PDB structure species matches the user's target. If the user requests "human" but the PDB HEADER shows another organism (e.g., murine), flag this to the user before proceeding. Parse the PDB HEADER/SOURCE records to check organism.
Detect binding pockets on a prepared protein structure using the built-in grid-based cavity scan.
# Basic detection
python scripts/detect.py \
--input prepared_protein.pdb \
--output pockets.json
# With chain selection and custom parameters
python scripts/detect.py \
--input protein.pdb \
--output pockets.json \
--chain A \
--min-volume 200 \
--max-pockets 5
# Also check co-crystallized ligand sites
python scripts/detect.py \
--input protein_with_ligand.pdb \
--output pockets.json \
--include-ligand-sitesRun multiple detection methods for higher confidence.
# Grid-based (built-in, no external deps)
python scripts/detect.py --input protein.pdb --output pockets_grid.json --method grid
# fpocket (requires fpocket binary)
python scripts/detect.py --input protein.pdb --output pockets_fpocket.json --method fpocket
# P2Rank (requires P2Rank installation)
python scripts/detect.py --input protein.pdb --output pockets_p2rank.json --method p2rank
# Auto: tries P2Rank → fpocket → grid (first available)
python scripts/detect.py --input protein.pdb --output pockets.json --method autoScore detected pockets for drug-likeness.
python scripts/druggability.py \
--input protein.pdb \
--pockets pockets.json \
--output druggability.jsonGenerate publication-quality pocket visualizations.
# Summary overview (multi-panel)
python scripts/visualize.py \
--input protein.pdb \
--pockets druggability.json \
--output pocket_summary.png \
--plot-type summary
# Druggability radar for top 3 pockets
python scripts/visualize.py \
--input protein.pdb \
--pockets druggability.json \
--output radar.png \
--plot-type druggability-radar
# Compare methods side-by-side
python scripts/visualize.py \
--input protein.pdb \
--pockets pockets_grid.json pockets_fpocket.json pockets_p2rank.json \
--labels "Grid" "fpocket" "P2Rank" \
--output method_comparison.png \
--plot-type method-comparisonCompare pockets across different structures of the same protein.
python scripts/compare.py \
--structures apo.pdb holo.pdb \
--labels "Apo" "Holo" \
--output pocket_comparison.json \
--align# 1. Detect pockets
python scripts/detect.py \
--input prepared.pdb \
--output pockets.json
# 2. Score druggability
python scripts/druggability.py \
--input prepared.pdb \
--pockets pockets.json \
--output druggability.json
# 3. Feed into docking (reads center from pockets JSON)
python ../molecular-docking/scripts/dock.py \
--protein prepared.pdb \
--ligand ligand.sdf \
--output-dir docking_results/ \
--center_x $(python -c "import json; d=json.load(open('pockets.json')); print(d['pockets'][0]['center'][0])") \
--center_y $(python -c "import json; d=json.load(open('pockets.json')); print(d['pockets'][0]['center'][1])") \
--center_z $(python -c "import json; d=json.load(open('pockets.json')); print(d['pockets'][0]['center'][2])")| Script | Purpose | Key Inputs | Key Outputs |
|---|---|---|---|
scripts/detect.py | Multi-method pocket detection | PDB file | Pockets JSON |
scripts/druggability.py | Pocket druggability scoring | PDB + Pockets JSON | Druggability JSON |
scripts/visualize.py | Pocket visualization | PDB + Pockets JSON | PNG/SVG image |
scripts/compare.py | Cross-structure comparison | 2+ PDB files | Comparison JSON |
{
"protein": "protein.pdb",
"method": "grid",
"chain": "A",
"n_pockets": 3,
"pockets": [
{
"rank": 1,
"source": "grid",
"center": [10.5, 22.3, 15.0],
"volume_A3": 542.8,
"residues": ["ASP189", "SER195", "HIS57"],
"n_residues": 15,
"bbox_min": [5.2, 17.1, 10.8],
"bbox_max": [16.1, 27.9, 19.3]
}
]
}Critical: The "center" field is a 3-element float list [x, y, z] compatible with dock.py auto-discovery.
Augments the pockets JSON with per-pocket druggability data:
{
"pockets": [
{
"rank": 1,
"center": [10.5, 22.3, 15.0],
"druggability_score": 0.72,
"druggability_class": "druggable",
"properties": {
"volume_A3": 542.8,
"hydrophobicity": 0.45,
"enclosure": 0.62,
"depth_A": 7.3,
"hb_capacity": 5,
"aromaticity": 3
}
}
]
}| Class | Score | Meaning |
|---|---|---|
| Druggable | > 0.7 | Pocket is well-suited for small molecule inhibitors |
| Difficult | 0.4 - 0.7 | May require fragment-based or specialized approaches |
| Undruggable | < 0.4 | Unlikely to bind drug-like molecules; consider PPI inhibitors or peptides |
Important: Druggability classification is based on literature-derived heuristic thresholds (Halgren 2009, Volkamer 2012), not a validated predictive model. Treat as guidance for prioritization, not a definitive assessment.
| Method | Strengths | Limitations |
|---|---|---|
| Grid | No external deps, good for standard cavities | Slow on large proteins, may find non-functional cavities |
| fpocket | Fast, well-validated, handles flexible pockets | Requires external binary |
| P2Rank | ML-based, highest accuracy on benchmarks | Requires Java + external binary |
When methods agree on a pocket location (centers within 5 A), confidence is high. Disagreements suggest the pocket is borderline or method-dependent.
--method auto (uses P2Rank or fpocket if available — both handle this better)--method fpocket (alpha sphere method naturally separates sub-pockets)--min-volume 300 to filter noise and re-run--chain A to analyze only the biologically relevant chain--min-volume 100, or provide manual coordinates for docking.druggability.py — it uses continuous Gaussian scoring that produces differentiated scores even for similar pockets. If scores are still very close (>0.9 for all), the protein genuinely has multiple high-quality binding sites.--method grid as fallback.P2RANK_HOME environment variable or use --method grid.--grid-spacing to 1.5.--chain.IMPORTANT for agents: When a skill script produces unexpected output (e.g., a single giant pocket, no pockets, or identical scores), adjust the script's parameters or try a different --method. Do NOT abandon the skill scripts and rewrite the logic in custom code. The skill scripts handle edge cases, validate I/O contracts, and log to the manifest — custom rewrites skip all of this.
3a6c3a9
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.