stjames 0.0.62__py3-none-any.whl → 0.0.64__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/molecule.py +10 -7
- stjames/pdb.py +31 -12
- stjames/workflows/docking.py +2 -1
- {stjames-0.0.62.dist-info → stjames-0.0.64.dist-info}/METADATA +1 -1
- {stjames-0.0.62.dist-info → stjames-0.0.64.dist-info}/RECORD +8 -8
- {stjames-0.0.62.dist-info → stjames-0.0.64.dist-info}/WHEEL +1 -1
- {stjames-0.0.62.dist-info → stjames-0.0.64.dist-info}/LICENSE +0 -0
- {stjames-0.0.62.dist-info → stjames-0.0.64.dist-info}/top_level.txt +0 -0
stjames/molecule.py
CHANGED
|
@@ -68,6 +68,7 @@ class Molecule(Base):
|
|
|
68
68
|
thermal_free_energy_corr: Annotated[Optional[float], AfterValidator(round_optional_float(6))] = None
|
|
69
69
|
|
|
70
70
|
smiles: Optional[str] = None
|
|
71
|
+
calculation_index: int | None = None
|
|
71
72
|
|
|
72
73
|
def __len__(self) -> int:
|
|
73
74
|
return len(self.atoms)
|
|
@@ -273,7 +274,7 @@ class Molecule(Base):
|
|
|
273
274
|
rdkm = _embed_rdkit_mol(rdkm)
|
|
274
275
|
|
|
275
276
|
atoms = []
|
|
276
|
-
atomic_numbers = [atom.GetAtomicNum() for atom in rdkm.GetAtoms()] # type: ignore [no-untyped-call]
|
|
277
|
+
atomic_numbers = [atom.GetAtomicNum() for atom in rdkm.GetAtoms()] # type: ignore [no-untyped-call, unused-ignore]
|
|
277
278
|
geom = rdkm.GetConformers()[cid].GetPositions()
|
|
278
279
|
|
|
279
280
|
for i in range(len(atomic_numbers)):
|
|
@@ -286,25 +287,27 @@ class Molecule(Base):
|
|
|
286
287
|
|
|
287
288
|
@classmethod
|
|
288
289
|
def from_smiles(cls: type[Self], smiles: str) -> Self:
|
|
289
|
-
|
|
290
|
+
rdkm = Chem.MolFromSmiles(smiles)
|
|
291
|
+
assert rdkm is not None
|
|
292
|
+
return cls.from_rdkit(rdkm)
|
|
290
293
|
|
|
291
294
|
|
|
292
295
|
def _embed_rdkit_mol(rdkm: RdkitMol) -> RdkitMol:
|
|
293
296
|
try:
|
|
294
|
-
AllChem.SanitizeMol(rdkm) # type: ignore [attr-defined]
|
|
297
|
+
AllChem.SanitizeMol(rdkm) # type: ignore [attr-defined, unused-ignore]
|
|
295
298
|
except Exception as e:
|
|
296
299
|
raise ValueError("Molecule could not be generated -- invalid chemistry!\n") from e
|
|
297
300
|
|
|
298
|
-
rdkm = AllChem.AddHs(rdkm) # type: ignore [attr-defined]
|
|
301
|
+
rdkm = AllChem.AddHs(rdkm) # type: ignore [attr-defined, unused-ignore]
|
|
299
302
|
try:
|
|
300
|
-
status1 = AllChem.EmbedMolecule(rdkm, maxAttempts=200) # type: ignore [attr-defined]
|
|
303
|
+
status1 = AllChem.EmbedMolecule(rdkm, maxAttempts=200) # type: ignore [attr-defined, unused-ignore]
|
|
301
304
|
assert status1 >= 0
|
|
302
305
|
except Exception as e:
|
|
303
|
-
status1 = AllChem.EmbedMolecule(rdkm, maxAttempts=200, useRandomCoords=True) # type: ignore [attr-defined]
|
|
306
|
+
status1 = AllChem.EmbedMolecule(rdkm, maxAttempts=200, useRandomCoords=True) # type: ignore [attr-defined, unused-ignore]
|
|
304
307
|
if status1 < 0:
|
|
305
308
|
raise ValueError(f"Cannot embed molecule! Error: {e}")
|
|
306
309
|
|
|
307
|
-
AllChem.MMFFOptimizeMolecule(rdkm, maxIters=200) # type: ignore [attr-defined]
|
|
310
|
+
AllChem.MMFFOptimizeMolecule(rdkm, maxIters=200) # type: ignore [attr-defined, call-arg, unused-ignore]
|
|
308
311
|
|
|
309
312
|
return rdkm
|
|
310
313
|
|
stjames/pdb.py
CHANGED
|
@@ -214,23 +214,42 @@ def pdb_from_mmcif_filestring(pdb: str) -> PDB:
|
|
|
214
214
|
return PDB.model_validate(mmcif_dict_to_data_dict(mmcif_string_to_mmcif_dict(pdb)))
|
|
215
215
|
|
|
216
216
|
|
|
217
|
-
def pdb_object_to_pdb_filestring(
|
|
217
|
+
def pdb_object_to_pdb_filestring(
|
|
218
|
+
pdb: PDB,
|
|
219
|
+
header: bool = False,
|
|
220
|
+
source: bool = False,
|
|
221
|
+
keyword: bool = False,
|
|
222
|
+
seqres: bool = True,
|
|
223
|
+
hetnam: bool = True,
|
|
224
|
+
remark: bool = True,
|
|
225
|
+
crystallography: bool = False,
|
|
226
|
+
) -> str:
|
|
218
227
|
pdb_lines: list[str] = []
|
|
219
228
|
chains: list[str] = []
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
229
|
+
|
|
230
|
+
if header:
|
|
231
|
+
pdb_lines.extend(_build_header_section(pdb))
|
|
232
|
+
|
|
233
|
+
if source:
|
|
234
|
+
pdb_lines.extend(_build_source_section(pdb))
|
|
235
|
+
|
|
236
|
+
if keyword:
|
|
237
|
+
pdb_lines.extend(_build_keyword_section(pdb))
|
|
224
238
|
|
|
225
239
|
full_name_dict: dict[str, str] = {}
|
|
226
240
|
seqres_lines, chains = _build_secondary_structure_and_seqres(pdb, full_name_dict)
|
|
227
241
|
|
|
228
|
-
|
|
229
|
-
|
|
242
|
+
if seqres:
|
|
243
|
+
pdb_lines.extend(seqres_lines)
|
|
244
|
+
|
|
245
|
+
if hetnam:
|
|
246
|
+
pdb_lines.extend(_build_hetname_section(full_name_dict))
|
|
230
247
|
|
|
231
|
-
|
|
248
|
+
if remark:
|
|
249
|
+
pdb_lines.extend(_build_remark_section(pdb, chains))
|
|
232
250
|
|
|
233
|
-
|
|
251
|
+
if crystallography:
|
|
252
|
+
pdb_lines.extend(_build_crystallography_section(pdb))
|
|
234
253
|
|
|
235
254
|
for model_index, model in enumerate(pdb.models, start=1):
|
|
236
255
|
# If more than one model, add MODEL line
|
|
@@ -633,11 +652,11 @@ def _build_hetname_section(full_name_dict: dict[str, str]) -> list[str]:
|
|
|
633
652
|
def _build_remark_section(pdb: PDB, chains: list[str]) -> list[str]:
|
|
634
653
|
"""Builds REMARK lines (resolution, R factors, biomolecule and missing residues)."""
|
|
635
654
|
lines = []
|
|
636
|
-
lines.append(f"REMARK 2 RESOLUTION. {pdb.quality.resolution:>7} ANGSTROMS.")
|
|
655
|
+
lines.append(f"REMARK 2 RESOLUTION. {pdb.quality.resolution or '':>7} ANGSTROMS.")
|
|
637
656
|
if pdb.quality.rfree:
|
|
638
|
-
lines.append(f"REMARK 3 FREE R VALUE : {pdb.quality.rfree}")
|
|
657
|
+
lines.append(f"REMARK 3 FREE R VALUE : {pdb.quality.rfree or ''}")
|
|
639
658
|
if pdb.quality.rvalue:
|
|
640
|
-
lines.append(f"REMARK 3 R VALUE (WORKING SET) : {pdb.quality.rvalue}")
|
|
659
|
+
lines.append(f"REMARK 3 R VALUE (WORKING SET) : {pdb.quality.rvalue or ''}")
|
|
641
660
|
|
|
642
661
|
# REMARK 350: Biomolecule details
|
|
643
662
|
lines.append("REMARK 350")
|
stjames/workflows/docking.py
CHANGED
|
@@ -39,6 +39,7 @@ class DockingWorkflow(MoleculeWorkflow):
|
|
|
39
39
|
:param smiles: SMILES strings of the ligands (optional)
|
|
40
40
|
:param do_csearch: whether to csearch starting structures
|
|
41
41
|
:param do_optimization: whether to optimize starting structures
|
|
42
|
+
:param do_pose_refinement: whether to optimize non-rotatable bonds in output poses
|
|
42
43
|
:param conformers: UUIDs of optimized conformers
|
|
43
44
|
:param target: PDB of the protein.
|
|
44
45
|
:param target_uuid: UUID of the protein.
|
|
@@ -58,7 +59,7 @@ class DockingWorkflow(MoleculeWorkflow):
|
|
|
58
59
|
target_uuid: UUID | None = None
|
|
59
60
|
pocket: tuple[Vector3D, Vector3D]
|
|
60
61
|
|
|
61
|
-
|
|
62
|
+
do_pose_refinement: bool = True
|
|
62
63
|
scores: list[Score] = []
|
|
63
64
|
|
|
64
65
|
def __str__(self) -> str:
|
|
@@ -13,9 +13,9 @@ stjames/int_settings.py,sha256=5HXp8opt5ZyY1UpmfaK7NVloWVLM5jkG0elEEqpVLUo,896
|
|
|
13
13
|
stjames/message.py,sha256=Rq6QqmHZKecWxYH8fVyXmuoCCPZv8YinvgykSeorXSU,216
|
|
14
14
|
stjames/method.py,sha256=5hBHk2xQLpxZ52LwJ9FHWaqQMdFKnsbQEOxaVe6O4Go,2321
|
|
15
15
|
stjames/mode.py,sha256=xw46Cc7f3eTS8i35qECi-8DocAlANhayK3w4akD4HBU,496
|
|
16
|
-
stjames/molecule.py,sha256=
|
|
16
|
+
stjames/molecule.py,sha256=2BRXYKtkm5ztYiywyC2S__Zu4a-QoDEgb7LR7F4xHvs,14268
|
|
17
17
|
stjames/opt_settings.py,sha256=gxXGtjy9l-Q5Wen9eO6T6HHRCuS8rfOofdVQIJj0JcI,550
|
|
18
|
-
stjames/pdb.py,sha256
|
|
18
|
+
stjames/pdb.py,sha256=-i0H029NEX-pcyCqdVyq7D62ZDvmUPWK7l83WdoDmpk,25759
|
|
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
|
|
@@ -44,7 +44,7 @@ stjames/workflows/bde.py,sha256=hdTjwma5L9SrU5F5r6dB1ruB_B6buBUtZHf2sanNW2k,9802
|
|
|
44
44
|
stjames/workflows/conformer.py,sha256=18aO6ngMBeGAmQkBdLGCCHr398RIYr1v2hD2IT1u4cc,3005
|
|
45
45
|
stjames/workflows/conformer_search.py,sha256=4yPEKIIedeaVvaAwgjwC1FxiHqM6n2zOF6c9Yk_q1oA,13513
|
|
46
46
|
stjames/workflows/descriptors.py,sha256=T4tc7xdtBdxESGO86KR323jPQ2pgwxBqgV0khA6MEgQ,584
|
|
47
|
-
stjames/workflows/docking.py,sha256=
|
|
47
|
+
stjames/workflows/docking.py,sha256=GCW_-JeEZcMXKZ9EQFOxWUYRo0jsbzwIv10aSz8KuaQ,3027
|
|
48
48
|
stjames/workflows/electronic_properties.py,sha256=GT3-NC7w-dbcOJ-3AzJ7LgzH6frTbiH2Iyb9BCa-SvY,4112
|
|
49
49
|
stjames/workflows/fukui.py,sha256=e7CF7Mp2Dt1JTipQx-Sz_37W1urL-iRpjXY-9ItSvhM,1268
|
|
50
50
|
stjames/workflows/hydrogen_bond_basicity.py,sha256=XDpHEluw6DQ9Zk5g2Je2a81HqIkqPglZ-6f2YZnd4Bc,1159
|
|
@@ -58,8 +58,8 @@ stjames/workflows/solubility.py,sha256=kGfVyPPGDLRpf2j6dSY7woCkfsoXSbUzdSImA4mcM
|
|
|
58
58
|
stjames/workflows/spin_states.py,sha256=0degmE-frovgoXweshZyjfjqL7nkbaFoO9YoJhvQnaI,4748
|
|
59
59
|
stjames/workflows/tautomer.py,sha256=7eYKziGPg8Km6lfowTzSkgJfJ4SHUPrAmnTf8Bi-SB0,1164
|
|
60
60
|
stjames/workflows/workflow.py,sha256=sk2BUz59wdIkT_EyKOnMt5woNrjo3aHVK38cU8x8I7Q,1423
|
|
61
|
-
stjames-0.0.
|
|
62
|
-
stjames-0.0.
|
|
63
|
-
stjames-0.0.
|
|
64
|
-
stjames-0.0.
|
|
65
|
-
stjames-0.0.
|
|
61
|
+
stjames-0.0.64.dist-info/LICENSE,sha256=i7ehYBS-6gGmbTcgU4mgk28pyOx2kScJ0kcx8n7bWLM,1084
|
|
62
|
+
stjames-0.0.64.dist-info/METADATA,sha256=33n-Ix3Rfcue2dKm4SUqmWow8MeXv1_SF6UcpfOPYiQ,1672
|
|
63
|
+
stjames-0.0.64.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
|
|
64
|
+
stjames-0.0.64.dist-info/top_level.txt,sha256=FYCwxl6quhYOAgG-mnPQcCK8vsVM7B8rIUrO-WrQ_PI,8
|
|
65
|
+
stjames-0.0.64.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|