Hi, I was surprised to see that a (dubious) structure that goes through SanitizeMol OK can fail a subsequent sanitization call:
print("Start") mol = Chem.MolFromSmiles('C1=n(C)-c=Cn1', sanitize=False) print("Before first sanitization") Chem.SanitizeMol(mol) print("Before second sanitization") Chem.SanitizeMol(mol) print("Done") The output is: Start Before first sanitization Before second sanitization [16:54:20] Explicit valence for atom # 1 N, 4, is greater than permitted Traceback (most recent call last): File "./san.py", line 9, in <module> Chem.SanitizeMol(mol) ValueError: Sanitization error: Explicit valence for atom # 1 N, 4, is greater than permitted Is this an unavoidable aspect of the way SanitizeMol works, since it does several operations (Kekulize, check valencies, set aromaticity, conjugation and hybridization) in a certain order, or should this be considered a bug? Best, Ivan
_______________________________________________ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss