molcraft 0.1.0a19__tar.gz → 0.1.0a21__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 molcraft might be problematic. Click here for more details.
- {molcraft-0.1.0a19 → molcraft-0.1.0a21}/PKG-INFO +1 -1
- {molcraft-0.1.0a19 → molcraft-0.1.0a21}/molcraft/__init__.py +1 -1
- {molcraft-0.1.0a19 → molcraft-0.1.0a21}/molcraft/chem.py +6 -8
- {molcraft-0.1.0a19 → molcraft-0.1.0a21}/molcraft/featurizers.py +2 -1
- {molcraft-0.1.0a19 → molcraft-0.1.0a21}/molcraft.egg-info/PKG-INFO +1 -1
- {molcraft-0.1.0a19 → molcraft-0.1.0a21}/tests/test_featurizers.py +14 -0
- {molcraft-0.1.0a19 → molcraft-0.1.0a21}/LICENSE +0 -0
- {molcraft-0.1.0a19 → molcraft-0.1.0a21}/README.md +0 -0
- {molcraft-0.1.0a19 → molcraft-0.1.0a21}/molcraft/applications/__init__.py +0 -0
- {molcraft-0.1.0a19 → molcraft-0.1.0a21}/molcraft/applications/chromatography.py +0 -0
- {molcraft-0.1.0a19 → molcraft-0.1.0a21}/molcraft/applications/proteomics.py +0 -0
- {molcraft-0.1.0a19 → molcraft-0.1.0a21}/molcraft/callbacks.py +0 -0
- {molcraft-0.1.0a19 → molcraft-0.1.0a21}/molcraft/datasets.py +0 -0
- {molcraft-0.1.0a19 → molcraft-0.1.0a21}/molcraft/descriptors.py +0 -0
- {molcraft-0.1.0a19 → molcraft-0.1.0a21}/molcraft/features.py +0 -0
- {molcraft-0.1.0a19 → molcraft-0.1.0a21}/molcraft/layers.py +0 -0
- {molcraft-0.1.0a19 → molcraft-0.1.0a21}/molcraft/losses.py +0 -0
- {molcraft-0.1.0a19 → molcraft-0.1.0a21}/molcraft/models.py +0 -0
- {molcraft-0.1.0a19 → molcraft-0.1.0a21}/molcraft/ops.py +0 -0
- {molcraft-0.1.0a19 → molcraft-0.1.0a21}/molcraft/records.py +0 -0
- {molcraft-0.1.0a19 → molcraft-0.1.0a21}/molcraft/tensors.py +0 -0
- {molcraft-0.1.0a19 → molcraft-0.1.0a21}/molcraft.egg-info/SOURCES.txt +0 -0
- {molcraft-0.1.0a19 → molcraft-0.1.0a21}/molcraft.egg-info/dependency_links.txt +0 -0
- {molcraft-0.1.0a19 → molcraft-0.1.0a21}/molcraft.egg-info/requires.txt +0 -0
- {molcraft-0.1.0a19 → molcraft-0.1.0a21}/molcraft.egg-info/top_level.txt +0 -0
- {molcraft-0.1.0a19 → molcraft-0.1.0a21}/pyproject.toml +0 -0
- {molcraft-0.1.0a19 → molcraft-0.1.0a21}/setup.cfg +0 -0
- {molcraft-0.1.0a19 → molcraft-0.1.0a21}/tests/test_chem.py +0 -0
- {molcraft-0.1.0a19 → molcraft-0.1.0a21}/tests/test_layers.py +0 -0
- {molcraft-0.1.0a19 → molcraft-0.1.0a21}/tests/test_losses.py +0 -0
- {molcraft-0.1.0a19 → molcraft-0.1.0a21}/tests/test_models.py +0 -0
- {molcraft-0.1.0a19 → molcraft-0.1.0a21}/tests/test_tensors.py +0 -0
|
@@ -427,11 +427,9 @@ def embed_conformers(
|
|
|
427
427
|
f'{num_conformers - num_successes} conformer(s) using different embedding methods.',
|
|
428
428
|
stacklevel=2
|
|
429
429
|
)
|
|
430
|
-
max_attempts = (20 * mol.num_atoms) # increasing it from 10xN to 20xN
|
|
431
430
|
for fallback_method in [method, 'ETDG', 'KDG']:
|
|
432
431
|
fallback_embedding_method = available_embedding_methods[fallback_method]
|
|
433
432
|
fallback_embedding_method.useRandomCoords = True
|
|
434
|
-
fallback_embedding_method.maxAttempts = max_attempts
|
|
435
433
|
fallback_embedding_method.clearConfs = False
|
|
436
434
|
if random_seed is not None:
|
|
437
435
|
fallback_embedding_method.randomSeed = random_seed
|
|
@@ -463,14 +461,14 @@ def optimize_conformers(
|
|
|
463
461
|
f'Could not find `method` {method!r}. Specify either of: '
|
|
464
462
|
'`UFF`, `MMFF`, `MMFF94` or `MMFF94s`.'
|
|
465
463
|
)
|
|
466
|
-
|
|
464
|
+
mol_optimized = Mol(mol)
|
|
467
465
|
try:
|
|
468
466
|
if method.startswith('MMFF'):
|
|
469
467
|
variant = method
|
|
470
468
|
if variant == 'MMFF':
|
|
471
469
|
variant += '94'
|
|
472
470
|
_, _ = _mmff_optimize_conformers(
|
|
473
|
-
|
|
471
|
+
mol_optimized,
|
|
474
472
|
num_threads=num_threads,
|
|
475
473
|
max_iter=max_iter,
|
|
476
474
|
variant=variant,
|
|
@@ -478,7 +476,7 @@ def optimize_conformers(
|
|
|
478
476
|
)
|
|
479
477
|
else:
|
|
480
478
|
_, _ = _uff_optimize_conformers(
|
|
481
|
-
|
|
479
|
+
mol_optimized,
|
|
482
480
|
num_threads=num_threads,
|
|
483
481
|
max_iter=max_iter,
|
|
484
482
|
vdw_threshold=vdw_threshold,
|
|
@@ -486,11 +484,11 @@ def optimize_conformers(
|
|
|
486
484
|
)
|
|
487
485
|
except RuntimeError as e:
|
|
488
486
|
warnings.warn(
|
|
489
|
-
f'{method} force field minimization
|
|
490
|
-
'\nProceeding without force field minimization.',
|
|
487
|
+
f'{method} force field minimization did not succeed. Proceeding without it.',
|
|
491
488
|
stacklevel=2
|
|
492
489
|
)
|
|
493
|
-
|
|
490
|
+
return mol
|
|
491
|
+
return mol_optimized
|
|
494
492
|
|
|
495
493
|
def prune_conformers(
|
|
496
494
|
mol: Mol,
|
|
@@ -323,7 +323,9 @@ class MolGraphFeaturizer3D(MolGraphFeaturizer):
|
|
|
323
323
|
include_hydrogens: bool = False,
|
|
324
324
|
radius: int | float | None = 6.0,
|
|
325
325
|
random_seed: int | None = None,
|
|
326
|
+
**kwargs,
|
|
326
327
|
) -> None:
|
|
328
|
+
kwargs.pop('bond_features', None)
|
|
327
329
|
super().__init__(
|
|
328
330
|
atom_features=atom_features,
|
|
329
331
|
bond_features=None,
|
|
@@ -413,7 +415,6 @@ class MolGraphFeaturizer3D(MolGraphFeaturizer):
|
|
|
413
415
|
|
|
414
416
|
def get_config(self):
|
|
415
417
|
config = super().get_config()
|
|
416
|
-
config.pop('bond_features', None)
|
|
417
418
|
config['radius'] = self._radius
|
|
418
419
|
config['pair_features'] = keras.saving.serialize_keras_object(
|
|
419
420
|
self._pair_features
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import unittest
|
|
2
|
+
import tempfile
|
|
3
|
+
import shutil
|
|
2
4
|
|
|
3
5
|
from molcraft import features
|
|
4
6
|
from molcraft import featurizers
|
|
@@ -42,6 +44,12 @@ class TestFeaturizer(unittest.TestCase):
|
|
|
42
44
|
include_hydrogens=False,
|
|
43
45
|
)
|
|
44
46
|
|
|
47
|
+
tmp_dir = tempfile.mkdtemp()
|
|
48
|
+
tmp_file = tmp_dir + '/featurizer.json'
|
|
49
|
+
featurizers.save_featurizer(featurizer, tmp_file)
|
|
50
|
+
_ = featurizers.load_featurizer(tmp_file)
|
|
51
|
+
shutil.rmtree(tmp_dir)
|
|
52
|
+
|
|
45
53
|
node_dim = 9
|
|
46
54
|
edge_dim = 4
|
|
47
55
|
|
|
@@ -127,6 +135,12 @@ class TestFeaturizer(unittest.TestCase):
|
|
|
127
135
|
radius=5.0,
|
|
128
136
|
)
|
|
129
137
|
|
|
138
|
+
tmp_dir = tempfile.mkdtemp()
|
|
139
|
+
tmp_file = tmp_dir + '/featurizer.json'
|
|
140
|
+
featurizers.save_featurizer(featurizer, tmp_file)
|
|
141
|
+
_ = featurizers.load_featurizer(tmp_file)
|
|
142
|
+
shutil.rmtree(tmp_dir)
|
|
143
|
+
|
|
130
144
|
node_dim = 10
|
|
131
145
|
edge_dim = 22
|
|
132
146
|
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|