posebench-fast 0.1.0__tar.gz

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.
@@ -0,0 +1,109 @@
1
+ Metadata-Version: 2.4
2
+ Name: posebench-fast
3
+ Version: 0.1.0
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 docking evaluation metrics for molecular docking benchmarks.
25
+
26
+ ## Features
27
+
28
+ - **Symmetry-corrected RMSD**: Compute RMSD accounting for molecular symmetry using graph isomorphisms
29
+ - **Fast PoseBusters filters**: Quick physical validity checks without full energy evaluation
30
+ - Distance checks (not too far, no clashes)
31
+ - Volume overlap detection
32
+ - Internal geometry validation
33
+ - **Metrics aggregation**: Success rates, averages, filtering by scores
34
+
35
+ ## Installation
36
+
37
+ ```bash
38
+ uv add posebench-fast
39
+ ```
40
+
41
+ Or with pip:
42
+ ```bash
43
+ pip install posebench-fast
44
+ ```
45
+
46
+ ## Usage
47
+
48
+ ### Symmetry RMSD
49
+
50
+ ```python
51
+ from posebench_fast import compute_all_isomorphisms, get_symmetry_rmsd_with_isomorphisms
52
+ import numpy as np
53
+
54
+ # Compute isomorphisms once per molecule
55
+ isomorphisms = compute_all_isomorphisms(rdkit_mol)
56
+
57
+ # Compute symmetry-corrected RMSD
58
+ rmsd = get_symmetry_rmsd_with_isomorphisms(true_coords, pred_coords, isomorphisms)
59
+ ```
60
+
61
+ ### Fast PoseBusters Filters
62
+
63
+ ```python
64
+ from posebench_fast import calc_posebusters
65
+
66
+ results = calc_posebusters(
67
+ pos_pred=ligand_positions, # (n_samples, n_atoms, 3)
68
+ pos_cond=protein_positions, # (n_atoms, 3)
69
+ atom_ids_pred=ligand_atom_ids,
70
+ atom_names_cond=protein_atom_names,
71
+ names="sample_id",
72
+ lig_mol_for_posebusters=rdkit_mol
73
+ )
74
+
75
+ # Results contain:
76
+ # - not_too_far_away: bool list
77
+ # - no_clashes: bool list
78
+ # - no_volume_clash: bool list
79
+ # - no_internal_clash: bool list
80
+ # - is_buried_fraction: float list
81
+ ```
82
+
83
+ ### Metrics Aggregation
84
+
85
+ ```python
86
+ from posebench_fast import get_final_results_for_df
87
+
88
+ rows, scored_results = get_final_results_for_df(
89
+ full_results,
90
+ score_names=['error_estimate_0'],
91
+ posebusters_filter=True,
92
+ fast_filter=True
93
+ )
94
+ # Returns DataFrame with: RMSD < 2A, RMSD < 5A, SymRMSD < 2A, etc.
95
+ ```
96
+
97
+ ## Dependencies
98
+
99
+ - numpy
100
+ - pandas
101
+ - spyrmsd
102
+ - rdkit
103
+ - torch
104
+ - posebusters
105
+ - tqdm
106
+
107
+ ## License
108
+
109
+ MIT
@@ -0,0 +1,88 @@
1
+ # posebench-fast
2
+
3
+ Fast docking evaluation metrics for molecular docking benchmarks.
4
+
5
+ ## Features
6
+
7
+ - **Symmetry-corrected RMSD**: Compute RMSD accounting for molecular symmetry using graph isomorphisms
8
+ - **Fast PoseBusters filters**: Quick physical validity checks without full energy evaluation
9
+ - Distance checks (not too far, no clashes)
10
+ - Volume overlap detection
11
+ - Internal geometry validation
12
+ - **Metrics aggregation**: Success rates, averages, filtering by scores
13
+
14
+ ## Installation
15
+
16
+ ```bash
17
+ uv add posebench-fast
18
+ ```
19
+
20
+ Or with pip:
21
+ ```bash
22
+ pip install posebench-fast
23
+ ```
24
+
25
+ ## Usage
26
+
27
+ ### Symmetry RMSD
28
+
29
+ ```python
30
+ from posebench_fast import compute_all_isomorphisms, get_symmetry_rmsd_with_isomorphisms
31
+ import numpy as np
32
+
33
+ # Compute isomorphisms once per molecule
34
+ isomorphisms = compute_all_isomorphisms(rdkit_mol)
35
+
36
+ # Compute symmetry-corrected RMSD
37
+ rmsd = get_symmetry_rmsd_with_isomorphisms(true_coords, pred_coords, isomorphisms)
38
+ ```
39
+
40
+ ### Fast PoseBusters Filters
41
+
42
+ ```python
43
+ from posebench_fast import calc_posebusters
44
+
45
+ results = calc_posebusters(
46
+ pos_pred=ligand_positions, # (n_samples, n_atoms, 3)
47
+ pos_cond=protein_positions, # (n_atoms, 3)
48
+ atom_ids_pred=ligand_atom_ids,
49
+ atom_names_cond=protein_atom_names,
50
+ names="sample_id",
51
+ lig_mol_for_posebusters=rdkit_mol
52
+ )
53
+
54
+ # Results contain:
55
+ # - not_too_far_away: bool list
56
+ # - no_clashes: bool list
57
+ # - no_volume_clash: bool list
58
+ # - no_internal_clash: bool list
59
+ # - is_buried_fraction: float list
60
+ ```
61
+
62
+ ### Metrics Aggregation
63
+
64
+ ```python
65
+ from posebench_fast import get_final_results_for_df
66
+
67
+ rows, scored_results = get_final_results_for_df(
68
+ full_results,
69
+ score_names=['error_estimate_0'],
70
+ posebusters_filter=True,
71
+ fast_filter=True
72
+ )
73
+ # Returns DataFrame with: RMSD < 2A, RMSD < 5A, SymRMSD < 2A, etc.
74
+ ```
75
+
76
+ ## Dependencies
77
+
78
+ - numpy
79
+ - pandas
80
+ - spyrmsd
81
+ - rdkit
82
+ - torch
83
+ - posebusters
84
+ - tqdm
85
+
86
+ ## License
87
+
88
+ MIT
@@ -0,0 +1,94 @@
1
+ [project]
2
+ name = "posebench-fast"
3
+ version = "0.1.0"
4
+ description = "Fast docking evaluation metrics: symmetry-corrected RMSD and PoseBusters filters"
5
+ readme = "README.md"
6
+ requires-python = ">=3.11"
7
+ license = "MIT"
8
+ authors = [
9
+ { name = "Nikolenko" }
10
+ ]
11
+ keywords = ["docking", "rmsd", "posebusters", "molecular-docking", "benchmark"]
12
+
13
+ dependencies = [
14
+ "numpy>=1.21",
15
+ "pandas>=1.3",
16
+ "spyrmsd>=0.6",
17
+ "rdkit>=2022.03",
18
+ "torch>=1.10",
19
+ "posebusters>=0.2",
20
+ "tqdm>=4.60",
21
+ ]
22
+
23
+ [project.optional-dependencies]
24
+ dev = [
25
+ "pytest>=7.0",
26
+ "pytest-cov>=4.0",
27
+ "ruff>=0.4",
28
+ ]
29
+
30
+ [build-system]
31
+ requires = ["uv_build"]
32
+ build-backend = "uv_build"
33
+
34
+ [tool.uv.build-backend]
35
+ module-name = "posebench_fast"
36
+
37
+ [tool.uv]
38
+ dev-dependencies = [
39
+ "pytest>=7.0",
40
+ "pytest-cov>=4.0",
41
+ "ruff>=0.4",
42
+ ]
43
+
44
+ [tool.ruff]
45
+ src = ["src/"]
46
+ target-version = "py311"
47
+
48
+ [tool.ruff.lint]
49
+ select = [
50
+ "E", # pycodestyle errors
51
+ "F", # Pyflakes (undefined names, unused imports, etc.)
52
+ "W", # pycodestyle warnings
53
+ "I", # isort (import sorting)
54
+ "N", # pep8-naming
55
+ "UP", # pyupgrade (modernize Python code)
56
+ "B", # flake8-bugbear (common bugs)
57
+ "C4", # flake8-comprehensions
58
+ "PIE", # flake8-pie (misc lints)
59
+ "RET", # flake8-return (return statement improvements)
60
+ "SIM", # flake8-simplify
61
+ "NPY", # NumPy-specific rules
62
+ ]
63
+
64
+ ignore = [
65
+ "E501", # Line too long (handled by formatter)
66
+ "E741", # Ambiguous variable name (allow 'l', 'O', etc. for math)
67
+ "N803", # Argument name should be lowercase (allow CamelCase for classes)
68
+ "N806", # Variable should be lowercase (allow uppercase in math/ML code)
69
+ "B008", # Do not perform function call in argument defaults (common in ML)
70
+ "RET504", # Unnecessary variable assignment before return
71
+ "SIM108", # Use ternary operator (can reduce readability)
72
+ "SIM102", # Avoid assigning lambda expressions (OK for ML configs)
73
+ "N812", # Lowercase imported as non-lowercase (allow for 'import torch.nn.functional as F')
74
+ "N802", # Function name should be lowercase (allow for class-factory style)
75
+ "E731", # Do not assign a lambda expression (allow in configs/utilities)
76
+ "C408", # Unnecessary 'dict' call (allow for explicitness)
77
+ "SIM113", # Use 'any'/'all' for simple comparisons (allow explicit loops)
78
+ ]
79
+
80
+ fixable = ["ALL"]
81
+ unfixable = []
82
+
83
+ [tool.ruff.lint.per-file-ignores]
84
+ "__init__.py" = ["F401"]
85
+ "tests/**/*.py" = ["S101"]
86
+
87
+ [tool.ruff.format]
88
+ quote-style = "double"
89
+ indent-style = "space"
90
+ skip-magic-trailing-comma = false
91
+ line-ending = "auto"
92
+
93
+ [tool.ruff.lint.pydocstyle]
94
+ convention = "numpy"
@@ -0,0 +1,53 @@
1
+ """
2
+ posebench-fast: Fast docking evaluation metrics
3
+
4
+ Provides:
5
+ - Symmetry-corrected RMSD computation
6
+ - Fast PoseBusters filters (without full energy evaluation)
7
+ - Docking metrics (success rates, averages)
8
+ """
9
+
10
+ from posebench_fast.filters.fast_filters import (
11
+ calc_posebusters,
12
+ check_geometry,
13
+ check_intermolecular_distance,
14
+ check_volume_overlap,
15
+ )
16
+ from posebench_fast.metrics.aggregation import (
17
+ filter_results_by_fast,
18
+ filter_results_by_posebusters,
19
+ get_best_results_by_score,
20
+ get_final_results_for_df,
21
+ get_simple_metrics_df,
22
+ )
23
+ from posebench_fast.metrics.rmsd import (
24
+ TimeoutException,
25
+ compute_all_isomorphisms,
26
+ get_symmetry_rmsd,
27
+ get_symmetry_rmsd_with_isomorphisms,
28
+ symmrmsd,
29
+ time_limit,
30
+ )
31
+
32
+ __version__ = "0.1.0"
33
+
34
+ __all__ = [
35
+ # RMSD
36
+ "compute_all_isomorphisms",
37
+ "get_symmetry_rmsd_with_isomorphisms",
38
+ "get_symmetry_rmsd",
39
+ "symmrmsd",
40
+ "TimeoutException",
41
+ "time_limit",
42
+ # Filters
43
+ "calc_posebusters",
44
+ "check_intermolecular_distance",
45
+ "check_volume_overlap",
46
+ "check_geometry",
47
+ # Metrics
48
+ "get_simple_metrics_df",
49
+ "get_final_results_for_df",
50
+ "filter_results_by_posebusters",
51
+ "filter_results_by_fast",
52
+ "get_best_results_by_score",
53
+ ]
@@ -0,0 +1 @@
1
+ """Dataset utilities for posebench-fast."""
@@ -0,0 +1,15 @@
1
+ """Fast PoseBusters filters for docking evaluation."""
2
+
3
+ from posebench_fast.filters.fast_filters import (
4
+ calc_posebusters,
5
+ check_geometry,
6
+ check_intermolecular_distance,
7
+ check_volume_overlap,
8
+ )
9
+
10
+ __all__ = [
11
+ "calc_posebusters",
12
+ "check_intermolecular_distance",
13
+ "check_volume_overlap",
14
+ "check_geometry",
15
+ ]