stjames 0.0.83__tar.gz → 0.0.85__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.

Files changed (80) hide show
  1. {stjames-0.0.83/stjames.egg-info → stjames-0.0.85}/PKG-INFO +1 -1
  2. {stjames-0.0.83 → stjames-0.0.85}/pyproject.toml +1 -1
  3. {stjames-0.0.83 → stjames-0.0.85}/stjames/method.py +3 -2
  4. {stjames-0.0.83 → stjames-0.0.85}/stjames/pdb.py +1 -1
  5. {stjames-0.0.83 → stjames-0.0.85}/stjames/workflows/__init__.py +4 -1
  6. stjames-0.0.85/stjames/workflows/pose_analysis_md.py +104 -0
  7. {stjames-0.0.83 → stjames-0.0.85/stjames.egg-info}/PKG-INFO +1 -1
  8. {stjames-0.0.83 → stjames-0.0.85}/stjames.egg-info/SOURCES.txt +1 -0
  9. {stjames-0.0.83 → stjames-0.0.85}/tests/test_pdb.py +16 -4
  10. {stjames-0.0.83 → stjames-0.0.85}/LICENSE +0 -0
  11. {stjames-0.0.83 → stjames-0.0.85}/README.md +0 -0
  12. {stjames-0.0.83 → stjames-0.0.85}/setup.cfg +0 -0
  13. {stjames-0.0.83 → stjames-0.0.85}/stjames/__init__.py +0 -0
  14. {stjames-0.0.83 → stjames-0.0.85}/stjames/_deprecated_solvent_settings.py +0 -0
  15. {stjames-0.0.83 → stjames-0.0.85}/stjames/atom.py +0 -0
  16. {stjames-0.0.83 → stjames-0.0.85}/stjames/atomium_stjames/__init__.py +0 -0
  17. {stjames-0.0.83 → stjames-0.0.85}/stjames/atomium_stjames/data.py +0 -0
  18. {stjames-0.0.83 → stjames-0.0.85}/stjames/atomium_stjames/mmcif.py +0 -0
  19. {stjames-0.0.83 → stjames-0.0.85}/stjames/atomium_stjames/pdb.py +0 -0
  20. {stjames-0.0.83 → stjames-0.0.85}/stjames/atomium_stjames/utilities.py +0 -0
  21. {stjames-0.0.83 → stjames-0.0.85}/stjames/base.py +0 -0
  22. {stjames-0.0.83 → stjames-0.0.85}/stjames/basis_set.py +0 -0
  23. {stjames-0.0.83 → stjames-0.0.85}/stjames/calculation.py +0 -0
  24. {stjames-0.0.83 → stjames-0.0.85}/stjames/compute_settings.py +0 -0
  25. {stjames-0.0.83 → stjames-0.0.85}/stjames/constraint.py +0 -0
  26. {stjames-0.0.83 → stjames-0.0.85}/stjames/correction.py +0 -0
  27. {stjames-0.0.83 → stjames-0.0.85}/stjames/data/__init__.py +0 -0
  28. {stjames-0.0.83 → stjames-0.0.85}/stjames/data/bragg_radii.json +0 -0
  29. {stjames-0.0.83 → stjames-0.0.85}/stjames/data/elements.py +0 -0
  30. {stjames-0.0.83 → stjames-0.0.85}/stjames/data/isotopes.json +0 -0
  31. {stjames-0.0.83 → stjames-0.0.85}/stjames/data/nist_isotopes.json +0 -0
  32. {stjames-0.0.83 → stjames-0.0.85}/stjames/data/read_nist_isotopes.py +0 -0
  33. {stjames-0.0.83 → stjames-0.0.85}/stjames/data/symbol_element.json +0 -0
  34. {stjames-0.0.83 → stjames-0.0.85}/stjames/diis_settings.py +0 -0
  35. {stjames-0.0.83 → stjames-0.0.85}/stjames/grid_settings.py +0 -0
  36. {stjames-0.0.83 → stjames-0.0.85}/stjames/int_settings.py +0 -0
  37. {stjames-0.0.83 → stjames-0.0.85}/stjames/message.py +0 -0
  38. {stjames-0.0.83 → stjames-0.0.85}/stjames/mode.py +0 -0
  39. {stjames-0.0.83 → stjames-0.0.85}/stjames/molecule.py +0 -0
  40. {stjames-0.0.83 → stjames-0.0.85}/stjames/opt_settings.py +0 -0
  41. {stjames-0.0.83 → stjames-0.0.85}/stjames/periodic_cell.py +0 -0
  42. {stjames-0.0.83 → stjames-0.0.85}/stjames/py.typed +0 -0
  43. {stjames-0.0.83 → stjames-0.0.85}/stjames/scf_settings.py +0 -0
  44. {stjames-0.0.83 → stjames-0.0.85}/stjames/settings.py +0 -0
  45. {stjames-0.0.83 → stjames-0.0.85}/stjames/solvent.py +0 -0
  46. {stjames-0.0.83 → stjames-0.0.85}/stjames/status.py +0 -0
  47. {stjames-0.0.83 → stjames-0.0.85}/stjames/task.py +0 -0
  48. {stjames-0.0.83 → stjames-0.0.85}/stjames/thermochem_settings.py +0 -0
  49. {stjames-0.0.83 → stjames-0.0.85}/stjames/types.py +0 -0
  50. {stjames-0.0.83 → stjames-0.0.85}/stjames/workflows/admet.py +0 -0
  51. {stjames-0.0.83 → stjames-0.0.85}/stjames/workflows/basic_calculation.py +0 -0
  52. {stjames-0.0.83 → stjames-0.0.85}/stjames/workflows/bde.py +0 -0
  53. {stjames-0.0.83 → stjames-0.0.85}/stjames/workflows/conformer.py +0 -0
  54. {stjames-0.0.83 → stjames-0.0.85}/stjames/workflows/conformer_search.py +0 -0
  55. {stjames-0.0.83 → stjames-0.0.85}/stjames/workflows/descriptors.py +0 -0
  56. {stjames-0.0.83 → stjames-0.0.85}/stjames/workflows/docking.py +0 -0
  57. {stjames-0.0.83 → stjames-0.0.85}/stjames/workflows/electronic_properties.py +0 -0
  58. {stjames-0.0.83 → stjames-0.0.85}/stjames/workflows/fukui.py +0 -0
  59. {stjames-0.0.83 → stjames-0.0.85}/stjames/workflows/hydrogen_bond_basicity.py +0 -0
  60. {stjames-0.0.83 → stjames-0.0.85}/stjames/workflows/ion_mobility.py +0 -0
  61. {stjames-0.0.83 → stjames-0.0.85}/stjames/workflows/irc.py +0 -0
  62. {stjames-0.0.83 → stjames-0.0.85}/stjames/workflows/macropka.py +0 -0
  63. {stjames-0.0.83 → stjames-0.0.85}/stjames/workflows/molecular_dynamics.py +0 -0
  64. {stjames-0.0.83 → stjames-0.0.85}/stjames/workflows/multistage_opt.py +0 -0
  65. {stjames-0.0.83 → stjames-0.0.85}/stjames/workflows/pka.py +0 -0
  66. {stjames-0.0.83 → stjames-0.0.85}/stjames/workflows/protein_cofolding.py +0 -0
  67. {stjames-0.0.83 → stjames-0.0.85}/stjames/workflows/redox_potential.py +0 -0
  68. {stjames-0.0.83 → stjames-0.0.85}/stjames/workflows/scan.py +0 -0
  69. {stjames-0.0.83 → stjames-0.0.85}/stjames/workflows/solubility.py +0 -0
  70. {stjames-0.0.83 → stjames-0.0.85}/stjames/workflows/spin_states.py +0 -0
  71. {stjames-0.0.83 → stjames-0.0.85}/stjames/workflows/tautomer.py +0 -0
  72. {stjames-0.0.83 → stjames-0.0.85}/stjames/workflows/workflow.py +0 -0
  73. {stjames-0.0.83 → stjames-0.0.85}/stjames.egg-info/dependency_links.txt +0 -0
  74. {stjames-0.0.83 → stjames-0.0.85}/stjames.egg-info/requires.txt +0 -0
  75. {stjames-0.0.83 → stjames-0.0.85}/stjames.egg-info/top_level.txt +0 -0
  76. {stjames-0.0.83 → stjames-0.0.85}/tests/test_constraints.py +0 -0
  77. {stjames-0.0.83 → stjames-0.0.85}/tests/test_from_extxyz.py +0 -0
  78. {stjames-0.0.83 → stjames-0.0.85}/tests/test_molecule.py +0 -0
  79. {stjames-0.0.83 → stjames-0.0.85}/tests/test_rounding.py +0 -0
  80. {stjames-0.0.83 → stjames-0.0.85}/tests/test_settings.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: stjames
