posebench-fast 0.1.2__py3-none-any.whl → 0.1.4__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.
posebench_fast/__init__.py
CHANGED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: posebench-fast
|
|
3
|
+
Version: 0.1.4
|
|
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
|
+
[](https://pypi.org/project/posebench-fast/)
|
|
25
|
+
[](https://github.com/LigandPro/posebench-fast/actions/workflows/ci.yml)
|
|
26
|
+
[](https://opensource.org/licenses/MIT)
|
|
27
|
+
[](https://www.python.org/downloads/)
|
|
28
|
+
|
|
29
|
+
Fast docking evaluation metrics: symmetry-corrected RMSD and lightweight PoseBusters filters.
|
|
30
|
+
|
|
31
|
+
## Installation
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
uv pip install posebench-fast
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Features
|
|
38
|
+
|
|
39
|
+
- **Symmetry-corrected RMSD** — accounts for molecular symmetry (benzene, carboxylates, etc.)
|
|
40
|
+
- **Fast PoseBusters filters** — 4 key checks in ~10ms instead of full 27-test suite (~1-2s)
|
|
41
|
+
|
|
42
|
+
## Usage
|
|
43
|
+
|
|
44
|
+
```python
|
|
45
|
+
from posebench_fast import compute_all_isomorphisms, get_symmetry_rmsd_with_isomorphisms
|
|
46
|
+
|
|
47
|
+
# Symmetry-corrected RMSD
|
|
48
|
+
isomorphisms = compute_all_isomorphisms(rdkit_mol)
|
|
49
|
+
rmsd = get_symmetry_rmsd_with_isomorphisms(true_coords, pred_coords, isomorphisms)
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
```python
|
|
53
|
+
from posebench_fast import check_intermolecular_distance
|
|
54
|
+
|
|
55
|
+
# Fast filters: not_too_far_away, no_clashes, no_volume_clash, no_internal_clash
|
|
56
|
+
results = check_intermolecular_distance(
|
|
57
|
+
mol_orig=rdkit_mol,
|
|
58
|
+
pos_pred=pred_positions, # (n_samples, n_atoms, 3)
|
|
59
|
+
pos_cond=protein_positions, # (n_protein_atoms, 3)
|
|
60
|
+
atom_names_pred=lig_atoms,
|
|
61
|
+
atom_names_cond=prot_atoms,
|
|
62
|
+
)
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Related
|
|
66
|
+
|
|
67
|
+
- [PoseBench](https://github.com/BioinfoMachineLearning/PoseBench) — full benchmark suite
|
|
68
|
+
- [PoseBusters](https://github.com/maabuu/posebusters) — full 27-test validation
|
|
69
|
+
- [spyrmsd](https://github.com/RMeli/spyrmsd) — symmetry RMSD algorithms
|
|
70
|
+
|
|
71
|
+
## License
|
|
72
|
+
|
|
73
|
+
MIT
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
posebench_fast/__init__.py,sha256=
|
|
1
|
+
posebench_fast/__init__.py,sha256=Ds9mPRS4GhkB3OziVgDZV5QLMwjeGOvAbGNEsihnhvY,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
|
|
@@ -6,6 +6,6 @@ posebench_fast/metrics/__init__.py,sha256=g49mQpR1uSy6v3gFtarTTVcDKeQXlB3ZONCntF
|
|
|
6
6
|
posebench_fast/metrics/aggregation.py,sha256=QZNRlp40kpdcxjC5H9WyR6KWFzboOHcmcCke8AEdD-w,13046
|
|
7
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.
|
|
10
|
-
posebench_fast-0.1.
|
|
11
|
-
posebench_fast-0.1.
|
|
9
|
+
posebench_fast-0.1.4.dist-info/WHEEL,sha256=5DEXXimM34_d4Gx1AuF9ysMr1_maoEtGKjaILM3s4w4,80
|
|
10
|
+
posebench_fast-0.1.4.dist-info/METADATA,sha256=Ynh8zTLTjC5Zh7fYW2H7uXhBrRSiyxmoHprqhA1Vawc,2478
|
|
11
|
+
posebench_fast-0.1.4.dist-info/RECORD,,
|
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: posebench-fast
|
|
3
|
-
Version: 0.1.2
|
|
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
|
-
[](https://pypi.org/project/posebench-fast/)
|
|
27
|
-
[](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
|
-
|
|
198
|
-
## License
|
|
199
|
-
|
|
200
|
-
MIT
|
|
File without changes
|