stjames 0.0.51__py3-none-any.whl → 0.0.52__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.

Potentially problematic release.


This version of stjames might be problematic. Click here for more details.

@@ -1,25 +1,25 @@
1
1
  """Docking workflow."""
2
2
 
3
- from typing import Self
3
+ from typing import Annotated
4
4
 
5
- from pydantic import BaseModel, ConfigDict, field_validator, model_validator
5
+ from pydantic import AfterValidator, ConfigDict, field_validator
6
6
 
7
- from ..molecule import Molecule
7
+ from ..base import Base, round_float
8
8
  from ..pdb import PDB
9
- from ..types import Vector3D
9
+ from ..types import UUID, Vector3D
10
10
  from .workflow import Workflow
11
11
 
12
12
 
13
- class Score(BaseModel):
13
+ class Score(Base):
14
14
  """
15
15
  Pose with its score.
16
16
 
17
17
  :param pose: conformation of the ligand when docked
18
- :param score: score of the pose
18
+ :param score: score of the pose, in kcal/mol
19
19
  """
20
20
 
21
- pose: Molecule
22
- score: float
21
+ pose: UUID | None # for calculation
22
+ score: Annotated[float, AfterValidator(round_float(3))]
23
23
 
24
24
 
25
25
  class DockingWorkflow(Workflow):
@@ -27,12 +27,15 @@ class DockingWorkflow(Workflow):
27
27
  Docking workflow.
28
28
 
29
29
  Inherited:
30
- :param initial_molecule: Molecule of interest (currently unused)
30
+ :param initial_molecule: Molecule of interest
31
31
  :param mode: Mode for workflow (currently unused)
32
32
 
33
33
  New:
34
34
  :param molecules: Molecules to dock (optional)
35
35
  :param smiles: SMILES strings of the ligands (optional)
36
+ :param do_csearch: whether to csearch starting structures
37
+ :param do_optimization: whether to optimize starting structures
38
+ :param conformers: UUIDs of optimized conformers
36
39
  :param target: PDB of the protein
37
40
  :param pocket: center (x, y, z) and size (x, y, z) of the pocket
38
41
 
@@ -42,12 +45,14 @@ class DockingWorkflow(Workflow):
42
45
 
43
46
  model_config = ConfigDict(arbitrary_types_allowed=True)
44
47
 
45
- molecules: list[Molecule] = []
46
- smiles: list[str] = []
48
+ do_csearch: bool = True
49
+ do_optimization: bool = True
50
+ conformers: list[UUID] = []
47
51
 
48
52
  target: PDB
49
53
  pocket: tuple[Vector3D, Vector3D]
50
54
 
55
+ do_pose_hydrogen_refinement: bool = True
51
56
  scores: list[Score] = []
52
57
 
53
58
  def __str__(self) -> str:
@@ -61,16 +66,6 @@ class DockingWorkflow(Workflow):
61
66
 
62
67
  return f"<{type(self).__name__} {target} {ligand}>"
63
68
 
64
- @model_validator(mode="after")
65
- def check_molecules(self) -> Self:
66
- """Check if molecules are provided."""
67
- if self.molecules and self.smiles:
68
- raise ValueError("Must provide only one of molecules or smiles, not both")
69
- elif not self.molecules and not self.smiles:
70
- raise ValueError("Must provide either molecules or smiles")
71
-
72
- return self
73
-
74
69
  @field_validator("pocket", mode="after")
75
70
  def validate_pocket(cls, pocket: tuple[Vector3D, Vector3D]) -> tuple[Vector3D, Vector3D]:
76
71
  center, size = pocket
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: stjames
3
- Version: 0.0.51
3
+ Version: 0.0.52
4
4
  Summary: standardized JSON atom/molecule encoding scheme
5
5
  Author-email: Corin Wagen <corin@rowansci.com>
6
6
  Project-URL: Homepage, https://github.com/rowansci/stjames
@@ -39,7 +39,7 @@ stjames/workflows/bde.py,sha256=cWsZNiNdUy5DGvu8o6bBepLZIB5ohiAD6RKoK3YSq1I,9786
39
39
  stjames/workflows/conformer.py,sha256=LnpvH5HmLCn-ddH3r1WhEYONUMX5ohZswdESEPCR6o4,2907
40
40
  stjames/workflows/conformer_search.py,sha256=ZQ3VxQoaR_aZ-KSblXooAnGMTFbvOj4IQnM70K0OXhc,13497
41
41
  stjames/workflows/descriptors.py,sha256=lRRCsGzad3nIg0wI1090ffaXB0FVh0nRRb2lNxCY0kI,281
42
- stjames/workflows/docking.py,sha256=MvqfxCEZva91GB_w0qd68v7Dnb-F6AxzhQBsKJXkaeY,2239
42
+ stjames/workflows/docking.py,sha256=K6zy4lo1XfrrMd7ZmKAe_Fd9wvKhtCMoK66gp-TsuJA,2158
43
43
  stjames/workflows/electronic_properties.py,sha256=uAIcGKKLhqoHyDgcOZulEXwTU2EjidyvOndZDYyeJEk,4003
44
44
  stjames/workflows/fukui.py,sha256=2J23RjkSOZ-40AM3AdnbJkRBGaCevkjkhnV3pVfa6lo,738
45
45
  stjames/workflows/hydrogen_bond_basicity.py,sha256=Luvov2DlDvZN06W-mU6YaN7wcIrTLwzdoWww-jNE3x4,517
@@ -52,8 +52,8 @@ stjames/workflows/scan.py,sha256=uNSuUmVMAV4exNvcv1viVe7930i7GZMn7RtEimnwEE8,100
52
52
  stjames/workflows/spin_states.py,sha256=b-uCf-pHjF_JHbExeb5GdRToE0pIxP0JTd50U130ckI,4693
53
53
  stjames/workflows/tautomer.py,sha256=x3TC8hkMs87ZUodLyhce5EUzYoV276ePfPMi7ISWyNU,651
54
54
  stjames/workflows/workflow.py,sha256=tIu5naADYgYS7kdW8quvGEWHWosBcrIdcD7L86v-uMQ,976
55
- stjames-0.0.51.dist-info/LICENSE,sha256=i7ehYBS-6gGmbTcgU4mgk28pyOx2kScJ0kcx8n7bWLM,1084
56
- stjames-0.0.51.dist-info/METADATA,sha256=jzVVfTfwoI1DUMLSneJa8yejvEyOcNZgbBqx1UGVXD8,1689
57
- stjames-0.0.51.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
58
- stjames-0.0.51.dist-info/top_level.txt,sha256=FYCwxl6quhYOAgG-mnPQcCK8vsVM7B8rIUrO-WrQ_PI,8
59
- stjames-0.0.51.dist-info/RECORD,,
55
+ stjames-0.0.52.dist-info/LICENSE,sha256=i7ehYBS-6gGmbTcgU4mgk28pyOx2kScJ0kcx8n7bWLM,1084
56
+ stjames-0.0.52.dist-info/METADATA,sha256=4vbKOo5yexzEQRYM3x6_fYAyAt72lhpU-UKSn_hdOwE,1689
57
+ stjames-0.0.52.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
58
+ stjames-0.0.52.dist-info/top_level.txt,sha256=FYCwxl6quhYOAgG-mnPQcCK8vsVM7B8rIUrO-WrQ_PI,8
59
+ stjames-0.0.52.dist-info/RECORD,,