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

@@ -4,6 +4,7 @@ from typing import Literal
4
4
 
5
5
  from .admet import *
6
6
  from .basic_calculation import *
7
+ from .batch_docking import *
7
8
  from .bde import *
8
9
  from .conformer import *
9
10
  from .conformer_search import *
@@ -34,6 +35,7 @@ from .workflow import *
34
35
  WORKFLOW_NAME = Literal[
35
36
  "admet",
36
37
  "basic_calculation",
38
+ "batch_docking",
37
39
  "bde",
38
40
  "conformers",
39
41
  "conformer_search",
@@ -64,6 +66,7 @@ WORKFLOW_NAME = Literal[
64
66
  WORKFLOW_MAPPING: dict[WORKFLOW_NAME, Workflow] = {
65
67
  "admet": ADMETWorkflow, # type: ignore [dict-item]
66
68
  "basic_calculation": BasicCalculationWorkflow, # type: ignore [dict-item]
69
+ "batch_docking": BatchDockingWorkflow, # type: ignore [dict-item]
67
70
  "bde": BDEWorkflow, # type: ignore [dict-item]
68
71
  "conformers": ConformerWorkflow, # type: ignore [dict-item]
69
72
  "conformer_search": ConformerSearchWorkflow, # type: ignore [dict-item]
@@ -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
@@ -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: protein sequences of interest
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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: stjames
3
- Version: 0.0.117
3
+ Version: 0.0.120
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
@@ -37,9 +37,10 @@ stjames/data/read_nist_isotopes.py,sha256=y10FNjW43QpC45qib7VHsIghEwT7GG5rsNwHdc
37
37
  stjames/data/symbol_element.json,sha256=vl_buFusTqBd-muYQtMLtTDLy2OtBI6KkBeqkaWRQrg,1186
38
38
  stjames/optimization/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
39
39
  stjames/optimization/freezing_string_method.py,sha256=eEQBqbYHgJH9gVRLDIFtGuPcsHHMLAAt1hF3jtq70lo,2285
40
- stjames/workflows/__init__.py,sha256=RoqcRk27PTu9UfHFQQtu5quiBipsx4NGvDPst5S1EOc,3317
40
+ stjames/workflows/__init__.py,sha256=GiSXuBCA2tE5eXHnVYJvjtoqX_zvCn8t0wpkvK1HEls,3438
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=OE05pt2ZOd8TzTOlBngXCVg9wv_553ZR60VNRPlq0f8,1953
69
- stjames-0.0.117.dist-info/licenses/LICENSE,sha256=i05z7xEhyrg6f8j0lR3XYjShnF-MJGFQ-DnpsZ8yiVI,1084
70
- stjames-0.0.117.dist-info/METADATA,sha256=LH_VdqC55gK6JJ0beT4uW6xifSRAfMJLQoIh3VpMAHg,1725
71
- stjames-0.0.117.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
72
- stjames-0.0.117.dist-info/top_level.txt,sha256=FYCwxl6quhYOAgG-mnPQcCK8vsVM7B8rIUrO-WrQ_PI,8
73
- stjames-0.0.117.dist-info/RECORD,,
69
+ stjames/workflows/workflow.py,sha256=cYNP_tK1afJTscXJzYv5VGe8n2Est6PpthS268oRi1U,2494
70
+ stjames-0.0.120.dist-info/licenses/LICENSE,sha256=i05z7xEhyrg6f8j0lR3XYjShnF-MJGFQ-DnpsZ8yiVI,1084
71
+ stjames-0.0.120.dist-info/METADATA,sha256=G8ujY0SFUr28ySoupBKoRViks6v84Q5bepOSRES9EMc,1725
72
+ stjames-0.0.120.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
73
+ stjames-0.0.120.dist-info/top_level.txt,sha256=FYCwxl6quhYOAgG-mnPQcCK8vsVM7B8rIUrO-WrQ_PI,8
74
+ stjames-0.0.120.dist-info/RECORD,,