molcraft 0.1.0a15__py3-none-any.whl → 0.1.0a17__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 molcraft might be problematic. Click here for more details.
- molcraft/__init__.py +1 -2
- molcraft/applications/chromatography.py +0 -0
- molcraft/applications/proteomics.py +194 -0
- molcraft/chem.py +17 -22
- molcraft/datasets.py +6 -6
- molcraft/descriptors.py +14 -0
- molcraft/features.py +50 -58
- molcraft/featurizers.py +257 -487
- molcraft/layers.py +50 -0
- molcraft/models.py +2 -0
- molcraft/records.py +24 -15
- {molcraft-0.1.0a15.dist-info → molcraft-0.1.0a17.dist-info}/METADATA +14 -12
- molcraft-0.1.0a17.dist-info/RECORD +21 -0
- molcraft/apps/peptides.py +0 -429
- molcraft/apps/qsrr.py +0 -47
- molcraft/conformers.py +0 -151
- molcraft-0.1.0a15.dist-info/RECORD +0 -22
- /molcraft/{apps → applications}/__init__.py +0 -0
- {molcraft-0.1.0a15.dist-info → molcraft-0.1.0a17.dist-info}/WHEEL +0 -0
- {molcraft-0.1.0a15.dist-info → molcraft-0.1.0a17.dist-info}/licenses/LICENSE +0 -0
- {molcraft-0.1.0a15.dist-info → molcraft-0.1.0a17.dist-info}/top_level.txt +0 -0
molcraft/apps/qsrr.py
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import molcraft
|
|
2
|
-
import keras
|
|
3
|
-
|
|
4
|
-
@keras.saving.register_keras_serializable(package='molcraft')
|
|
5
|
-
class AuxiliaryFeatureInjection(molcraft.layers.GraphLayer):
|
|
6
|
-
|
|
7
|
-
def __init__(
|
|
8
|
-
self,
|
|
9
|
-
field: str = 'auxiliary_feature',
|
|
10
|
-
depth: int = 2,
|
|
11
|
-
drop: bool = True,
|
|
12
|
-
activation: str | None = None,
|
|
13
|
-
**kwargs,
|
|
14
|
-
) -> None:
|
|
15
|
-
super().__init__(**kwargs)
|
|
16
|
-
self.field = field
|
|
17
|
-
self.depth = depth
|
|
18
|
-
self.drop = drop
|
|
19
|
-
self.activation = keras.activations.get(activation)
|
|
20
|
-
|
|
21
|
-
def build(self, spec: molcraft.tensors.GraphTensor.Spec) -> None:
|
|
22
|
-
units = spec.node['feature'].shape[1]
|
|
23
|
-
for i in range(self.depth):
|
|
24
|
-
setattr(
|
|
25
|
-
self, f'dense_{i}', self.get_dense(units, activation=self.activation)
|
|
26
|
-
)
|
|
27
|
-
|
|
28
|
-
def propagate(self, tensor: molcraft.tensors.GraphTensor) -> None:
|
|
29
|
-
x = tensor.context[self.field]
|
|
30
|
-
if self.drop:
|
|
31
|
-
tensor = tensor.update({'context': {self.field: None}})
|
|
32
|
-
for i in range(self.depth):
|
|
33
|
-
x = getattr(self, f'dense_{i}')(x)
|
|
34
|
-
node_feature = molcraft.ops.scatter_add(
|
|
35
|
-
tensor.node['feature'], tensor.node['super'], x
|
|
36
|
-
)
|
|
37
|
-
return tensor.update({'node': {'feature': node_feature}})
|
|
38
|
-
|
|
39
|
-
def get_config(self) -> dict:
|
|
40
|
-
config = super().get_config()
|
|
41
|
-
config.update({
|
|
42
|
-
'field': self.field,
|
|
43
|
-
'depth': self.depth,
|
|
44
|
-
'drop': self.drop,
|
|
45
|
-
'activation': keras.activations.serialize(self.activation)
|
|
46
|
-
})
|
|
47
|
-
return config
|
molcraft/conformers.py
DELETED
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
import keras
|
|
2
|
-
|
|
3
|
-
from molcraft import chem
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
@keras.saving.register_keras_serializable(package="molcraft")
|
|
7
|
-
class ConformerProcessor:
|
|
8
|
-
|
|
9
|
-
def get_config(self) -> dict:
|
|
10
|
-
return {}
|
|
11
|
-
|
|
12
|
-
@classmethod
|
|
13
|
-
def from_config(cls, config: dict):
|
|
14
|
-
return cls(**config)
|
|
15
|
-
|
|
16
|
-
def __call__(self, mol: chem.Mol) -> chem.Mol:
|
|
17
|
-
raise NotImplementedError
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
@keras.saving.register_keras_serializable(package="molcraft")
|
|
21
|
-
class ConformerEmbedder(ConformerProcessor):
|
|
22
|
-
|
|
23
|
-
def __init__(
|
|
24
|
-
self,
|
|
25
|
-
method: str = 'ETKDGv3',
|
|
26
|
-
num_conformers: int = 5,
|
|
27
|
-
**kwargs,
|
|
28
|
-
) -> None:
|
|
29
|
-
self.method = method
|
|
30
|
-
self.num_conformers = num_conformers
|
|
31
|
-
self.kwargs = kwargs
|
|
32
|
-
|
|
33
|
-
def get_config(self) -> dict:
|
|
34
|
-
config = {
|
|
35
|
-
'method': self.method,
|
|
36
|
-
'num_conformers': self.num_conformers,
|
|
37
|
-
}
|
|
38
|
-
config.update({
|
|
39
|
-
k: v for (k, v) in self.kwargs.items()
|
|
40
|
-
})
|
|
41
|
-
return config
|
|
42
|
-
|
|
43
|
-
def __call__(self, mol: chem.Mol) -> chem.Mol:
|
|
44
|
-
return chem.embed_conformers(
|
|
45
|
-
mol,
|
|
46
|
-
method=self.method,
|
|
47
|
-
num_conformers=self.num_conformers,
|
|
48
|
-
**self.kwargs,
|
|
49
|
-
)
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
@keras.saving.register_keras_serializable(package="molcraft")
|
|
53
|
-
class ConformerOptimizer(ConformerProcessor):
|
|
54
|
-
|
|
55
|
-
def __init__(
|
|
56
|
-
self,
|
|
57
|
-
method: str = 'UFF',
|
|
58
|
-
max_iter: int = 200,
|
|
59
|
-
ignore_interfragment_interactions: bool = True,
|
|
60
|
-
vdw_threshold: float = 10.0,
|
|
61
|
-
**kwargs,
|
|
62
|
-
) -> None:
|
|
63
|
-
self.method = method
|
|
64
|
-
self.max_iter = max_iter
|
|
65
|
-
self.ignore_interfragment_interactions = ignore_interfragment_interactions
|
|
66
|
-
self.vdw_threshold = vdw_threshold
|
|
67
|
-
self.kwargs = kwargs
|
|
68
|
-
|
|
69
|
-
def get_config(self) -> dict:
|
|
70
|
-
config = {
|
|
71
|
-
'method': self.method,
|
|
72
|
-
'max_iter': self.max_iter,
|
|
73
|
-
'ignore_interfragment_interactions': self.ignore_interfragment_interactions,
|
|
74
|
-
'vdw_threshold': self.vdw_threshold,
|
|
75
|
-
}
|
|
76
|
-
config.update({
|
|
77
|
-
k: v for (k, v) in self.kwargs.items()
|
|
78
|
-
})
|
|
79
|
-
return config
|
|
80
|
-
|
|
81
|
-
def __call__(self, mol: chem.Mol) -> chem.Mol:
|
|
82
|
-
return chem.optimize_conformers(
|
|
83
|
-
mol,
|
|
84
|
-
method=self.method,
|
|
85
|
-
max_iter=self.max_iter,
|
|
86
|
-
ignore_interfragment_interactions=self.ignore_interfragment_interactions,
|
|
87
|
-
vdw_threshold=self.vdw_threshold,
|
|
88
|
-
**self.kwargs,
|
|
89
|
-
)
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
@keras.saving.register_keras_serializable(package="molcraft")
|
|
93
|
-
class ConformerPruner(ConformerProcessor):
|
|
94
|
-
def __init__(
|
|
95
|
-
self,
|
|
96
|
-
keep: int = 1,
|
|
97
|
-
threshold: float = 0.0,
|
|
98
|
-
energy_force_field: str = 'UFF',
|
|
99
|
-
**kwargs,
|
|
100
|
-
) -> None:
|
|
101
|
-
self.keep = keep
|
|
102
|
-
self.threshold = threshold
|
|
103
|
-
self.energy_force_field = energy_force_field
|
|
104
|
-
self.kwargs = kwargs
|
|
105
|
-
|
|
106
|
-
def get_config(self) -> dict:
|
|
107
|
-
config = {
|
|
108
|
-
'keep': self.keep,
|
|
109
|
-
'threshold': self.threshold,
|
|
110
|
-
'energy_force_field': self.energy_force_field,
|
|
111
|
-
}
|
|
112
|
-
config.update({
|
|
113
|
-
k: v for (k, v) in self.kwargs.items()
|
|
114
|
-
})
|
|
115
|
-
return config
|
|
116
|
-
|
|
117
|
-
def __call__(self, mol: chem.Mol) -> chem.Mol:
|
|
118
|
-
return chem.prune_conformers(
|
|
119
|
-
mol,
|
|
120
|
-
keep=self.keep,
|
|
121
|
-
threshold=self.threshold,
|
|
122
|
-
energy_force_field=self.energy_force_field,
|
|
123
|
-
**self.kwargs,
|
|
124
|
-
)
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
@keras.saving.register_keras_serializable(package='molcraft')
|
|
128
|
-
class ConformerGenerator(ConformerProcessor):
|
|
129
|
-
|
|
130
|
-
def __init__(self, steps: list[ConformerProcessor]) -> None:
|
|
131
|
-
self.steps = steps
|
|
132
|
-
|
|
133
|
-
def get_config(self) -> dict:
|
|
134
|
-
return {
|
|
135
|
-
"steps": [
|
|
136
|
-
keras.saving.serialize_keras_object(step) for step in self.steps
|
|
137
|
-
]
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
@classmethod
|
|
141
|
-
def from_config(cls, config: dict) -> 'ConformerGenerator':
|
|
142
|
-
steps = [
|
|
143
|
-
keras.saving.deserialize_keras_object(obj)
|
|
144
|
-
for obj in config["steps"]
|
|
145
|
-
]
|
|
146
|
-
return cls(steps)
|
|
147
|
-
|
|
148
|
-
def __call__(self, mol: chem.Mol) -> chem.Mol:
|
|
149
|
-
for step in self.steps:
|
|
150
|
-
mol = step(mol)
|
|
151
|
-
return mol
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
molcraft/__init__.py,sha256=4yc0HLuOki-T3c1zX4_5III8vUIhGS4T8AfmIVvb0bw,464
|
|
2
|
-
molcraft/callbacks.py,sha256=x5HnkZhqcFRrW6xdApt_jZ4X08A-0fxcnFKfdmRKa0c,3571
|
|
3
|
-
molcraft/chem.py,sha256=--4AdZV0TCj_cf5i-TRidNJGSFyab1ksUEMjmDi7zaM,21837
|
|
4
|
-
molcraft/conformers.py,sha256=K6ZtiSUNDN_fwqGP9JrPcwALLFFvlMlF_XejEJH3Sr4,4205
|
|
5
|
-
molcraft/datasets.py,sha256=QKHi9SUBKvJvdkRFmRQNowhrnu35pQqtujuLatOK8bE,4151
|
|
6
|
-
molcraft/descriptors.py,sha256=jJpT0XWu3Tx_bxnwk1rENySRkaM8cMDMaDIjG8KKvtg,3097
|
|
7
|
-
molcraft/features.py,sha256=GwOecLCNUIuGfbIVzsAJH4LikkzWMKj5IT7zSgGTttU,13846
|
|
8
|
-
molcraft/featurizers.py,sha256=8Jmd2yguYmVRyh5wkn6sRzzEENkJ0TqHSlR8qgC4zNY,27131
|
|
9
|
-
molcraft/layers.py,sha256=cUpo9dqqNEnc7rNf-Dze8adFhOkTV5F9IhHOKs13OUI,60134
|
|
10
|
-
molcraft/losses.py,sha256=qnS2yC5g-O3n_zVea9MR6TNiFraW2yqRgePOisoUP4A,1065
|
|
11
|
-
molcraft/models.py,sha256=hKYSV8z65ohRKfPyjjzxZeVjipm064BWeUBGZE0tpyU,21882
|
|
12
|
-
molcraft/ops.py,sha256=bQbdFDt9waxVCzF5-dkTB6vlpj9eoSt8I4Qg7ZGXbsU,6178
|
|
13
|
-
molcraft/records.py,sha256=MbvYkcCunbAmpy_MWXmQ9WBGi2WvwxFUlwQSPKPvSSk,5534
|
|
14
|
-
molcraft/tensors.py,sha256=EOUKx496KUZsjA1zA2ABc7tU_TW3Jv7AXDsug_QsLbA,22407
|
|
15
|
-
molcraft/apps/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
16
|
-
molcraft/apps/peptides.py,sha256=N5wJDGDIDRbmOmxin_dTY-odLqb0avAX9FU22U6x6c0,14576
|
|
17
|
-
molcraft/apps/qsrr.py,sha256=HhsJzTUuSSvHcl5fmPrI7VtzAUP711yesQ_pAc9hNhU,1572
|
|
18
|
-
molcraft-0.1.0a15.dist-info/licenses/LICENSE,sha256=sbVeqlrtZ0V63uYhZGL5dCxUm8rBAOqe2avyA1zIQNk,1074
|
|
19
|
-
molcraft-0.1.0a15.dist-info/METADATA,sha256=hOAPpbo8vhG-9Jr0WzA8NgugAm0d46Um0R3IhtZpeZU,3893
|
|
20
|
-
molcraft-0.1.0a15.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
21
|
-
molcraft-0.1.0a15.dist-info/top_level.txt,sha256=dENV6MfOceshM6MQCgJlcN1ojZkiCL9B4F7XyUge3QM,9
|
|
22
|
-
molcraft-0.1.0a15.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|