stjames 0.0.117__py3-none-any.whl → 0.0.119__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.
- stjames/workflows/batch_docking.py +46 -0
- stjames/workflows/workflow.py +25 -5
- {stjames-0.0.117.dist-info → stjames-0.0.119.dist-info}/METADATA +1 -1
- {stjames-0.0.117.dist-info → stjames-0.0.119.dist-info}/RECORD +7 -6
- {stjames-0.0.117.dist-info → stjames-0.0.119.dist-info}/WHEEL +0 -0
- {stjames-0.0.117.dist-info → stjames-0.0.119.dist-info}/licenses/LICENSE +0 -0
- {stjames-0.0.117.dist-info → stjames-0.0.119.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"""High-throughput docking workflow."""
|
|
2
|
+
|
|
3
|
+
from typing import Annotated
|
|
4
|
+
|
|
5
|
+
from pydantic import AfterValidator, ConfigDict, field_validator
|
|
6
|
+
|
|
7
|
+
from ..pdb import PDB
|
|
8
|
+
from ..types import UUID, Vector3D, round_list
|
|
9
|
+
from .docking import VinaSettings
|
|
10
|
+
from .workflow import BatchSMILESWorkflow
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class BatchDockingWorkflow(BatchSMILESWorkflow):
|
|
14
|
+
"""
|
|
15
|
+
Docking workflow.
|
|
16
|
+
|
|
17
|
+
Note that the protein can be supplied either by UUID or raw PDB object.
|
|
18
|
+
We anticipate that the former will dominate deployed usage, but the latter is handy for isolated testing.
|
|
19
|
+
If, for whatever reason, the workflow is initialized with both a `target_uuid` and a `target`, the UUID will be ignored.
|
|
20
|
+
|
|
21
|
+
Inherited:
|
|
22
|
+
:param smiles_list: list of SMILES
|
|
23
|
+
|
|
24
|
+
New:
|
|
25
|
+
:param target: PDB of the protein, or the UUID of the protein.
|
|
26
|
+
:param pocket: center (x, y, z) and size (x, y, z) of the pocket
|
|
27
|
+
:param docking_settings: how to run each docking calculation
|
|
28
|
+
|
|
29
|
+
Results:
|
|
30
|
+
:param best_scores: the best score for each SMILES string
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
model_config = ConfigDict(arbitrary_types_allowed=True)
|
|
34
|
+
|
|
35
|
+
target: PDB | UUID
|
|
36
|
+
pocket: tuple[Vector3D, Vector3D]
|
|
37
|
+
|
|
38
|
+
docking_settings: VinaSettings = VinaSettings()
|
|
39
|
+
best_scores: Annotated[list[float | None], AfterValidator(round_list(3))] = []
|
|
40
|
+
|
|
41
|
+
@field_validator("pocket", mode="after")
|
|
42
|
+
def validate_pocket(cls, pocket: tuple[Vector3D, Vector3D]) -> tuple[Vector3D, Vector3D]:
|
|
43
|
+
_center, size = pocket
|
|
44
|
+
if any(q <= 0 for q in size):
|
|
45
|
+
raise ValueError(f"Pocket size must be positive, got: {size}")
|
|
46
|
+
return pocket
|
stjames/workflows/workflow.py
CHANGED
|
@@ -22,21 +22,31 @@ class Workflow(Base):
|
|
|
22
22
|
return repr(self)
|
|
23
23
|
|
|
24
24
|
|
|
25
|
+
class ProteinSequence(Base):
|
|
26
|
+
"""
|
|
27
|
+
Protein sequence metadata including cyclic flag.
|
|
28
|
+
|
|
29
|
+
:param sequence: amino-acid sequence string
|
|
30
|
+
:param cyclic: whether this sequence forms a cyclic peptide (defaults to False)
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
sequence: str
|
|
34
|
+
cyclic: bool = False
|
|
35
|
+
|
|
36
|
+
|
|
25
37
|
class FASTAWorkflow(Workflow):
|
|
26
38
|
"""
|
|
27
39
|
Base class for Workflows that operate on protein sequences and SMILES.
|
|
28
40
|
|
|
29
|
-
:param initial_protein_sequences:
|
|
41
|
+
:param initial_protein_sequences: proteins to evaluate, either plain sequence strings or ProteinSequence objects with cyclic flags
|
|
30
42
|
:param initial_smiles_list: SMILES strings of interest
|
|
43
|
+
:param ligand_binding_affinity_index: optional index selecting which ligand affinity to evaluate
|
|
31
44
|
"""
|
|
32
45
|
|
|
33
|
-
initial_protein_sequences: list[str]
|
|
46
|
+
initial_protein_sequences: list[ProteinSequence] | list[str]
|
|
34
47
|
initial_smiles_list: list[str] | None = None
|
|
35
48
|
ligand_binding_affinity_index: int | None = None
|
|
36
49
|
|
|
37
|
-
def __repr__(self) -> str:
|
|
38
|
-
return f"<{type(self).__name__} {self.initial_protein_sequences} {self.initial_smiles_list}>"
|
|
39
|
-
|
|
40
50
|
|
|
41
51
|
class SMILESWorkflow(Workflow):
|
|
42
52
|
"""
|
|
@@ -51,6 +61,16 @@ class SMILESWorkflow(Workflow):
|
|
|
51
61
|
return f"<{type(self).__name__} {self.initial_smiles}>"
|
|
52
62
|
|
|
53
63
|
|
|
64
|
+
class BatchSMILESWorkflow(Workflow):
|
|
65
|
+
"""
|
|
66
|
+
Base class for Workflows that operate on a list of SMILES strings.
|
|
67
|
+
|
|
68
|
+
:param smiles_list: SMILES strings of interest
|
|
69
|
+
"""
|
|
70
|
+
|
|
71
|
+
smiles_list: list[str]
|
|
72
|
+
|
|
73
|
+
|
|
54
74
|
class MoleculeWorkflow(Workflow):
|
|
55
75
|
"""
|
|
56
76
|
Base class for Workflows that operate on a single molecule.
|
|
@@ -40,6 +40,7 @@ stjames/optimization/freezing_string_method.py,sha256=eEQBqbYHgJH9gVRLDIFtGuPcsH
|
|
|
40
40
|
stjames/workflows/__init__.py,sha256=RoqcRk27PTu9UfHFQQtu5quiBipsx4NGvDPst5S1EOc,3317
|
|
41
41
|
stjames/workflows/admet.py,sha256=qFUpCFiLW-3gzuEjCMNBJ6DEG_vquJcPAsN4SVZRfdE,1289
|
|
42
42
|
stjames/workflows/basic_calculation.py,sha256=sAgHBcNHE72ZbZPB9vyZShALRC4zOVw6It6cpJlbX2A,911
|
|
43
|
+
stjames/workflows/batch_docking.py,sha256=o-t5FkfLlbe60jX1_ZeqWSJJ5vsjEIbTa5GLN3ny_tk,1590
|
|
43
44
|
stjames/workflows/bde.py,sha256=g_In-caftXiimrhfdptHjpfrYQUs3vF58qYmRnaTN8g,10825
|
|
44
45
|
stjames/workflows/conformer.py,sha256=18aO6ngMBeGAmQkBdLGCCHr398RIYr1v2hD2IT1u4cc,3005
|
|
45
46
|
stjames/workflows/conformer_search.py,sha256=1kBUT0yCcTPTCtxg1tlTKHRRXkfNYNqzla_89lDEL9k,15696
|
|
@@ -65,9 +66,9 @@ stjames/workflows/solubility.py,sha256=lfCVvJjqEaddLUpK6WBxjB7u12Sci-K95A5_qIMkI
|
|
|
65
66
|
stjames/workflows/spin_states.py,sha256=0degmE-frovgoXweshZyjfjqL7nkbaFoO9YoJhvQnaI,4748
|
|
66
67
|
stjames/workflows/strain.py,sha256=paYxDDQTB1eYP_c2kLVz1-QX7Vpw0LLb3ujnFin_SOM,1834
|
|
67
68
|
stjames/workflows/tautomer.py,sha256=7eYKziGPg8Km6lfowTzSkgJfJ4SHUPrAmnTf8Bi-SB0,1164
|
|
68
|
-
stjames/workflows/workflow.py,sha256=
|
|
69
|
-
stjames-0.0.
|
|
70
|
-
stjames-0.0.
|
|
71
|
-
stjames-0.0.
|
|
72
|
-
stjames-0.0.
|
|
73
|
-
stjames-0.0.
|
|
69
|
+
stjames/workflows/workflow.py,sha256=cYNP_tK1afJTscXJzYv5VGe8n2Est6PpthS268oRi1U,2494
|
|
70
|
+
stjames-0.0.119.dist-info/licenses/LICENSE,sha256=i05z7xEhyrg6f8j0lR3XYjShnF-MJGFQ-DnpsZ8yiVI,1084
|
|
71
|
+
stjames-0.0.119.dist-info/METADATA,sha256=zSXQ6WwjJ7Fv7dQ1y_4Nx5Glq6zYzXkq94uKLLDEAbg,1725
|
|
72
|
+
stjames-0.0.119.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
73
|
+
stjames-0.0.119.dist-info/top_level.txt,sha256=FYCwxl6quhYOAgG-mnPQcCK8vsVM7B8rIUrO-WrQ_PI,8
|
|
74
|
+
stjames-0.0.119.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|