Metadata-Version: 2.4
Name: dock
Version: 0.1.0
Summary: Package for Docking.
Author-email: Andrius Bernatavicius <a.bernatavicius@liacs.leidenuniv.nl>, Martin Sicho <m.sicho@lacdr.leidenuniv.nl>, Michiel Jespers <m.jespers@lacdr.leidenuniv.nl>
Maintainer-email: Andrius Bernatavicius <a.bernatavicius@liacs.leidenuniv.nl>, Martin Sicho <m.sicho@lacdr.leidenuniv.nl>, Michiel Jespers <m.jespers@lacdr.leidenuniv.nl>
License: MIT License
        
        Copyright (c) 2026 CDDLeiden
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: homepage, https://github.com/CDDLeiden/spock
Project-URL: repository, https://github.com/CDDLeiden/spock
Project-URL: documentation, https://cddleiden.github.io/spock/docs/
Keywords: docking,structure-based drug design,cheminformatics,sbdd
Classifier: Development Status :: 4 - Beta
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Classifier: Topic :: Scientific/Engineering :: Chemistry
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: scipy
Requires-Dist: rdkit
Requires-Dist: meeko
Requires-Dist: gemmi
Requires-Dist: dimorphite_dl
Requires-Dist: pandas
Requires-Dist: tqdm
Requires-Dist: papyrus_structure_pipeline
Requires-Dist: numpy
Requires-Dist: pebble
Requires-Dist: ipython
Requires-Dist: networkx
Requires-Dist: matplotlib
Requires-Dist: pyyaml
Requires-Dist: qsprpred
Provides-Extra: vina
Requires-Dist: vina; extra == "vina"
Provides-Extra: gnn
Requires-Dist: torch; extra == "gnn"
Requires-Dist: torch_geometric; extra == "gnn"
Requires-Dist: joblib; extra == "gnn"
Requires-Dist: wandb; extra == "gnn"
Requires-Dist: scikit-learn; extra == "gnn"
Requires-Dist: tensorboard; extra == "gnn"
Requires-Dist: pyarrow; extra == "gnn"
Provides-Extra: pymol
Requires-Dist: pyqtgraph; extra == "pymol"
Requires-Dist: pypdb; extra == "pymol"
Requires-Dist: docker; extra == "pymol"
Requires-Dist: openbabel-wheel; extra == "pymol"
Requires-Dist: meeko; extra == "pymol"
Requires-Dist: pillow; extra == "pymol"
Requires-Dist: plip; extra == "pymol"
Provides-Extra: dev
Requires-Dist: pre-commit; extra == "dev"
Requires-Dist: isort; extra == "dev"
Requires-Dist: yapf; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Requires-Dist: pytest; extra == "dev"
Dynamic: license-file

# spock — **S**tandardize, **P**repare, D**ock**

<img src="https://th.bing.com/th/id/OIG.tKEG33W0qiLIBwU0_Fxn" width="180" align="right">

`spock` is a Python toolkit for structure-based drug design. It bundles a unified
molecule/protein **storage** layer, ligand **standardization** and **preparation**
pipelines, several **docking** engines, interaction-fingerprint **descriptors**, a
graph/**GNN** stack, and an interactive **PyMOL GUI** — so a target can go from a
raw sequence to docked, scored and visualised poses in one place.

> **Status:** active development / beta.

---

## Features

| Area | What's included |
|------|-----------------|
| **Storage** | Unified `SpockStorage` for ligands, proteins and docked poses, built on the [QSPRpred](https://github.com/CDDLeiden/QSPRpred) storage interfaces. Per-target stores, compressed pose serialization. |
| **Docking engines** | **AutoDock Vina (CPU)** — multi-core parallel; **Vina (CPU, local)** — lightweight single-process; **Vina-GPU** — via the `andriusbern/vina-gpu` Docker image (NVIDIA runtime). Vina scoring function. |
| **Standardization** | Papyrus standardizer and a permissive `NaiveStandardizer`, with InChI-based identifiers. |
| **Ligand preparation** | **Dimorphite-DL** protonation/tautomer enumeration; **Schrödinger LigPrep** wrapper. |
| **Descriptors** | **PLIP** protein–ligand interaction fingerprints (`PLIPIFP`) as a QSPRpred `DescriptorSet`. |
| **Graphs / GNN** | Molecular & complex graph featurizers; PyTorch-Geometric dataset bridge and models (`[gnn]` extra). |
| **De novo generation** | Target-conditioned ligand generation via [PCMol](https://github.com/CDDLeiden/PCMol) from inside the GUI. |
| **Data sources** | One-click download of bioactivity data and targets from **Papyrus**; PDB structure fetching. |
| **GUI** | PyMOL-embedded interface for browsing targets, fetching structures, managing ligands, docking, and inspecting poses & interactions (see below). |
| **Parallelism** | `pebble`-based parallel docking, preparation and dataframe pipelines. |

---

## Installation

Requires **Python ≥ 3.10**. PyMOL (open-source or incentive build) and AutoDock
Vina are expected from the environment — the recommended route is `conda`/`micromamba`:

```bash
# 1. create an environment with the native deps that don't ship cleanly on PyPI
micromamba create -y -n spock -c conda-forge \
    python=3.11 pymol-open-source pyqt pyqtgraph rdkit openbabel plip

# 2. install spock (editable)
git clone https://github.com/CDDLeiden/spock.git
cd spock
micromamba run -n spock pip install -e .
```

Optional extras:

```bash
pip install -e ".[vina]"    # AutoDock Vina Python bindings (CPU docking)
pip install -e ".[gnn]"     # torch, torch_geometric, wandb, ...
pip install -e ".[pymol]"   # GUI helper stack (pypdb, meeko, docker, plip, ...)
pip install -e ".[dev]"     # linting / tests (pre-commit, ruff, pytest)
```

For **Vina-GPU**, an NVIDIA Docker runtime is required; see `setup_nvidia_docker.sh`.

---

## The GUI

Launch the GUI (it runs on PyMOL's own Qt thread) with the installed console script:

```bash
spock
```

or load it as a PyMOL plugin:

```bash
pymol spock/gui/addon.py
```

The interface is organised around a selected **target**:

| Panel | Capabilities |
|-------|--------------|
| **Targets** | Browse and fuzzy-search protein targets; download bioactivity data from Papyrus. |
| **Structures** | Fetch and load PDB structures for the active target. |
| **Ligands** | Add / delete / save / load ligands, download from Papyrus, hover cards with computed properties (incl. SA score). |
| **Docking** | Pick a binding-site box ("Get coordinates") and run docking; live progress. |
| **Poses** | Per-pose bar with scores, crosshair score plots, load stored poses into the viewer. |
| **Interactions** | PLIP protein–ligand contacts rendered directly in PyMOL with a contacts table. |
| **Generator** | Load a PCMol model and generate target-conditioned ligands. |

All results (structures, ligands, poses, scores) are persisted to the per-target
`SpockStorage`, so closing and reopening a target restores its state.

---

## Tutorials

The `tutorial/` folder contains notebooks covering storage creation, standardization,
ligand preparation and docking benchmarks.

## License & citation

See `pyproject.toml` for authors and project metadata. Part of the CDD Leiden
software stack alongside [QSPRpred](https://github.com/CDDLeiden/QSPRpred).