3
- Version: 0.0.83
3
+ Version: 0.0.85
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
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "stjames"
3
- version = "0.0.83"
3
+ version = "0.0.85"
4
4
  description = "standardized JSON atom/molecule encoding scheme"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
@@ -43,6 +43,7 @@ class Method(LowercaseStrEnum):
43
43
  GFN0_XTB = "gfn0_xtb"
44
44
  GFN1_XTB = "gfn1_xtb"
45
45
  GFN2_XTB = "gfn2_xtb"
46
+ G_XTB = "g_xtb"
46
47
 
47
48
  # this was going to be removed, but Jonathon wrote such a nice basis set test... it's off the front end.
48
49
  BP86 = "bp86"
@@ -86,8 +87,8 @@ CORRECTABLE_NNP_METHODS = [Method.MACE_MP_0B2_L, Method.ORB_V2]
86
87
  NNPMethod = PrepackagedNNPMethod | CorrectableNNPMethod
87
88
  NNP_METHODS = [*PREPACKAGED_NNP_METHODS, *CORRECTABLE_NNP_METHODS]
88
89
 
89
- XTBMethod = Literal[Method.GFN_FF, Method.GFN0_XTB, Method.GFN1_XTB, Method.GFN2_XTB]
90
- XTB_METHODS = [Method.GFN_FF, Method.GFN0_XTB, Method.GFN1_XTB, Method.GFN2_XTB]
90
+ XTBMethod = Literal[Method.GFN_FF, Method.GFN0_XTB, Method.GFN1_XTB, Method.GFN2_XTB, Method.G_XTB]
91
+ XTB_METHODS = [Method.GFN_FF, Method.GFN0_XTB, Method.GFN1_XTB, Method.GFN2_XTB, Method.G_XTB]
91
92
 
