File tree Expand file tree Collapse file tree 4 files changed +15
-5
lines changed Expand file tree Collapse file tree 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]:
2727 mol_id: a string unique ID
2828 """
2929 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
3133 mol_id = dm .unique_id (mol )
3234 except :
3335 mol_id = ""
Original file line number Diff line number Diff line change @@ -743,7 +743,7 @@ def mol_to_adj_and_features(
743743 """
744744
745745 if isinstance (mol , str ):
746- mol = dm .to_mol (mol )
746+ mol = dm .to_mol (mol , ordered = True )
747747
748748 # Add or remove explicit hydrogens
749749 if explicit_H :
@@ -1071,7 +1071,7 @@ def mol_to_graph_dict(
10711071 input_mol = mol
10721072 try :
10731073 if isinstance (mol , str ):
1074- mol = dm .to_mol (mol )
1074+ mol = dm .to_mol (mol , ordered = True )
10751075 if explicit_H :
10761076 mol = Chem .AddHs (mol )
10771077 else :
Original file line number Diff line number Diff line change 1818import datamol as dm
1919
2020from rdkit .Chem import rdMolDescriptors as rdMD
21+ from loguru import logger
2122
2223
2324def get_prop_or_none (
@@ -33,6 +34,7 @@ def get_prop_or_none(
3334 Returns:
3435 The property or a list of `None` with lenght `n`.
3536 """
37+ logger .warning ("get_prop_or_none is deprecated. Use `datamol.to_fp` instead." )
3638 try :
3739 return prop (* args , ** kwargs )
3840 except RuntimeError :
@@ -75,8 +77,12 @@ def get_props_from_mol(
7577
7678 """
7779
80+ logger .warning ("get_props_from_mol is deprecated. Use `datamol.to_fp` instead." )
81+
7882 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
8086
8187 if isinstance (properties , str ):
8288 properties = [properties ]
Original file line number Diff line number Diff line change @@ -67,7 +67,9 @@ def main():
6767
6868 graphs = []
6969 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
7173 graphs .append (mol_to_graph_dict (mol , ** featurizer ))
7274
7375 print (graphs [0 ])
You can’t perform that action at this time.
0 commit comments