rdworks 0.40.2__py3-none-any.whl → 0.42.1__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.
- rdworks/__init__.py +1 -1
- rdworks/conf.py +9 -2
- rdworks/torsion.py +13 -7
- {rdworks-0.40.2.dist-info → rdworks-0.42.1.dist-info}/METADATA +1 -1
- {rdworks-0.40.2.dist-info → rdworks-0.42.1.dist-info}/RECORD +8 -8
- {rdworks-0.40.2.dist-info → rdworks-0.42.1.dist-info}/WHEEL +0 -0
- {rdworks-0.40.2.dist-info → rdworks-0.42.1.dist-info}/licenses/LICENSE +0 -0
- {rdworks-0.40.2.dist-info → rdworks-0.42.1.dist-info}/top_level.txt +0 -0
rdworks/__init__.py
CHANGED
rdworks/conf.py
CHANGED
@@ -27,12 +27,17 @@ from rdworks.display import render_png, render_svg
|
|
27
27
|
class Conf:
|
28
28
|
"""Container for 3D conformers."""
|
29
29
|
|
30
|
-
def __init__(self,
|
30
|
+
def __init__(self,
|
31
|
+
molecule: str | Chem.Mol | None = None,
|
32
|
+
name: str = '',
|
33
|
+
compressed: bool = False) -> None:
|
31
34
|
"""Initialize.
|
32
35
|
|
33
36
|
Args:
|
34
37
|
molecule (Chem.Mol | MolBlock string): Molecule for 3D conformer.
|
35
38
|
name (str): Name prefix of the generated conformers. Defaults to ''.
|
39
|
+
compressed (bool): whether the MolBlock string is compressed or not.
|
40
|
+
Defaults to False.
|
36
41
|
|
37
42
|
Raises:
|
38
43
|
ValueError: if `molecule` is not rdkit.Chem.Mol object.
|
@@ -59,6 +64,8 @@ class Conf:
|
|
59
64
|
return
|
60
65
|
|
61
66
|
if isinstance(molecule, str): # 3-D MolBLock string
|
67
|
+
if compressed:
|
68
|
+
molecule = decompress_string(molecule)
|
62
69
|
try:
|
63
70
|
self.rdmol = Chem.MolFromMolBlock(molecule,
|
64
71
|
sanitize=False,
|
@@ -446,7 +453,7 @@ class Conf:
|
|
446
453
|
}
|
447
454
|
|
448
455
|
if simplify:
|
449
|
-
frag, frag_ijkl = create_torsion_fragment(ref_conf.rdmol, indices)
|
456
|
+
(frag, frag_ijkl, frag_created, wbo_filtered) = create_torsion_fragment(ref_conf.rdmol, indices)
|
450
457
|
frag_conf = Conf(frag)
|
451
458
|
for angle in np.arange(-180.0, 180.0, interval):
|
452
459
|
# Iterated numpy.ndarray does not contain the last 180: -180., ..., (180).
|
rdworks/torsion.py
CHANGED
@@ -426,7 +426,7 @@ def create_fragment_on_bonds(rdmol: Chem.Mol, bonds: dict, cap: bool = True) ->
|
|
426
426
|
|
427
427
|
def create_torsion_fragment(rdmol: Chem.Mol,
|
428
428
|
torsion_indices: tuple,
|
429
|
-
wbo_tolerance: float = 0.03) -> tuple[Chem.Mol, list[int]]:
|
429
|
+
wbo_tolerance: float = 0.03) -> tuple[Chem.Mol, list[int], bool, bool]:
|
430
430
|
"""Create a close surrogate fragment that captures the PES of the intended torsion.
|
431
431
|
|
432
432
|
Fragmentation aims to preserve the local chemical environment around the targeted torsion
|
@@ -443,7 +443,10 @@ def create_torsion_fragment(rdmol: Chem.Mol,
|
|
443
443
|
torsion_indices (tuple): (i, j, k, l, atoms to be rotated, atoms to be fixed)
|
444
444
|
|
445
445
|
Returns:
|
446
|
-
Chem.Mol:
|
446
|
+
(Chem.Mol: fragment molecule,
|
447
|
+
list[int]: fragment indices,
|
448
|
+
bool: True if fragmented,
|
449
|
+
bool: True if WBO filtering is used)
|
447
450
|
|
448
451
|
References:
|
449
452
|
https://pubs.acs.org/doi/10.1021/acs.jcim.2c01153
|
@@ -455,8 +458,10 @@ def create_torsion_fragment(rdmol: Chem.Mol,
|
|
455
458
|
|
456
459
|
if not candidates:
|
457
460
|
# no fragmentation
|
458
|
-
return rdmol, torsion_indices
|
459
|
-
|
461
|
+
return (rdmol, torsion_indices, False, False)
|
462
|
+
|
463
|
+
# fragmented
|
464
|
+
WBO_filtered = False
|
460
465
|
if GFN2xTB().version() is not None:
|
461
466
|
# filter candidate(s) by Wiberg bond order (WBO) if xTB is available
|
462
467
|
jk = tuple(sorted([j, k]))
|
@@ -472,11 +477,12 @@ def create_torsion_fragment(rdmol: Chem.Mol,
|
|
472
477
|
frag_jk = tuple(sorted(frag_jk))
|
473
478
|
if abs(fragment.wbo[frag_jk] - parent.wbo[jk]) < wbo_tolerance:
|
474
479
|
wbo_passed_candidates[bond_idx] = (p, q)
|
475
|
-
frag_multi_breaks = create_fragment_on_bonds(rdmol, wbo_passed_candidates)
|
480
|
+
frag_multi_breaks = create_fragment_on_bonds(rdmol, wbo_passed_candidates)
|
481
|
+
WBO_filtered = True
|
476
482
|
else:
|
477
483
|
# skip WBO filtering
|
478
484
|
frag_multi_breaks = create_fragment_on_bonds(rdmol, candidates)
|
479
485
|
|
480
|
-
|
486
|
+
frag_indices = get_fragment_idx(rdmol, (i, j, k, l), frag_multi_breaks)
|
481
487
|
|
482
|
-
return frag_multi_breaks,
|
488
|
+
return (frag_multi_breaks, frag_indices, True, WBO_filtered)
|
@@ -1,5 +1,5 @@
|
|
1
|
-
rdworks/__init__.py,sha256=
|
2
|
-
rdworks/conf.py,sha256=
|
1
|
+
rdworks/__init__.py,sha256=7OkViRiczFQfW5O29ls7ozHiJrbVoYudKHxplgQ8Wmo,1368
|
2
|
+
rdworks/conf.py,sha256=wSAffrHMbZW55gh8Dahz4ZkusUN_DlD_ieiVHFKVdXY,31348
|
3
3
|
rdworks/descriptor.py,sha256=34T_dQ6g8v3u-ym8TLKbQtxIIV5TEo-d3pdedq3o-cg,2106
|
4
4
|
rdworks/display.py,sha256=JR0gR26UpH-JCxVOaqXZCUj2MiGZSrx9Me87FncspVI,13469
|
5
5
|
rdworks/ionized.py,sha256=5oIjMRpkX792RIpEEE2Ir96icfFaN_h21mSihhfQPAw,6713
|
@@ -14,7 +14,7 @@ rdworks/std.py,sha256=qOVS_lGogueLKh4rsbrsYIMR0c7z_xh6BqLEzD4X9sE,7938
|
|
14
14
|
rdworks/stereoisomers.py,sha256=g8hhPI-mbYX-MzbF1uAqo5fDZOCNiKYjxI-kLBGdGgg,4980
|
15
15
|
rdworks/tautomers.py,sha256=gtZHZJ-aJbryhBdljHbfjx7xhVW3u_OzdYPtwPail54,610
|
16
16
|
rdworks/testdata.py,sha256=TmbNPA-ju6nTBt_Yts4EJUFmL9Cd6DCVXrDF42QLlHw,1732
|
17
|
-
rdworks/torsion.py,sha256=
|
17
|
+
rdworks/torsion.py,sha256=7xlOUYXmBSkjPuNxGXNF-F3G9XWO2ER15xGOY0ejpcc,18801
|
18
18
|
rdworks/units.py,sha256=nljKPHcr6IWoAp0CkL7y1gSNDd6a07NeVfxXwSMuHQM,365
|
19
19
|
rdworks/utils.py,sha256=d2Sio8WTlGPsmBOHIYDCMWg_7X4rTWjJQAqzd7ywo2A,14191
|
20
20
|
rdworks/xml.py,sha256=aaMhwVRGvt1VzasaKDnkYnZ4kp2cIgvGb1CsmMgwQ_c,10704
|
@@ -66,8 +66,8 @@ rdworks/predefined/misc/reactive-part-3.xml,sha256=LgWHSEbRTVmgBoIO45xbTo1xQJs0X
|
|
66
66
|
rdworks/predefined/misc/reactive.xml,sha256=syedoQ6VYUfRLnxy99ObuDniJ_a_WhrWAJbTKFfJ6VY,11248
|
67
67
|
rdworks/xtb/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
68
68
|
rdworks/xtb/wrapper.py,sha256=I0nW89vlJZ5Za5pCjIpjsEOFbTm7HpeNGiPgssheWn8,11350
|
69
|
-
rdworks-0.
|
70
|
-
rdworks-0.
|
71
|
-
rdworks-0.
|
72
|
-
rdworks-0.
|
73
|
-
rdworks-0.
|
69
|
+
rdworks-0.42.1.dist-info/licenses/LICENSE,sha256=UOkJSBqYyQUvtCp7a-vdCANeEcLE2dnTie_eB1By5SY,1074
|
70
|
+
rdworks-0.42.1.dist-info/METADATA,sha256=Fsnm3LWrztWcME2P9Ej-GreKrd5ltyt2PJOLOQ8e1AU,1967
|
71
|
+
rdworks-0.42.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
72
|
+
rdworks-0.42.1.dist-info/top_level.txt,sha256=05C98HbvBK2axUBogC_hAT_CdpOeQYGnQ6vRAgawr8s,8
|
73
|
+
rdworks-0.42.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|