File tree 4 files changed +15
-5
lines changed
4 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,9 @@ def smiles_to_unique_mol_id(smiles: str) -> Optional[str]:
27
27
mol_id: a string unique ID
28
28
"""
29
29
try :
30
- mol = dm .to_mol (mol = smiles )
30
+ mol = dm .to_mol (
31
+ mol = smiles
32
+ ) # Doesn't need `ordered=True` because the unique_id doesn't depend on the atom order
31
33
mol_id = dm .unique_id (mol )
32
34
except :
33
35
mol_id = ""
Original file line number Diff line number Diff line change @@ -743,7 +743,7 @@ def mol_to_adj_and_features(
743
743
"""
744
744
745
745
if isinstance (mol , str ):
746
- mol = dm .to_mol (mol )
746
+ mol = dm .to_mol (mol , ordered = True )
747
747
748
748
# Add or remove explicit hydrogens
749
749
if explicit_H :
@@ -1071,7 +1071,7 @@ def mol_to_graph_dict(
1071
1071
input_mol = mol
1072
1072
try :
1073
1073
if isinstance (mol , str ):
1074
- mol = dm .to_mol (mol )
1074
+ mol = dm .to_mol (mol , ordered = True )
1075
1075
if explicit_H :
1076
1076
mol = Chem .AddHs (mol )
1077
1077
else :
Original file line number Diff line number Diff line change 18
18
import datamol as dm
19
19
20
20
from rdkit .Chem import rdMolDescriptors as rdMD
21
+ from loguru import logger
21
22
22
23
23
24
def get_prop_or_none (
@@ -33,6 +34,7 @@ def get_prop_or_none(
33
34
Returns:
34
35
The property or a list of `None` with lenght `n`.
35
36
"""
37
+ logger .warning ("get_prop_or_none is deprecated. Use `datamol.to_fp` instead." )
36
38
try :
37
39
return prop (* args , ** kwargs )
38
40
except RuntimeError :
@@ -75,8 +77,12 @@ def get_props_from_mol(
75
77
76
78
"""
77
79
80
+ logger .warning ("get_props_from_mol is deprecated. Use `datamol.to_fp` instead." )
81
+
78
82
if isinstance (mol , str ):
79
- mol = dm .to_mol (mol )
83
+ mol = dm .to_mol (
84
+ mol
85
+ ) # Doesn't need `ordered=True` because the fingerprints don't depend on the atom order
80
86
81
87
if isinstance (properties , str ):
82
88
properties = [properties ]
Original file line number Diff line number Diff line change @@ -67,7 +67,9 @@ def main():
67
67
68
68
graphs = []
69
69
for s in tqdm (smiles ):
70
- mol = dm .to_mol (s )
70
+ mol = dm .to_mol (
71
+ s
72
+ ) # Doesn't need `ordered=True` because this is just to test the speed of the featurizer
71
73
graphs .append (mol_to_graph_dict (mol , ** featurizer ))
72
74
73
75
print (graphs [0 ])
You can’t perform that action at this time.
0 commit comments