File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 18
18
from rdkit .Chem .rdMolDescriptors import CalcNumRings
19
19
20
20
from scaffoldgraph .io import *
21
+ from scaffoldgraph import rdversion
21
22
from scaffoldgraph .utils import canonize_smiles
23
+
22
24
from .fragment import get_murcko_scaffold , get_annotated_murcko_scaffold
23
25
from .scaffold import Scaffold
24
26
@@ -37,7 +39,11 @@ def init_molecule_name(mol):
37
39
38
40
"""
39
41
if not mol .HasProp ('_Name' ) or mol .GetProp ('_Name' ) == '' :
40
- n = rdMolHash .GenerateMoleculeHashString (mol )
42
+ if rdversion < '2020.09.01' :
43
+ n = rdMolHash .GenerateMoleculeHashString (mol )
44
+ else : # New version deprecated GenrateMolHashString
45
+ hashf = rdMolHash .HashFunction .CanonicalSmiles
46
+ n = 'MolNode-' + rdMolHash .MolHash (hashf )
41
47
mol .SetProp ('_Name' , n )
42
48
43
49
You can’t perform that action at this time.
0 commit comments