Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public

__pycache__
.vscode
build

# Coverage
.coverage
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<h1 align="center">POVME</h1>

<h4 align="center">Detect and characterize pockets from molecular simulations.</h4>
<h4 align="center">Detect and characterize protein pockets.</h4>

<p align="center">
<a href="https://github.com/durrantlab/POVME/actions/workflows/tests.yml">
Expand All @@ -17,8 +17,8 @@
</a>
</p>

POVME (POcket Volume MEasurer) is an open-source tool designed for detailed analysis of ligand-binding pocket shapes and volumes in proteins.
Initially developed to support structure-guided drug discovery, POVME has been widely adopted for its simplicity, speed, and flexibility.
POVME (**PO**cket **V**olume **ME**asurer) is an open-source tool designed for detailed analysis of ligand-binding pocket shapes and volumes in proteins.
Initially developed to support structure-based drug discovery, POVME has been widely adopted for its simplicity, speed, and flexibility.

## Why binding pocket analysis?

Expand All @@ -42,7 +42,7 @@ pixi install
Now you can activate the new virtual environment using

```sh
pixi shell
pixi shell -e dev
```

## Installation
Expand Down Expand Up @@ -95,8 +95,8 @@ This will install the specified version of `povme` and its dependencies into you

If you use POVME in your work, please cite:

1. Durrant, J.D., L. Votapka, J. Sørensen, and R. E. Amaro (2014). "POVME 2.0: An Enhanced Tool for Determining Pocket Shape and Volume Characteristics." J. Chem. Theory Comput. 10(11):5047-5056.
2. Durrant, J. D., C. A. de Oliveira, et al. (2011). "POVME: An algorithm for measuring binding-pocket volumes." J Mol Graph Model 29(5): 773-776.
1. Durrant, J. D., Votapka, L., Sørensen, J., & Amaro, R. E. (2014). POVME 2.0: An Enhanced Tool for Determining Pocket Shape and Volume Characteristics. *J. Chem. Theory Comput. 10*(11), 5047-5056.
2. Durrant, J. D., de Oliveira, C. A. F., & McCammon, J. A. (2011). POVME: An algorithm for measuring binding-pocket volumes. *J. Mol. Graph. Model. 29*(5), 773-776.

## License

Expand Down
1,887 changes: 263 additions & 1,624 deletions pixi.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ readme = "README.md"

[pypi-dependencies]
povme = { path = ".", editable = true }
pymolecule = { git = "https://github.com/durrantlab/pymolecule.git", rev = "121c34103169d362f4ed2ca9207dd5555f9dc25b" }
pymolecule = { git = "https://github.com/durrantlab/pymolecule.git", rev = "423cf64f17c21881a1685402437bd69a81e79ccf" }
ray = { version = ">=2.37.0,<3"}

[system-requirements]
Expand Down
28 changes: 24 additions & 4 deletions povme/pocket/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import numpy as np
from loguru import logger
from pymolecule import Molecule
from scipy.cluster.vq import kmeans2
from scipy.cluster.vq import ClusterError, kmeans2
from scipy.spatial.distance import cdist

from povme.config import PocketDetectConfig
Expand All @@ -29,7 +29,6 @@ def __init__(
self.config = PocketDetectConfig()

def run(self, path_pdb: str, output_prefix: str = "") -> None:

config = self.config

# If the output prefix includes a directory, create that directory if
Expand Down Expand Up @@ -185,11 +184,32 @@ def run(self, path_pdb: str, output_prefix: str = "") -> None:

# do I need to whiten stuff here? not sure what whitening is.

centroids, idx = kmeans2(pts, config.n_spheres)
n_points = pts.shape[0]
logger.debug("Pocket has {} points", n_points)
n_clusters = min(config.n_spheres, n_points)
try:
_, idx = kmeans2(pts, n_clusters, missing="raise")
except ClusterError:
logger.warning("One of the kmeans clusters are empty")
logger.warning("Retrying kmeans with different initialization")
try:
_, idx = kmeans2(pts, n_clusters, minit="++", missing="raise")
except ClusterError:
logger.warning("kmeans still has empty clusters")
logger.warning("We are using all points instead")
idx = np.arange(0, n_points)
except Exception as e:
raise e
except Exception as e:
raise e
finally:
cluster_labels = np.unique(idx)
logger.debug(f"Found clusters of {cluster_labels}")

pts_string = ""
for cluster_num in range(config.n_spheres):
for cluster_num in cluster_labels:
indexes_for_this_cluster = np.nonzero(idx == cluster_num)[0]
logger.debug(f"Point indices for cluster: {indexes_for_this_cluster}")
cluster_pts = pts[indexes_for_this_cluster]
cluster_center = np.mean(cluster_pts, axis=0)
try:
Expand Down
19 changes: 14 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
[project]
name = "povme"
version = "2.2.1"
description = "Detect and characterize protein pockets."
authors = [
{name = "Durrant Lab", email = "durrantj@pitt.edu"}
]
maintainers = [
{name = "Jacob Durrant", email = "durrantj@pitt.edu"}
{name = "Jacob Durrant", email = "durrantj@pitt.edu"},
{name = "Alex Maldonado", email = "alex.maldonado@pitt.edu"},
]
description = "TODO"
name = "povme"
version = "2.2.1"
license = "Apache-2.0"
readme = "README.md"
requires-python = ">=3.10,<3.13"
# TODO: Keep this here until pixi releases building capabilities
Expand All @@ -18,13 +20,20 @@ dependencies = [
"pyyaml>=6.0.2,<7",
"loguru>=0.7.2,<0.8",
"ray>=2.38.0,<3",
"pymolecule@git+https://github.com/durrantlab/pymolecule",
]

[project.urls]
Repository = "https://github.com/durrantlab/POVME"
Documentation = "https://durrantlab.github.io/POVME/"
Homepage = "https://durrantlab.github.io/POVME/"

[project.scripts]
povme = "povme.cli:povme_cli"

[build-system]
requires = ["setuptools"]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"

[tool.setuptools.packages.find]
where = ["."]
Expand Down
10 changes: 10 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,16 @@ def path_rel1_output():
return os.path.join(TEST_DIR, "tmp/", "rel1/")


@pytest.fixture
def path_5csn_config():
return os.path.join(TEST_DIR, "files/5csn/pocket-id.yml")


@pytest.fixture
def path_5csn_output():
return os.path.join(TEST_DIR, "tmp/", "5csn/")


@pytest.fixture
def path_rogfp2_pdb():
return os.path.join(TEST_DIR, "files/rogfp2/rogfp2.pdb")
Expand Down
Loading
Loading