This one is tricky and I bumped into something similar not too long ago. What happened is that by default:
[2] mol = Chem.MolFromSmiles("O=C(CC1SCCC1)c1coooo1N") automatically has sanitize set to True. One of the steps is aromaticity sanitization. Since I don't think the mol satisfies 4n+2, sanitization removed aromaticity from the ring. You can verify this with: print([a.GetIsAromatic() for a in mol.GetAtoms()]) [3] smi = Chem.MolToSmiles(mol) Then generates: 'NO1OOOC=C1C(=O)CC1CCCS1', which results in a neutral oxygen with 3 explicit valences. Unfortunately AFAIK, RDKit can only catchErrors when a certain sanitization step failed but not if it succeeded (as in this case). Maybe Greg or Brian has a better solution?
_______________________________________________ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss