stjames 0.0.82__py3-none-any.whl → 0.0.84__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/pdb.py CHANGED
@@ -228,7 +228,7 @@ def pdb_object_to_pdb_filestring(
228
228
  keyword: bool = False,
229
229
  seqres: bool = True,
230
230
  hetnam: bool = True,
231
- remark: bool = True,
231
+ remark: bool = False,
232
232
  crystallography: bool = False,
233
233
  ) -> str:
234
234
  pdb_lines: list[str] = []
@@ -18,6 +18,7 @@ from .macropka import *
18
18
  from .molecular_dynamics import *
19
19
  from .multistage_opt import *
20
20
  from .pka import *
21
+ from .pose_analysis_md import *
21
22
  from .protein_cofolding import *
22
23
  from .redox_potential import *
23
24
  from .scan import *
@@ -43,6 +44,7 @@ WORKFLOW_NAME = Literal[
43
44
  "molecular_dynamics",
44
45
  "multistage_opt",
45
46
  "pka",
47
+ "pose_analysis_md",
46
48
  "protein_cofolding",
47
49
  "redox_potential",
48
50
  "scan",
@@ -68,10 +70,11 @@ WORKFLOW_MAPPING: dict[WORKFLOW_NAME, Workflow] = {
68
70
  "molecular_dynamics": MolecularDynamicsWorkflow, # type: ignore [dict-item]
69
71
  "multistage_opt": MultiStageOptWorkflow, # type: ignore [dict-item]
70
72
  "pka": pKaWorkflow, # type: ignore [dict-item]
73
+ "pose_analysis_md": PoseAnalysisMolecularDynamicsWorkflow, # type: ignore [dict-item]
74
+ "protein_cofolding": ProteinCofoldingWorkflow, # type: ignore [dict-item]
71
75
  "redox_potential": RedoxPotentialWorkflow, # type: ignore [dict-item]
72
76
  "scan": ScanWorkflow, # type: ignore [dict-item]
73
77
  "solubility": SolubilityWorkflow, # type: ignore [dict-item]
74
78
  "spin_states": SpinStatesWorkflow, # type: ignore [dict-item]
75
- "protein_cofolding": ProteinCofoldingWorkflow, # type: ignore [dict-item]
76
79
  "tautomers": TautomerWorkflow, # type: ignore [dict-item]
77
80
  }
@@ -0,0 +1,104 @@
1
+ from typing import Annotated, Self
2
+
3
+ from pydantic import AfterValidator, PositiveFloat, PositiveInt, model_validator
4
+
5
+ from ..base import Base, round_float
6
+ from ..pdb import PDB
7
+ from ..types import UUID, round_list
8
+ from .workflow import MoleculeWorkflow
9
+
10
+
11
+ class BindingPoseContact(Base):
12
+ """
13
+ A single protein–ligand contact from an MD trajectory.
14
+
15
+ :param protein_atom_index: the index of the protein atom
16
+ :param ligand_atom_index: the index of the ligand atom
17
+ :occupancy: the probability of seeing this interaction in a frame, between 0 and 1
18
+ """
19
+
20
+ protein_atom_index: int
21
+ ligand_atom_index: int
22
+ occupancy: Annotated[float, AfterValidator(round_float(3))]
23
+
24
+
25
+ class BindingPoseTrajectory(Base):
26
+ """
27
+ Represents a single trajectory looking at a binding pose.
28
+
29
+ :param uuid: the UUID of the trajectory
30
+ :param ligand_rmsd: the RMSD of the ligand vs. starting pose (aligning the protein)
31
+ :param contacts: the conserved binding-pose contacts
32
+ """
33
+
34
+ uuid: UUID
35
+ ligand_rmsd: Annotated[list[float], AfterValidator(round_list(3))] = []
36
+ contacts: list[BindingPoseContact] = []
37
+
38
+
39
+ class PoseAnalysisMolecularDynamicsWorkflow(MoleculeWorkflow):
40
+ """
41
+ Pose analysis molecular dynamics workflow.
42
+
43
+ Note that the protein can be supplied either by UUID or raw PDB object.
44
+ We anticipate that the former will dominate deployed usage, but the latter is handy for isolated testing.
45
+ If, for whatever reason, the workflow is initialized with both a `target_uuid` and a `target`, the UUID will be ignored.
46
+
47
+ Inherited:
48
+ :param initial_molecule: Molecule of interest
49
+ :param mode: Mode for workflow (currently unused)
50
+
51
+ New:
52
+ :param protein: PDB of the protein.
53
+ :param protein_uuid: UUID of the protein.
54
+ :param num_trajectories: how many trajectories to run
55
+ :param equilibration_time_ns: how long to equilibrate trajectories for, in nanoseconds
56
+ :param simulation_time_ns: how long to run trajectories for, in nanoseconds
57
+ :param temperature: the temperature, in K
58
+ :param pressure_atm: the pressure, in atm
59
+ :param langevin_timescale_ps: the timescale for the Langevin integrator, in inverse picoseconds
60
+ :param timestep_fs: the timestep, in femtoseconds
61
+ :param constrain_hydrogens: whether or not to use SHAKE to freeze bonds to hydrogen
62
+ :param nonbonded_cutoff: the nonbonded cutoff for particle-mesh Ewald, in Å
63
+ :param protein_prune_cutoff: the cutoff past which residues will be deleted, in Å
64
+ :param protein_restraint_cutoff: the cutoff past which alpha-carbons will be constrained, in Å
65
+ :param protein_restraint_constant: the force constant for backbone restraints, in kcal/mol/Å**2
66
+ :param ionic_strength_M: the ionic strength of the solution, in M (molar)
67
+ :param water_buffer: the amount of water to add around the protein, in Å
68
+
69
+ Results:
70
+ :param trajectories: for each replicate, a UUID and the corresponding analysis results
71
+ :param minimized_protein_uuid: UUID of final system PDB
72
+ """
73
+
74
+ protein: PDB | None = None
75
+ protein_uuid: UUID | None = None
76
+
77
+ num_trajectories: PositiveInt = 4
78
+ equilibration_time_ns: Annotated[PositiveFloat, AfterValidator(round_float(3))] = 5
79
+ simulation_time_ns: Annotated[PositiveFloat, AfterValidator(round_float(3))] = 10
80
+
81
+ temperature: Annotated[PositiveFloat, AfterValidator(round_float(3))] = 300
82
+ pressure_atm: Annotated[PositiveFloat, AfterValidator(round_float(3))] = 1.0
83
+ langevin_timescale_ps: Annotated[PositiveFloat, AfterValidator(round_float(3))] = 1.0
84
+
85
+ timestep_fs: Annotated[PositiveFloat, AfterValidator(round_float(3))] = 2
86
+ constrain_hydrogens: bool = True
87
+ nonbonded_cutoff: Annotated[PositiveFloat, AfterValidator(round_float(3))] = 8.0
88
+
89
+ protein_prune_cutoff: Annotated[PositiveFloat, AfterValidator(round_float(3))] = 9.0
90
+ protein_restraint_cutoff: Annotated[PositiveFloat, AfterValidator(round_float(3))] = 7.0
91
+ protein_restraint_constant: Annotated[PositiveFloat, AfterValidator(round_float(3))] = 100
92
+
93
+ ionic_strength_M: Annotated[PositiveFloat, AfterValidator(round_float(3))] = 0.10
94
+ water_buffer: Annotated[PositiveFloat, AfterValidator(round_float(3))] = 6.0
95
+
96
+ minimized_protein_uuid: UUID | None = None
97
+ trajectories: list[BindingPoseTrajectory] = []
98
+
99
+ @model_validator(mode="after")
100
+ def check_cutoff_sanity(self) -> Self:
101
+ """Check if protein is provided."""
102
+ if self.protein_prune_cutoff < self.protein_restraint_cutoff:
103
+ raise ValueError("Pruning cutoff must be larger than restraint cutoff")
104
+ return self
@@ -2,7 +2,7 @@
2
2
 
3
3
  from typing import Annotated
4
4
 
5
- from pydantic import AfterValidator, BaseModel
5
+ from pydantic import AfterValidator, BaseModel, ConfigDict
6
6
 
7
7
  from ..base import LowercaseStrEnum, round_float
8
8
  from ..types import UUID, round_optional_list
@@ -47,6 +47,8 @@ class ProteinCofoldingWorkflow(FASTAWorkflow):
47
47
  :param predicted_structure_uuid: UUID of the predicted structure
48
48
  """
49
49
 
50
+ model_config = ConfigDict(validate_assignment=True)
51
+
50
52
  use_msa_server: bool = False
51
53
  use_templates_server: bool = False
52
54
  use_potentials: bool = False
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: stjames
3
- Version: 0.0.82
3
+ Version: 0.0.84
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
@@ -15,7 +15,7 @@ stjames/method.py,sha256=k7WtNvD_0OyXWWDjukmVXFFYfIO-Wg4vY1W58o99-gQ,2821
15
15
  stjames/mode.py,sha256=xw46Cc7f3eTS8i35qECi-8DocAlANhayK3w4akD4HBU,496
16
16
  stjames/molecule.py,sha256=l4S6prH1xflnZtbwidSF2THsiHaSJtRiy1rmUbH366Q,20631
17
17
  stjames/opt_settings.py,sha256=LEwGXUEKq5TfU5rr60Z4QQBhCqiw1Ch5w0M_lXawWo8,642
18
- stjames/pdb.py,sha256=_pIdJCMhIzS4t2HWQa_susDWjZEl0oLn4Njb1QoKvKw,26460
18
+ stjames/pdb.py,sha256=NtNB3M_OXq8raQA5ivjFKcIxOGemBvpGDIlCeb-s80E,26461
19
19
  stjames/periodic_cell.py,sha256=eV_mArsY_MPEFSrFEsTC-CyCc6V8ITAXdk7yhjjNI7M,1080
20
20
  stjames/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
21
21
  stjames/scf_settings.py,sha256=WotVgVrayQ_8PUHP39zVtG7iLT9PV41lpzruttFACP8,2356
@@ -37,7 +37,7 @@ stjames/data/isotopes.json,sha256=5ba8QnLrHD_Ypv2xekv2cIRwYrX3MQ19-1FOFtt0RuU,83
37
37
  stjames/data/nist_isotopes.json,sha256=d5DNk1dX0iB1waEYIRR6JMHuA7AuYwSBEgBvb4EKyhM,14300
38
38
  stjames/data/read_nist_isotopes.py,sha256=y10FNjW43QpC45qib7VHsIghEwT7GG5rsNwHdc9osRI,3309
39
39
  stjames/data/symbol_element.json,sha256=vl_buFusTqBd-muYQtMLtTDLy2OtBI6KkBeqkaWRQrg,1186
40
- stjames/workflows/__init__.py,sha256=rC4KfLzrOKr5FlS4uT3UW1s36-y32vp20VGCw0iHQp0,2649
40
+ stjames/workflows/__init__.py,sha256=S5Z8bOWvvh9-TYV2VgfSpfvvfN1ceShTo5Dro5tmlP0,2796
41
41
  stjames/workflows/admet.py,sha256=h8ph6oeRCxU3-_jqRRWPg3RZcheu9JzCHiWqSC9VYKY,1296
42
42
  stjames/workflows/basic_calculation.py,sha256=ZX3KwhfyyCTjc2ougQIL4If7gtwZP9WjqpL45mBquW0,573
43
43
  stjames/workflows/bde.py,sha256=hdTjwma5L9SrU5F5r6dB1ruB_B6buBUtZHf2sanNW2k,9802
@@ -54,15 +54,16 @@ stjames/workflows/macropka.py,sha256=KRIyk4gsSYL3eqyzCDndStGLwjWSo60cgCAzvAoD1Nk
54
54
  stjames/workflows/molecular_dynamics.py,sha256=kxugE73Ntzpj-xpJSoQ1EwGzXXdvi_NTyeP4913EVwE,3173
55
55
  stjames/workflows/multistage_opt.py,sha256=P8rxMUhKXMmDi7Id95IOTEmM0xN1ErsKcDJfgY08vjc,16538
56
56
  stjames/workflows/pka.py,sha256=j3vBh2YM3nJzJ1XJKPsmYahRCeaU9n3P-G-u9_moaFw,2065
57
- stjames/workflows/protein_cofolding.py,sha256=bVS5ZBewm3ullC2B7fSj_gwE1SEULVkRu-RZ6X4bnaY,2104
57
+ stjames/workflows/pose_analysis_md.py,sha256=LAn6IXcQIUCt9M54kDzwWkmoCH0r1H99_APFu55skQc,4619
58
+ stjames/workflows/protein_cofolding.py,sha256=_05DCzzKGZFtns9HARAMjcWxVrJU9DPb3VNVWSgwWR8,2173
58
59
  stjames/workflows/redox_potential.py,sha256=7S18t9Y3eynSnA3lZbRlvLfdbgeBopdiigLzt1zxg5c,3871
59
60
  stjames/workflows/scan.py,sha256=DXQBpa2t2PowAtOwmdgpxaSLq--fEShljzAGSb8Nf5U,2993
60
61
  stjames/workflows/solubility.py,sha256=kGfVyPPGDLRpf2j6dSY7woCkfsoXSbUzdSImA4mcMpw,1898
61
62
  stjames/workflows/spin_states.py,sha256=0degmE-frovgoXweshZyjfjqL7nkbaFoO9YoJhvQnaI,4748
62
63
  stjames/workflows/tautomer.py,sha256=7eYKziGPg8Km6lfowTzSkgJfJ4SHUPrAmnTf8Bi-SB0,1164
63
64
  stjames/workflows/workflow.py,sha256=OE05pt2ZOd8TzTOlBngXCVg9wv_553ZR60VNRPlq0f8,1953
64
- stjames-0.0.82.dist-info/licenses/LICENSE,sha256=i7ehYBS-6gGmbTcgU4mgk28pyOx2kScJ0kcx8n7bWLM,1084
65
- stjames-0.0.82.dist-info/METADATA,sha256=XlFZhX7H7AFlrGq9TVBx5Ao_UMzNyr4UWAX8mdDcepA,1724
66
- stjames-0.0.82.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
67
- stjames-0.0.82.dist-info/top_level.txt,sha256=FYCwxl6quhYOAgG-mnPQcCK8vsVM7B8rIUrO-WrQ_PI,8
68
- stjames-0.0.82.dist-info/RECORD,,
65
+ stjames-0.0.84.dist-info/licenses/LICENSE,sha256=i7ehYBS-6gGmbTcgU4mgk28pyOx2kScJ0kcx8n7bWLM,1084
66
+ stjames-0.0.84.dist-info/METADATA,sha256=dEb-WmFhVPEDv3AlXVG9gy-t5Pj8Gnz_pY7ZrmEIL4g,1724
67
+ stjames-0.0.84.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
68
+ stjames-0.0.84.dist-info/top_level.txt,sha256=FYCwxl6quhYOAgG-mnPQcCK8vsVM7B8rIUrO-WrQ_PI,8
69
+ stjames-0.0.84.dist-info/RECORD,,