rdworks 0.36.1__py3-none-any.whl → 0.36.2__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/mol.py +13 -7
- {rdworks-0.36.1.dist-info → rdworks-0.36.2.dist-info}/METADATA +1 -1
- {rdworks-0.36.1.dist-info → rdworks-0.36.2.dist-info}/RECORD +7 -7
- {rdworks-0.36.1.dist-info → rdworks-0.36.2.dist-info}/WHEEL +1 -1
- {rdworks-0.36.1.dist-info → rdworks-0.36.2.dist-info}/licenses/LICENSE +0 -0
- {rdworks-0.36.1.dist-info → rdworks-0.36.2.dist-info}/top_level.txt +0 -0
rdworks/__init__.py
CHANGED
rdworks/mol.py
CHANGED
@@ -3,6 +3,7 @@ import itertools
|
|
3
3
|
import json
|
4
4
|
import logging
|
5
5
|
import tempfile
|
6
|
+
import os
|
6
7
|
|
7
8
|
from io import StringIO, BytesIO
|
8
9
|
from pathlib import Path
|
@@ -367,7 +368,7 @@ class Mol:
|
|
367
368
|
self.confs.append(conf)
|
368
369
|
|
369
370
|
elif method.upper() == 'CONFORGE':
|
370
|
-
with tempfile.NamedTemporaryFile() as tmpfile:
|
371
|
+
with tempfile.NamedTemporaryFile(suffix='.sdf', delete=False) as tmpfile:
|
371
372
|
mol = CDPL.Chem.parseSMILES(self.smiles)
|
372
373
|
# create and initialize an instance of the class ConfGen.ConformerGenerator which
|
373
374
|
# will perform the actual conformer ensemble generation work
|
@@ -390,7 +391,7 @@ class Mol:
|
|
390
391
|
CDPL.ConfGen.ReturnCode.TORSION_DRIVING_FAILED : 'torsion driving failed',
|
391
392
|
CDPL.ConfGen.ReturnCode.CONF_GEN_FAILED : 'conformer generation failed',
|
392
393
|
}
|
393
|
-
writer = CDPL.Chem.MolecularGraphWriter(
|
394
|
+
writer = CDPL.Chem.MolecularGraphWriter(tmpfile.name, "sdf" )
|
394
395
|
# SB - io.StringIO does not work with Chem.MolecularGraphWriter()
|
395
396
|
# We have to create a temporary file and re-read it for storing individual conformers.
|
396
397
|
try:
|
@@ -403,15 +404,20 @@ class Mol:
|
|
403
404
|
if status == CDPL.ConfGen.ReturnCode.SUCCESS or status == CDPL.ConfGen.ReturnCode.TOO_MUCH_SYMMETRY:
|
404
405
|
# TOO_MUCH_SYMMETRY: output ensemble may contain duplicates
|
405
406
|
conf_gen.setConformers(mol)
|
406
|
-
writer.write(mol)
|
407
|
-
with Chem.SDMolSupplier(f"{tmpfile.name}.sdf", sanitize=True, removeHs=False) as sdf:
|
408
|
-
self.confs = [ Conf(m) for m in sdf if m is not None ]
|
407
|
+
writer.write(mol)
|
409
408
|
else:
|
410
409
|
raise RuntimeError('Error: conformer generation failed: %s' % status_to_str[status])
|
411
410
|
except Exception as e:
|
412
411
|
raise RuntimeError('Error: conformer generation failed: %s' % str(e))
|
413
|
-
|
414
|
-
|
412
|
+
|
413
|
+
# tmpfile is automatically closed here
|
414
|
+
|
415
|
+
with Chem.SDMolSupplier(tmpfile.name, sanitize=True, removeHs=False) as sdf:
|
416
|
+
self.confs = [ Conf(m) for m in sdf if m is not None ]
|
417
|
+
|
418
|
+
# tmpfile is not deleted here because delete=False
|
419
|
+
# we should remove the file when it is no longer needed
|
420
|
+
os.remove(tmpfile.name)
|
415
421
|
|
416
422
|
# energy evaluations for ranking
|
417
423
|
for conf in self.confs:
|
@@ -1,10 +1,10 @@
|
|
1
|
-
rdworks/__init__.py,sha256=
|
1
|
+
rdworks/__init__.py,sha256=IQYmK2AVX7BA--tFniboPkU1P1f3KlwhLFIUmnYtaUQ,1368
|
2
2
|
rdworks/conf.py,sha256=hi8qqcEhDMfiGAj10I7Pl65svVNeV-ihjM7lRKX7OaM,22284
|
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
|
6
6
|
rdworks/matchedseries.py,sha256=A3ON4CUpQV159mu9VqgNiJ8uoQ9ePOry9d3ra4NCAgc,10377
|
7
|
-
rdworks/mol.py,sha256=
|
7
|
+
rdworks/mol.py,sha256=lF5b_AIueYCfHWgrrnxbcZOFtSPe6dO4oOcovJ3GWhA,71338
|
8
8
|
rdworks/mollibr.py,sha256=X4UBO6Ga-QmNS7RwUiaDYAx0Q5hnWs71yTkEpH02Qb4,37696
|
9
9
|
rdworks/pka.py,sha256=NVJVfpcNEMlX5QRyLBgUM7GIT7VMjO-llAR4LWc8J2c,1656
|
10
10
|
rdworks/readin.py,sha256=0bnVcZcAmSLqc6zu1mYcv0LdBv2agQfOpKGwpSRL9VE,11742
|
@@ -65,8 +65,8 @@ rdworks/predefined/misc/reactive-part-3.xml,sha256=LgWHSEbRTVmgBoIO45xbTo1xQJs0X
|
|
65
65
|
rdworks/predefined/misc/reactive.xml,sha256=syedoQ6VYUfRLnxy99ObuDniJ_a_WhrWAJbTKFfJ6VY,11248
|
66
66
|
rdworks/xtb/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
67
67
|
rdworks/xtb/wrapper.py,sha256=I0nW89vlJZ5Za5pCjIpjsEOFbTm7HpeNGiPgssheWn8,11350
|
68
|
-
rdworks-0.36.
|
69
|
-
rdworks-0.36.
|
70
|
-
rdworks-0.36.
|
71
|
-
rdworks-0.36.
|
72
|
-
rdworks-0.36.
|
68
|
+
rdworks-0.36.2.dist-info/licenses/LICENSE,sha256=UOkJSBqYyQUvtCp7a-vdCANeEcLE2dnTie_eB1By5SY,1074
|
69
|
+
rdworks-0.36.2.dist-info/METADATA,sha256=GRcE_cV1nVX4j60RB1Cm_Y69Ad_y3HrZgOwnNau177Y,1183
|
70
|
+
rdworks-0.36.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
71
|
+
rdworks-0.36.2.dist-info/top_level.txt,sha256=05C98HbvBK2axUBogC_hAT_CdpOeQYGnQ6vRAgawr8s,8
|
72
|
+
rdworks-0.36.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|