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

@@ -9,9 +9,10 @@ from ..base import LowercaseStrEnum
9
9
  from ..constraint import Constraint
10
10
  from ..method import Method, XTBMethod
11
11
  from ..mode import Mode
12
+ from ..molecule import Molecule
12
13
  from ..types import UUID, FloatPerAtom, round_float_per_atom
13
14
  from .multistage_opt import MultiStageOptMixin
14
- from .workflow import MoleculeWorkflow
15
+ from .workflow import MoleculeWorkflow, SMILESWorkflow
15
16
 
16
17
  _sentinel = object()
17
18
 
@@ -377,12 +378,16 @@ class ConformerSearchMixin(ConformerGenMixin, MultiStageOptMixin):
377
378
  return self
378
379
 
379
380
 
380
- class ConformerSearchWorkflow(ConformerSearchMixin, MoleculeWorkflow):
381
+ class ConformerSearchWorkflow(ConformerSearchMixin, SMILESWorkflow, MoleculeWorkflow):
381
382
  """
382
383
  ConformerSearch Workflow.
383
384
 
385
+ This workflow supports both SMILES and 3D molecular input. Some conformer generation settings
386
+ support both methods; others (like CREST) require 3D information. Only one should be supplied.
387
+
384
388
  Inherited:
385
389
  :param initial_molecule: Molecule of interest
390
+ :param initial_smiles: SMILES of the molecule of interest
386
391
  :param conf_gen_mode: Mode for calculations
387
392
  :param conf_gen_settings: settings for conformer generation
388
393
  :param mso_mode: Mode for MultiStageOptSettings
@@ -401,6 +406,21 @@ class ConformerSearchWorkflow(ConformerSearchMixin, MoleculeWorkflow):
401
406
  :param energies: energies of the molecules
402
407
  """
403
408
 
409
+ initial_smiles: str = ""
410
+ initial_molecule: Molecule | None = None # type: ignore [assignment]
411
+
404
412
  # Results
405
413
  conformer_uuids: list[list[UUID | None]] = Field(default_factory=list)
406
414
  energies: Annotated[FloatPerAtom, AfterValidator(round_float_per_atom(6))] = Field(default_factory=list)
415
+
416
+ @model_validator(mode="after")
417
+ def validate_mol_input(self) -> Self:
418
+ """Ensure that only one of initial_molecule or initial_smiles is set."""
419
+
420
+ if not (bool(self.initial_smiles) ^ bool(self.initial_molecule)):
421
+ raise ValueError("Can only set one of initial_molecule and initial_smiles")
422
+
423
+ if isinstance(self.conf_gen_settings, iMTDSettings) and (self.initial_molecule is None):
424
+ raise ValueError("iMTDSettings requires `initial_molecule` to be set")
425
+
426
+ return self
@@ -1,6 +1,6 @@
1
1
  """Docking workflow."""
2
2
 
3
- from typing import Annotated, Self, TypeAlias
3
+ from typing import Annotated, Literal, Self, TypeAlias
4
4
 
5
5
  from pydantic import AfterValidator, ConfigDict, field_validator, model_validator
6
6
 
@@ -46,12 +46,23 @@ class VinaSettings(DockingSettings):
46
46
  """
47
47
  Controls how AutoDock Vina is run.
48
48
 
49
+ :param executable: which Vina implementation is run.
50
+ :param scoring_function: which scoring function is employed.
49
51
  :param exhaustiveness: how many times Vina attempts to find a pose.
50
52
  8 is typical, 32 is considered relatively careful.
51
53
  """
52
54
 
55
+ executable: Literal["qvina2", "vina"] = "vina"
56
+ scoring_function: Literal["vinardo", "vina"] = "vinardo"
53
57
  exhaustiveness: int = 8
54
58
 
59
+ @model_validator(mode="after")
60
+ def check_executable_scoring_function(self) -> Self:
61
+ """Check if the combination of exectuable and scoring function is supported."""
62
+ if (self.executable == "qvina2") and (self.scoring_function == "vinardo"):
63
+ raise ValueError("qvina2 does not implement the vinardo scoring function!")
64
+ return self
65
+
55
66
 
56
67
  class DockingWorkflow(MoleculeWorkflow):
