stjames 0.0.59__tar.gz → 0.0.61__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.
Potentially problematic release.
This version of stjames might be problematic. Click here for more details.
- {stjames-0.0.59/stjames.egg-info → stjames-0.0.61}/PKG-INFO +1 -1
- {stjames-0.0.59 → stjames-0.0.61}/pyproject.toml +1 -1
- {stjames-0.0.59 → stjames-0.0.61}/stjames/workflows/docking.py +23 -8
- {stjames-0.0.59 → stjames-0.0.61/stjames.egg-info}/PKG-INFO +1 -1
- {stjames-0.0.59 → stjames-0.0.61}/LICENSE +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/README.md +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/setup.cfg +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/stjames/__init__.py +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/stjames/_deprecated_solvent_settings.py +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/stjames/atom.py +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/stjames/atomium_stjames/__init__.py +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/stjames/atomium_stjames/data.py +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/stjames/atomium_stjames/mmcif.py +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/stjames/atomium_stjames/pdb.py +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/stjames/atomium_stjames/utilities.py +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/stjames/base.py +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/stjames/basis_set.py +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/stjames/calculation.py +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/stjames/compute_settings.py +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/stjames/constraint.py +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/stjames/correction.py +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/stjames/data/__init__.py +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/stjames/data/bragg_radii.json +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/stjames/data/elements.py +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/stjames/data/isotopes.json +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/stjames/data/nist_isotopes.json +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/stjames/data/read_nist_isotopes.py +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/stjames/data/symbol_element.json +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/stjames/diis_settings.py +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/stjames/grid_settings.py +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/stjames/int_settings.py +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/stjames/message.py +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/stjames/method.py +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/stjames/mode.py +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/stjames/molecule.py +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/stjames/opt_settings.py +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/stjames/pdb.py +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/stjames/periodic_cell.py +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/stjames/py.typed +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/stjames/scf_settings.py +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/stjames/settings.py +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/stjames/solvent.py +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/stjames/status.py +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/stjames/task.py +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/stjames/thermochem_settings.py +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/stjames/types.py +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/stjames/workflows/__init__.py +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/stjames/workflows/admet.py +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/stjames/workflows/basic_calculation.py +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/stjames/workflows/bde.py +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/stjames/workflows/conformer.py +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/stjames/workflows/conformer_search.py +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/stjames/workflows/descriptors.py +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/stjames/workflows/electronic_properties.py +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/stjames/workflows/fukui.py +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/stjames/workflows/hydrogen_bond_basicity.py +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/stjames/workflows/irc.py +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/stjames/workflows/molecular_dynamics.py +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/stjames/workflows/multistage_opt.py +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/stjames/workflows/pka.py +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/stjames/workflows/redox_potential.py +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/stjames/workflows/scan.py +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/stjames/workflows/spin_states.py +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/stjames/workflows/tautomer.py +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/stjames/workflows/workflow.py +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/stjames.egg-info/SOURCES.txt +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/stjames.egg-info/dependency_links.txt +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/stjames.egg-info/requires.txt +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/stjames.egg-info/top_level.txt +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/tests/test_constraints.py +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/tests/test_from_extxyz.py +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/tests/test_molecule.py +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/tests/test_pdb.py +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/tests/test_rounding.py +0 -0
- {stjames-0.0.59 → stjames-0.0.61}/tests/test_settings.py +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"""Docking workflow."""
|
|
2
2
|
|
|
3
|
-
from typing import Annotated
|
|
3
|
+
from typing import Annotated, Self
|
|
4
4
|
|
|
5
|
-
from pydantic import AfterValidator, ConfigDict, field_validator
|
|
5
|
+
from pydantic import AfterValidator, ConfigDict, field_validator, model_validator
|
|
6
6
|
|
|
7
7
|
from ..base import Base, round_float
|
|
8
8
|
from ..pdb import PDB
|
|
@@ -26,6 +26,10 @@ class DockingWorkflow(Workflow):
|
|
|
26
26
|
"""
|
|
27
27
|
Docking workflow.
|
|
28
28
|
|
|
29
|
+
Note that the protein can be supplied either by UUID or raw PDB object.
|
|
30
|
+
We anticipate that the former will dominate deployed usage, but the latter is handy for isolated testing.
|
|
31
|
+
If, for whatever reason, the workflow is initialized with both a `target_uuid` and a `target`, the UUID will be ignored.
|
|
32
|
+
|
|
29
33
|
Inherited:
|
|
30
34
|
:param initial_molecule: Molecule of interest
|
|
31
35
|
:param mode: Mode for workflow (currently unused)
|
|
@@ -36,7 +40,8 @@ class DockingWorkflow(Workflow):
|
|
|
36
40
|
:param do_csearch: whether to csearch starting structures
|
|
37
41
|
:param do_optimization: whether to optimize starting structures
|
|
38
42
|
:param conformers: UUIDs of optimized conformers
|
|
39
|
-
:param target: PDB of the protein
|
|
43
|
+
:param target: PDB of the protein.
|
|
44
|
+
:param target_uuid: UUID of the protein.
|
|
40
45
|
:param pocket: center (x, y, z) and size (x, y, z) of the pocket
|
|
41
46
|
|
|
42
47
|
Results:
|
|
@@ -49,7 +54,8 @@ class DockingWorkflow(Workflow):
|
|
|
49
54
|
do_optimization: bool = True
|
|
50
55
|
conformers: list[UUID] = []
|
|
51
56
|
|
|
52
|
-
target: PDB
|
|
57
|
+
target: PDB | None = None
|
|
58
|
+
target_uuid: UUID | None = None
|
|
53
59
|
pocket: tuple[Vector3D, Vector3D]
|
|
54
60
|
|
|
55
61
|
do_pose_hydrogen_refinement: bool = True
|
|
@@ -60,16 +66,25 @@ class DockingWorkflow(Workflow):
|
|
|
60
66
|
|
|
61
67
|
def __repr__(self) -> str:
|
|
62
68
|
"""Return a string representation of the Docking workflow."""
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
69
|
+
if self.target is not None:
|
|
70
|
+
desc = self.target.description
|
|
71
|
+
target = desc.code or desc.title
|
|
72
|
+
else:
|
|
73
|
+
target = ""
|
|
66
74
|
|
|
75
|
+
ligand = "".join(atom.atomic_symbol for atom in self.initial_molecule.atoms)
|
|
67
76
|
return f"<{type(self).__name__} {target} {ligand}>"
|
|
68
77
|
|
|
78
|
+
@model_validator(mode="after")
|
|
79
|
+
def check_protein(self) -> Self:
|
|
80
|
+
"""Check if protein is provided."""
|
|
81
|
+
if not self.target and not self.target_uuid:
|
|
82
|
+
raise ValueError("Must provide either molecules or smiles")
|
|
83
|
+
return self
|
|
84
|
+
|
|
69
85
|
@field_validator("pocket", mode="after")
|
|
70
86
|
def validate_pocket(cls, pocket: tuple[Vector3D, Vector3D]) -> tuple[Vector3D, Vector3D]:
|
|
71
87
|
center, size = pocket
|
|
72
88
|
if any(q <= 0 for q in size):
|
|
73
89
|
raise ValueError(f"Pocket size must be positive, got: {size}")
|
|
74
|
-
|
|
75
90
|
return pocket
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|