92
93
  CompositeMethod = Literal[Method.HF3C, Method.B973C, Method.R2SCAN3C, Method.WB97X3C]
93
94
  COMPOSITE_METHODS = [Method.HF3C, Method.B973C, Method.R2SCAN3C, Method.WB97X3C]
@@ -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
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: stjames
3
- Version: 0.0.83
3
+ Version: 0.0.85
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
@@ -62,6 +62,7 @@ stjames/workflows/macropka.py
62
62
  stjames/workflows/molecular_dynamics.py
63
63
  stjames/workflows/multistage_opt.py
64
64
  stjames/workflows/pka.py
65
+ stjames/workflows/pose_analysis_md.py
65
66
  stjames/workflows/protein_cofolding.py
66
67
  stjames/workflows/redox_potential.py
67
68
  stjames/workflows/scan.py
@@ -37,6 +37,17 @@ def test_read_pdb_filestring() -> None:
37
37
  PDB.model_validate(json)
38
38
 
39
39
 
40
+ def test_read_pdb_filestring_mome() -> None:
41
+ """Rest reading of a pdb string."""
42
+ with open("tests/data/cluster_1.pdb") as f:
43
+ data = f.read()
44
+ pdb = pdb_from_pdb_filestring(data)
45
+
46
+ json = pdb.model_dump()
47
+ print(json)
48
+ PDB.model_validate(json)
49
+
50
+
40
51
  def test_read_mmcif_filestring() -> None:
41
52
  """Rest reading of a mmcif string."""
42
53
  with open("tests/data/1ema.cif") as f:
@@ -85,7 +96,9 @@ def test_from_pdb_to_pdb_2qto() -> None:
85
96
  filestring = pdb_object_to_pdb_filestring(pdb, header=True, source=True, keyword=True, crystallography=True)
86
97
  pdb2 = pdb_from_pdb_filestring(filestring)
87
98
 
88
- assert pdb == pdb2
99
+ assert pdb.description == pdb2.description
100
+ assert pdb.experiment == pdb2.experiment
101
+ assert pdb.models == pdb2.models
89
102
 
90
103
  def test_from_pdb_to_pdb_1ema() -> None:
91
104
  with open("tests/data/1ema.pdb") as f:
@@ -94,7 +107,8 @@ def test_from_pdb_to_pdb_1ema() -> None:
94
107
  filestring = pdb_object_to_pdb_filestring(pdb, header=True, source=True, keyword=True, crystallography=True)
95
108
  pdb2 = pdb_from_pdb_filestring(filestring)
96
109
 
97
- assert pdb == pdb2
110
+ assert pdb.description == pdb2.description
111
+ assert pdb.models == pdb2.models
98
112
 
99
113
  def test_from_pdb_to_pdb_2hu4() -> None:
100
114
  with open("tests/data/2HU4.pdb") as f:
@@ -105,11 +119,9 @@ def test_from_pdb_to_pdb_2hu4() -> None:
105
119
  pdb2 = pdb_from_pdb_filestring(filestring)
106
120
 
107
121
  assert pdb.description == pdb2.description
108
- assert pdb.experiment == pdb2.experiment
109
122
  # not true but doesn't matter
110
123
  print(pdb.geometry == pdb2.geometry)
111
124
  assert pdb.models == pdb2.models
112
- assert pdb.quality == pdb2.quality
113
125
 
114
126
  def mmcif_author_format_to_pdb_format(authors: list[str]) -> list[str]:
115
127
  return [f"{last.upper()}{first.upper()}" for first, last in
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