molcraft 0.1.0a12__tar.gz → 0.1.0a13__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.0a12 → molcraft-0.1.0a13}/PKG-INFO +1 -1
- {molcraft-0.1.0a12 → molcraft-0.1.0a13}/molcraft/__init__.py +1 -1
- {molcraft-0.1.0a12 → molcraft-0.1.0a13}/molcraft/chem.py +4 -4
- {molcraft-0.1.0a12 → molcraft-0.1.0a13}/molcraft/descriptors.py +5 -3
- {molcraft-0.1.0a12 → molcraft-0.1.0a13}/molcraft/features.py +23 -18
- {molcraft-0.1.0a12 → molcraft-0.1.0a13}/molcraft/featurizers.py +3 -3
- {molcraft-0.1.0a12 → molcraft-0.1.0a13}/molcraft/ops.py +16 -0
- {molcraft-0.1.0a12 → molcraft-0.1.0a13}/molcraft.egg-info/PKG-INFO +1 -1
- {molcraft-0.1.0a12 → molcraft-0.1.0a13}/LICENSE +0 -0
- {molcraft-0.1.0a12 → molcraft-0.1.0a13}/README.md +0 -0
- {molcraft-0.1.0a12 → molcraft-0.1.0a13}/molcraft/apps/__init__.py +0 -0
- {molcraft-0.1.0a12 → molcraft-0.1.0a13}/molcraft/apps/peptides.py +0 -0
- {molcraft-0.1.0a12 → molcraft-0.1.0a13}/molcraft/callbacks.py +0 -0
- {molcraft-0.1.0a12 → molcraft-0.1.0a13}/molcraft/conformers.py +0 -0
- {molcraft-0.1.0a12 → molcraft-0.1.0a13}/molcraft/datasets.py +0 -0
- {molcraft-0.1.0a12 → molcraft-0.1.0a13}/molcraft/layers.py +0 -0
- {molcraft-0.1.0a12 → molcraft-0.1.0a13}/molcraft/losses.py +0 -0
- {molcraft-0.1.0a12 → molcraft-0.1.0a13}/molcraft/models.py +0 -0
- {molcraft-0.1.0a12 → molcraft-0.1.0a13}/molcraft/records.py +0 -0
- {molcraft-0.1.0a12 → molcraft-0.1.0a13}/molcraft/tensors.py +0 -0
- {molcraft-0.1.0a12 → molcraft-0.1.0a13}/molcraft.egg-info/SOURCES.txt +0 -0
- {molcraft-0.1.0a12 → molcraft-0.1.0a13}/molcraft.egg-info/dependency_links.txt +0 -0
- {molcraft-0.1.0a12 → molcraft-0.1.0a13}/molcraft.egg-info/requires.txt +0 -0
- {molcraft-0.1.0a12 → molcraft-0.1.0a13}/molcraft.egg-info/top_level.txt +0 -0
- {molcraft-0.1.0a12 → molcraft-0.1.0a13}/pyproject.toml +0 -0
- {molcraft-0.1.0a12 → molcraft-0.1.0a13}/setup.cfg +0 -0
- {molcraft-0.1.0a12 → molcraft-0.1.0a13}/tests/test_chem.py +0 -0
- {molcraft-0.1.0a12 → molcraft-0.1.0a13}/tests/test_featurizers.py +0 -0
- {molcraft-0.1.0a12 → molcraft-0.1.0a13}/tests/test_layers.py +0 -0
- {molcraft-0.1.0a12 → molcraft-0.1.0a13}/tests/test_losses.py +0 -0
- {molcraft-0.1.0a12 → molcraft-0.1.0a13}/tests/test_models.py +0 -0
- {molcraft-0.1.0a12 → molcraft-0.1.0a13}/tests/test_tensors.py +0 -0
|
@@ -331,20 +331,20 @@ def get_shortest_paths(
|
|
|
331
331
|
def get_periodic_table():
|
|
332
332
|
return Chem.GetPeriodicTable()
|
|
333
333
|
|
|
334
|
-
def
|
|
334
|
+
def partial_charges(mol: 'Mol') -> list[float]:
|
|
335
335
|
rdPartialCharges.ComputeGasteigerCharges(mol)
|
|
336
336
|
return [atom.GetDoubleProp("_GasteigerCharge") for atom in mol.atoms]
|
|
337
337
|
|
|
338
338
|
def logp_contributions(mol: 'Mol') -> list[float]:
|
|
339
339
|
return [i[0] for i in rdMolDescriptors._CalcCrippenContribs(mol)]
|
|
340
340
|
|
|
341
|
-
def
|
|
341
|
+
def molar_refractivity_contributions(mol: 'Mol') -> list[float]:
|
|
342
342
|
return [i[1] for i in rdMolDescriptors._CalcCrippenContribs(mol)]
|
|
343
343
|
|
|
344
|
-
def
|
|
344
|
+
def total_polar_surface_area_contributions(mol: 'Mol') -> list[float]:
|
|
345
345
|
return list(rdMolDescriptors._CalcTPSAContribs(mol))
|
|
346
346
|
|
|
347
|
-
def
|
|
347
|
+
def accessible_surface_area_contributions(mol: 'Mol') -> list[float]:
|
|
348
348
|
return list(rdMolDescriptors._CalcLabuteASAContribs(mol)[0])
|
|
349
349
|
|
|
350
350
|
def hydrogen_acceptors(mol: 'Mol') -> list[bool]:
|
|
@@ -37,19 +37,21 @@ class MolWeight(Descriptor):
|
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
@keras.saving.register_keras_serializable(package='molcraft')
|
|
40
|
-
class
|
|
40
|
+
class TotalPolarSurfaceArea(Descriptor):
|
|
41
41
|
def call(self, mol: chem.Mol) -> np.ndarray:
|
|
42
42
|
return rdMolDescriptors.CalcTPSA(mol)
|
|
43
43
|
|
|
44
44
|
|
|
45
45
|
@keras.saving.register_keras_serializable(package='molcraft')
|
|
46
|
-
class
|
|
46
|
+
class LogP(Descriptor):
|
|
47
|
+
"""Crippen logP."""
|
|
47
48
|
def call(self, mol: chem.Mol) -> np.ndarray:
|
|
48
49
|
return rdMolDescriptors.CalcCrippenDescriptors(mol)[0]
|
|
49
50
|
|
|
50
51
|
|
|
51
52
|
@keras.saving.register_keras_serializable(package='molcraft')
|
|
52
|
-
class
|
|
53
|
+
class MolarRefractivity(Descriptor):
|
|
54
|
+
"""Crippen molar refractivity."""
|
|
53
55
|
def call(self, mol: chem.Mol) -> np.ndarray:
|
|
54
56
|
return rdMolDescriptors.CalcCrippenDescriptors(mol)[1]
|
|
55
57
|
|
|
@@ -276,37 +276,42 @@ class IsHydrogenAcceptor(Feature):
|
|
|
276
276
|
class IsInRing(Feature):
|
|
277
277
|
def call(self, mol: chem.Mol) -> list[int, float, str]:
|
|
278
278
|
return [atom.IsInRing() for atom in mol.atoms]
|
|
279
|
-
|
|
279
|
+
|
|
280
280
|
|
|
281
281
|
@keras.saving.register_keras_serializable(package='molcraft')
|
|
282
|
-
class
|
|
283
|
-
|
|
284
|
-
|
|
282
|
+
class PartialCharge(Feature):
|
|
283
|
+
"""Gasteiger partial charge."""
|
|
284
|
+
def call(self, mol: chem.Mol) -> list[int, float, str]:
|
|
285
|
+
return chem.partial_charges(mol)
|
|
285
286
|
|
|
286
287
|
|
|
287
288
|
@keras.saving.register_keras_serializable(package='molcraft')
|
|
288
|
-
class
|
|
289
|
+
class TotalPolarSurfaceAreaContribution(Feature):
|
|
290
|
+
"""Total polar surface area (TPSA) contribution."""
|
|
289
291
|
def call(self, mol: chem.Mol) -> list[int, float, str]:
|
|
290
|
-
return chem.
|
|
291
|
-
|
|
292
|
+
return chem.total_polar_surface_area_contributions(mol)
|
|
292
293
|
|
|
293
|
-
@keras.saving.register_keras_serializable(package='molcraft')
|
|
294
|
-
class TPSAContribution(Feature):
|
|
295
|
-
def call(self, mol: chem.Mol) -> list[int, float, str]:
|
|
296
|
-
return chem.tpsa_contribution(mol)
|
|
297
|
-
|
|
298
294
|
|
|
299
295
|
@keras.saving.register_keras_serializable(package='molcraft')
|
|
300
|
-
class
|
|
296
|
+
class AccessibleSurfaceAreaContribution(Feature):
|
|
297
|
+
"""Labute accessible surface area (ASA) contribution."""
|
|
301
298
|
def call(self, mol: chem.Mol) -> list[int, float, str]:
|
|
302
|
-
return chem.
|
|
299
|
+
return chem.accessible_surface_area_contributions(mol)
|
|
303
300
|
|
|
304
301
|
|
|
305
302
|
@keras.saving.register_keras_serializable(package='molcraft')
|
|
306
|
-
class
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
303
|
+
class LogPContribution(Feature):
|
|
304
|
+
"""Crippen logP contribution."""
|
|
305
|
+
def call(self, mol: chem.Mol) -> list[int, float, str]:
|
|
306
|
+
return chem.logp_contributions(mol)
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
@keras.saving.register_keras_serializable(package='molcraft')
|
|
310
|
+
class MolarRefractivityContribution(Feature):
|
|
311
|
+
"""Crippen molar refractivity contribution."""
|
|
312
|
+
def call(self, mol: chem.Mol) -> list[int, float, str]:
|
|
313
|
+
return chem.molar_refractivity_contributions(mol)
|
|
314
|
+
|
|
310
315
|
|
|
311
316
|
@keras.saving.register_keras_serializable(package='molcraft')
|
|
312
317
|
class BondType(Feature):
|
|
@@ -192,9 +192,9 @@ class MolGraphFeaturizer(Featurizer):
|
|
|
192
192
|
if default_molecule_features:
|
|
193
193
|
molecule_features = [
|
|
194
194
|
descriptors.MolWeight(),
|
|
195
|
-
descriptors.
|
|
196
|
-
descriptors.
|
|
197
|
-
descriptors.
|
|
195
|
+
descriptors.TotalPolarSurfaceArea(),
|
|
196
|
+
descriptors.LogP(),
|
|
197
|
+
descriptors.MolarRefractivity(),
|
|
198
198
|
descriptors.NumHeavyAtoms(),
|
|
199
199
|
descriptors.NumHeteroatoms(),
|
|
200
200
|
descriptors.NumHydrogenDonors(),
|
|
@@ -62,6 +62,22 @@ def scatter_update(
|
|
|
62
62
|
indices = keras.ops.expand_dims(indices, axis=-1)
|
|
63
63
|
return keras.ops.scatter_update(inputs, indices, updates)
|
|
64
64
|
|
|
65
|
+
def scatter_add(
|
|
66
|
+
inputs: tf.Tensor,
|
|
67
|
+
indices: tf.Tensor,
|
|
68
|
+
updates: tf.Tensor,
|
|
69
|
+
) -> tf.Tensor:
|
|
70
|
+
if indices.dtype == tf.bool:
|
|
71
|
+
indices = keras.ops.stack(keras.ops.where(indices), axis=-1)
|
|
72
|
+
expected_rank = len(keras.ops.shape(inputs))
|
|
73
|
+
current_rank = len(keras.ops.shape(indices))
|
|
74
|
+
for _ in range(expected_rank - current_rank):
|
|
75
|
+
indices = keras.ops.expand_dims(indices, axis=-1)
|
|
76
|
+
if backend.backend() == 'tensorflow':
|
|
77
|
+
return tf.tensor_scatter_nd_add(inputs, indices, updates)
|
|
78
|
+
updates = scatter_update(keras.ops.zeros_like(inputs), indices, updates)
|
|
79
|
+
return inputs + updates
|
|
80
|
+
|
|
65
81
|
def edge_softmax(
|
|
66
82
|
score: tf.Tensor,
|
|
67
83
|
edge_target: tf.Tensor
|
|
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
|