57
68
  """
@@ -76,8 +76,8 @@ class PoseAnalysisMolecularDynamicsWorkflow(SMILESWorkflow):
76
76
  protein_uuid: UUID | None = None
77
77
  ligand_residue_name: str = "LIG"
78
78
 
79
- num_trajectories: PositiveInt = 4
80
- equilibration_time_ns: Annotated[PositiveFloat, AfterValidator(round_float(3))] = 5
79
+ num_trajectories: PositiveInt = 1
80
+ equilibration_time_ns: Annotated[PositiveFloat, AfterValidator(round_float(3))] = 1
81
81
  simulation_time_ns: Annotated[PositiveFloat, AfterValidator(round_float(3))] = 10
82
82
 
83
83
  temperature: Annotated[PositiveFloat, AfterValidator(round_float(3))] = 300
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: stjames
3
- Version: 0.0.115
3
+ Version: 0.0.116
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
@@ -42,9 +42,9 @@ stjames/workflows/admet.py,sha256=qFUpCFiLW-3gzuEjCMNBJ6DEG_vquJcPAsN4SVZRfdE,12
42
42
  stjames/workflows/basic_calculation.py,sha256=sAgHBcNHE72ZbZPB9vyZShALRC4zOVw6It6cpJlbX2A,911
43
43
  stjames/workflows/bde.py,sha256=g_In-caftXiimrhfdptHjpfrYQUs3vF58qYmRnaTN8g,10825
44
44
  stjames/workflows/conformer.py,sha256=18aO6ngMBeGAmQkBdLGCCHr398RIYr1v2hD2IT1u4cc,3005
45
- stjames/workflows/conformer_search.py,sha256=sQayHL5aGY8WssQOGW4lPh1aXLfcPJewG9WUiC8il6A,14744
45
+ stjames/workflows/conformer_search.py,sha256=1kBUT0yCcTPTCtxg1tlTKHRRXkfNYNqzla_89lDEL9k,15696
46
46
  stjames/workflows/descriptors.py,sha256=T4tc7xdtBdxESGO86KR323jPQ2pgwxBqgV0khA6MEgQ,584
47
- stjames/workflows/docking.py,sha256=sJFSGyIve-q55UEir2rV9Pk7L09_pPuSy2K00JLvA68,4138
47
+ stjames/workflows/docking.py,sha256=t30kqeFXQ0yrlqvN6Jdwt0SdfnJLDsfK-7yFi0gwNbY,4753
48
48
  stjames/workflows/double_ended_ts_search.py,sha256=ovJgEVFc6c3mijCE3TKAY70YvqNmAZ5Y4XgV4-tIxBI,3127
49
49
  stjames/workflows/electronic_properties.py,sha256=GT3-NC7w-dbcOJ-3AzJ7LgzH6frTbiH2Iyb9BCa-SvY,4112
50
50
  stjames/workflows/fukui.py,sha256=095GDGSSEc5PDD1aoKM8J7icgR5tfwS5Bs9XxFQHge4,2387
@@ -56,7 +56,7 @@ stjames/workflows/molecular_dynamics.py,sha256=HqWNxxPSAphfI0DdbTERFkq8UeBjEvhnA
56
56
  stjames/workflows/multistage_opt.py,sha256=UN-4WLsT2WEjO5KqDPrcCkb708Co-ZScHx3g2bto768,16597
57
57
  stjames/workflows/nmr.py,sha256=1QEF4SB6dWIr-jzLEZ7V972UnRUOTufOJSHwIGyV3dM,2681
58
58
  stjames/workflows/pka.py,sha256=i-jzl2lN0yRWc0tgrWSBCplITEByfRyEQrlUhjnzcBc,4580
59
- stjames/workflows/pose_analysis_md.py,sha256=KLxSSuM60UpVawDI2xTvsMXoLHFIlA2CtVbpD0uePF4,4803
59
+ stjames/workflows/pose_analysis_md.py,sha256=dpWVKC-8fPdw6ExIXk9xbeVBDUMUYQECpixb-oFa23I,4803
60
60
  stjames/workflows/protein_cofolding.py,sha256=cN0WUh8trrWwzNvoU75hB-VectIer-g5sMKgibQJcfE,4293
61
61
  stjames/workflows/redox_potential.py,sha256=7S18t9Y3eynSnA3lZbRlvLfdbgeBopdiigLzt1zxg5c,3871
62
62
  stjames/workflows/scan.py,sha256=DXQBpa2t2PowAtOwmdgpxaSLq--fEShljzAGSb8Nf5U,2993
@@ -65,8 +65,8 @@ stjames/workflows/spin_states.py,sha256=0degmE-frovgoXweshZyjfjqL7nkbaFoO9YoJhvQ
65
65
  stjames/workflows/strain.py,sha256=paYxDDQTB1eYP_c2kLVz1-QX7Vpw0LLb3ujnFin_SOM,1834
66
66
  stjames/workflows/tautomer.py,sha256=7eYKziGPg8Km6lfowTzSkgJfJ4SHUPrAmnTf8Bi-SB0,1164
67
67
  stjames/workflows/workflow.py,sha256=OE05pt2ZOd8TzTOlBngXCVg9wv_553ZR60VNRPlq0f8,1953
68
- stjames-0.0.115.dist-info/licenses/LICENSE,sha256=i05z7xEhyrg6f8j0lR3XYjShnF-MJGFQ-DnpsZ8yiVI,1084
69
- stjames-0.0.115.dist-info/METADATA,sha256=SXjEZ5InRPFPo1QtWBhil1BqW-YIjY9b-xH8pt1F-3Y,1725
70
- stjames-0.0.115.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
71
- stjames-0.0.115.dist-info/top_level.txt,sha256=FYCwxl6quhYOAgG-mnPQcCK8vsVM7B8rIUrO-WrQ_PI,8
72
- stjames-0.0.115.dist-info/RECORD,,
68
+ stjames-0.0.116.dist-info/licenses/LICENSE,sha256=i05z7xEhyrg6f8j0lR3XYjShnF-MJGFQ-DnpsZ8yiVI,1084
69
+ stjames-0.0.116.dist-info/METADATA,sha256=IbTEKrb49Z5vD7QdSV412MBQQH4Yv2uSftLO2IoObzY,1725
70
+ stjames-0.0.116.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
71
+ stjames-0.0.116.dist-info/top_level.txt,sha256=FYCwxl6quhYOAgG-mnPQcCK8vsVM7B8rIUrO-WrQ_PI,8
72
+ stjames-0.0.116.dist-info/RECORD,,