posebench-fast 0.1.1__py3-none-any.whl → 0.1.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -29,7 +29,7 @@ from posebench_fast.metrics.rmsd import (
29
29
  time_limit,
30
30
  )
31
31
 
32
- __version__ = "0.1.1"
32
+ __version__ = "0.1.3"
33
33
 
34
34
  __all__ = [
35
35
  # RMSD
@@ -1,4 +1,4 @@
1
- # Taken from https://github.com/RMeli/spyrmsd and https://github.com/gcorso/DiffDock/
1
+ # Based on https://github.com/RMeli/spyrmsd
2
2
 
3
3
  import signal
4
4
  from contextlib import contextmanager
@@ -0,0 +1,71 @@
1
+ Metadata-Version: 2.4
2
+ Name: posebench-fast
3
+ Version: 0.1.3
4
+ Summary: Fast docking evaluation metrics: symmetry-corrected RMSD and PoseBusters filters
5
+ Keywords: docking,rmsd,posebusters,molecular-docking,benchmark
6
+ Author: Nikolenko
7
+ License-Expression: MIT
8
+ Requires-Dist: numpy>=1.21
9
+ Requires-Dist: pandas>=1.3
10
+ Requires-Dist: spyrmsd>=0.6
11
+ Requires-Dist: rdkit>=2022.3
12
+ Requires-Dist: torch>=1.10
13
+ Requires-Dist: posebusters>=0.2
14
+ Requires-Dist: tqdm>=4.60
15
+ Requires-Dist: pytest>=7.0 ; extra == 'dev'
16
+ Requires-Dist: pytest-cov>=4.0 ; extra == 'dev'
17
+ Requires-Dist: ruff>=0.4 ; extra == 'dev'
18
+ Requires-Python: >=3.11
19
+ Provides-Extra: dev
20
+ Description-Content-Type: text/markdown
21
+
22
+ # posebench-fast
23
+
24
+ [![PyPI version](https://badge.fury.io/py/posebench-fast.svg)](https://pypi.org/project/posebench-fast/)
25
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
26
+
27
+ Fast docking evaluation metrics: symmetry-corrected RMSD and lightweight PoseBusters filters.
28
+
29
+ ## Installation
30
+
31
+ ```bash
32
+ pip install posebench-fast
33
+ ```
34
+
35
+ ## Features
36
+
37
+ - **Symmetry-corrected RMSD** — accounts for molecular symmetry (benzene, carboxylates, etc.)
38
+ - **Fast PoseBusters filters** — 4 key checks in ~10ms instead of full 27-test suite (~1-2s)
39
+
40
+ ## Usage
41
+
42
+ ```python
43
+ from posebench_fast import compute_all_isomorphisms, get_symmetry_rmsd_with_isomorphisms
44
+
45
+ # Symmetry-corrected RMSD
46
+ isomorphisms = compute_all_isomorphisms(rdkit_mol)
47
+ rmsd = get_symmetry_rmsd_with_isomorphisms(true_coords, pred_coords, isomorphisms)
48
+ ```
49
+
50
+ ```python
51
+ from posebench_fast import check_intermolecular_distance
52
+
53
+ # Fast filters: not_too_far_away, no_clashes, no_volume_clash, no_internal_clash
54
+ results = check_intermolecular_distance(
55
+ mol_orig=rdkit_mol,
56
+ pos_pred=pred_positions, # (n_samples, n_atoms, 3)
57
+ pos_cond=protein_positions, # (n_protein_atoms, 3)
58
+ atom_names_pred=lig_atoms,
59
+ atom_names_cond=prot_atoms,
60
+ )
61
+ ```
62
+
63
+ ## Related
64
+
65
+ - [PoseBench](https://github.com/BioinfoMachineLearning/PoseBench) — full benchmark suite
66
+ - [PoseBusters](https://github.com/maabuu/posebusters) — full 27-test validation
67
+ - [spyrmsd](https://github.com/RMeli/spyrmsd) — symmetry RMSD algorithms
68
+
69
+ ## License
70
+
71
+ MIT
@@ -1,11 +1,11 @@
1
- posebench_fast/__init__.py,sha256=_ExeWnJgtI_-Op6Xf07Jgr1gi6WaissAOnrCoCgFs6w,1264
1
+ posebench_fast/__init__.py,sha256=CFNN5MzTlkjRbio39aU4bSj6lpYHPs3gd-Baz9woXms,1264
2
2
  posebench_fast/datasets/__init__.py,sha256=-29X5OLrM8eE-bXnB-S_RC4ROjZq0d0lluVAOKtHkRM,44
3
3
  posebench_fast/filters/__init__.py,sha256=Qm9CK25oMyWwV0gopk7qcU0YQw8cnx9qJFJFQjybSF8,337
4
4
  posebench_fast/filters/fast_filters.py,sha256=qfMNIAyCDXtVh5oDDl-iC-1WKxJmzN55LVJTwbolHE4,17428
5
5
  posebench_fast/metrics/__init__.py,sha256=g49mQpR1uSy6v3gFtarTTVcDKeQXlB3ZONCntFLlRs4,765
6
6
  posebench_fast/metrics/aggregation.py,sha256=QZNRlp40kpdcxjC5H9WyR6KWFzboOHcmcCke8AEdD-w,13046
7
- posebench_fast/metrics/rmsd.py,sha256=BmHPzUCBQCEAvG8slbs7mXASZV8_ROn7ljplLcH0OFw,7410
7
+ posebench_fast/metrics/rmsd.py,sha256=LwQeSCHtIvXQswnUqAhXWw5-5_43M61k5aQgUhnFoOo,7368
8
8
  posebench_fast/utils/__init__.py,sha256=TMMehJTihRawWfPW_qBEQIVzpf-Z92QujVAcgNydylI,44
9
- posebench_fast-0.1.1.dist-info/WHEEL,sha256=5DEXXimM34_d4Gx1AuF9ysMr1_maoEtGKjaILM3s4w4,80
10
- posebench_fast-0.1.1.dist-info/METADATA,sha256=_Lmmfdd_F9wUsgLV7jzTDGVnOO2AhcdeNxfvFuaYf2M,7374
11
- posebench_fast-0.1.1.dist-info/RECORD,,
9
+ posebench_fast-0.1.3.dist-info/WHEEL,sha256=5DEXXimM34_d4Gx1AuF9ysMr1_maoEtGKjaILM3s4w4,80
10
+ posebench_fast-0.1.3.dist-info/METADATA,sha256=OLzzq9oHe504c4X83xE7JaIQGbkHiy5yzmHVVBP_KSU,2212
11
+ posebench_fast-0.1.3.dist-info/RECORD,,
@@ -1,201 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: posebench-fast
3
- Version: 0.1.1
4
- Summary: Fast docking evaluation metrics: symmetry-corrected RMSD and PoseBusters filters
5
- Keywords: docking,rmsd,posebusters,molecular-docking,benchmark
6
- Author: Nikolenko
7
- License-Expression: MIT
8
- Requires-Dist: numpy>=1.21
9
- Requires-Dist: pandas>=1.3
10
- Requires-Dist: spyrmsd>=0.6
11
- Requires-Dist: rdkit>=2022.3
12
- Requires-Dist: torch>=1.10
13
- Requires-Dist: posebusters>=0.2
14
- Requires-Dist: tqdm>=4.60
15
- Requires-Dist: pytest>=7.0 ; extra == 'dev'
16
- Requires-Dist: pytest-cov>=4.0 ; extra == 'dev'
17
- Requires-Dist: ruff>=0.4 ; extra == 'dev'
18
- Requires-Python: >=3.11
19
- Provides-Extra: dev
20
- Description-Content-Type: text/markdown
21
-
22
- # posebench-fast
23
-
24
- Fast and accurate docking evaluation metrics for molecular docking benchmarks.
25
-
26
- [![PyPI version](https://badge.fury.io/py/posebench-fast.svg)](https://pypi.org/project/posebench-fast/)
27
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
28
-
29
- ## Why posebench-fast?
30
-
31
- This is a **lightweight alternative** to the original [PoseBench](https://github.com/BioinfoMachineLearning/PoseBench) benchmark suite, focused on speed and practical metrics.
32
-
33
- ### posebench-fast vs PoseBench
34
-
35
- | Feature | PoseBench (original) | posebench-fast |
36
- |---------|---------------------|----------------|
37
- | **Purpose** | Full benchmark suite with datasets | Evaluation metrics only |
38
- | **Dependencies** | Heavy (DGL, ESM, etc.) | Minimal (rdkit, torch) |
39
- | **Installation** | Complex setup | `pip install posebench-fast` |
40
- | **Speed** | Full pipeline | 100x faster filters |
41
- | **Use case** | Reproduce paper results | Integrate into your pipeline |
42
-
43
- **When to use PoseBench:** Reproducing benchmark results, running full evaluation suite
44
-
45
- **When to use posebench-fast:** Quick pose filtering, custom pipelines, production inference
46
-
47
- ---
48
-
49
- Standard RMSD calculations can **severely penalize correct predictions** for symmetric molecules. Consider a benzene ring or a carboxylate group - rotating them by 180° gives chemically identical structures, but naive RMSD treats them as completely different poses.
50
-
51
- ### The Symmetry Problem
52
-
53
- ```
54
- O O
55
- ‖ ‖
56
- R—C—O⁻ vs ⁻O—C—R
57
-
58
- Same molecule, different atom ordering → High RMSD with naive calculation!
59
- ```
60
-
61
- **posebench-fast** solves this by:
62
- 1. Computing all valid graph isomorphisms of the molecule
63
- 2. Finding the atom permutation that minimizes RMSD
64
- 3. Returning the **true** structural difference
65
-
66
- ### Fast vs Full PoseBusters
67
-
68
- Full [PoseBusters](https://github.com/maabuu/posebusters) validation runs 27 tests including expensive energy calculations. For rapid screening of thousands of docking poses, this is too slow.
69
-
70
- **posebench-fast** provides 4 key physics-based filters that catch most invalid poses in milliseconds:
71
-
72
- | Filter | What it catches |
73
- |--------|-----------------|
74
- | `not_too_far_away` | Ligand flew away from binding site (distance > 5Å) |
75
- | `no_clashes` | Atomic clashes with protein (overlapping VDW radii) |
76
- | `no_volume_clash` | Volume overlap > 5% with protein |
77
- | `no_internal_clash` | Invalid bond lengths/angles within ligand |
78
-
79
- **Speed comparison:**
80
- - Full PoseBusters: ~1-2 sec/pose
81
- - posebench-fast: ~5-10 ms/pose (100x faster)
82
-
83
- ## Installation
84
-
85
- ```bash
86
- pip install posebench-fast
87
- ```
88
-
89
- Or with uv:
90
- ```bash
91
- uv add posebench-fast
92
- ```
93
-
94
- ## Usage
95
-
96
- ### Symmetry-Corrected RMSD
97
-
98
- ```python
99
- from posebench_fast import compute_all_isomorphisms, get_symmetry_rmsd_with_isomorphisms
100
-
101
- # Compute isomorphisms once per molecule (cache this!)
102
- isomorphisms = compute_all_isomorphisms(rdkit_mol)
103
-
104
- # Compute symmetry-corrected RMSD for any number of predictions
105
- rmsd = get_symmetry_rmsd_with_isomorphisms(true_coords, pred_coords, isomorphisms)
106
-
107
- # Example: benzene with 12 equivalent atom orderings
108
- # Naive RMSD: 2.4 Å (WRONG - penalizes valid rotation)
109
- # SymmRMSD: 0.3 Å (CORRECT - finds best match)
110
- ```
111
-
112
- ### Fast PoseBusters Filters
113
-
114
- ```python
115
- from posebench_fast import check_intermolecular_distance
116
-
117
- results = check_intermolecular_distance(
118
- mol_orig=rdkit_mol,
119
- pos_pred=predicted_positions, # (n_samples, n_atoms, 3)
120
- pos_cond=protein_positions, # (n_protein_atoms, 3)
121
- atom_names_pred=ligand_atoms, # ['C', 'N', 'O', ...]
122
- atom_names_cond=protein_atoms, # ['C', 'CA', 'N', ...]
123
- )
124
-
125
- # Results dict contains:
126
- # - not_too_far_away: [True, True, False, ...] # ligand near protein?
127
- # - no_clashes: [True, False, True, ...] # no atomic overlaps?
128
- # - no_volume_clash: [True, True, True, ...] # no volume overlap?
129
- # - no_internal_clash: [True, True, False, ...] # valid geometry?
130
- # - is_buried_fraction: [0.8, 0.6, 0.2, ...] # how buried is ligand?
131
- ```
132
-
133
- ### Batch Metrics with Filtering
134
-
135
- ```python
136
- from posebench_fast import get_final_results_for_df, filter_results_by_fast
137
-
138
- # Filter predictions to keep only physically valid ones
139
- filtered = filter_results_by_fast(predictions)
140
-
141
- # Compute benchmark metrics
142
- metrics_df, scored = get_final_results_for_df(
143
- predictions,
144
- score_names=['error_estimate_0'], # ranking score
145
- posebusters_filter=True,
146
- fast_filter=True
147
- )
148
-
149
- # metrics_df contains:
150
- # | ranking | RMSD<2Å | RMSD<5Å | SymRMSD<2Å | avg RMSD | ...
151
- # |------------------|---------|---------|------------|----------|
152
- # | error_estimate_0 | 0.45 | 0.78 | 0.52 | 3.2 |
153
- # | ..._fast | 0.48 | 0.82 | 0.58 | 2.9 | <- after filtering
154
- ```
155
-
156
- ## API Reference
157
-
158
- ### RMSD Functions
159
-
160
- | Function | Description |
161
- |----------|-------------|
162
- | `compute_all_isomorphisms(mol)` | Get all graph isomorphisms for symmetry correction |
163
- | `get_symmetry_rmsd_with_isomorphisms(coords1, coords2, iso)` | Fast symmetry-corrected RMSD |
164
- | `get_symmetry_rmsd(mol, coords1, coords2)` | Convenience wrapper (computes isomorphisms internally) |
165
-
166
- ### Filter Functions
167
-
168
- | Function | Description |
169
- |----------|-------------|
170
- | `check_intermolecular_distance(...)` | All 4 fast filters + buried fraction |
171
- | `check_volume_overlap(...)` | Volume overlap only |
172
- | `check_geometry(...)` | Internal geometry validation only |
173
-
174
- ### Aggregation Functions
175
-
176
- | Function | Description |
177
- |----------|-------------|
178
- | `get_final_results_for_df(...)` | Compute full metrics table |
179
- | `filter_results_by_fast(...)` | Keep best poses by fast filter count |
180
- | `filter_results_by_posebusters(...)` | Keep best poses by full PB count |
181
- | `get_best_results_by_score(...)` | Select best pose per molecule by score |
182
-
183
- ## When to Use What
184
-
185
- | Scenario | Recommendation |
186
- |----------|----------------|
187
- | Quick screening of 1000s of poses | `check_intermolecular_distance` |
188
- | Final benchmark reporting | Full PoseBusters + `get_final_results_for_df` |
189
- | Symmetric molecules (rings, COO⁻, etc.) | Always use `get_symmetry_rmsd_*` |
190
- | Speed-critical pipelines | `filter_results_by_fast` |
191
-
192
- ## Related Projects
193
-
194
- - **[PoseBench](https://github.com/BioinfoMachineLearning/PoseBench)** - Original comprehensive benchmark suite for molecular docking. Use if you need full datasets and reproducible benchmark runs.
195
- - [spyrmsd](https://github.com/RMeli/spyrmsd) - Symmetry-corrected RMSD algorithms
196
- - [PoseBusters](https://github.com/maabuu/posebusters) - Full physical validity validation (27 tests)
197
- - [DiffDock](https://github.com/gcorso/DiffDock) - Fast filter implementations origin
198
-
199
- ## License
200
-
201
- MIT