Dear Colleagues, DeleteSubstructs usually deletes the specified substructure from a molecule, AND then caps it with a hydrogen. However, it does not work like this when the deleted part is next to a charged atom.
*> f = Chem.MolFromSmarts('F')* *> m = Chem.MolFromSmiles("FN(C)C")* *> print(Chem.MolToSmiles(AllChem.DeleteSubstructs(m,f)))* *CNC* *> f = Chem.MolFromSmarts('F')* *> m = Chem.MolFromSmiles("F[NH+](C)C")* *> print(Chem.MolToSmiles(AllChem.DeleteSubstructs(m,f)))* *C[NH+]C* In the latter case, the result is a radical. I cannot "normalize" it even with SanitizeMol(). I do understand that when there is a square bracket, RDKit would try to minimize any change. I just wonder if there is any hack to get around this? I do have a successful workaround by using ReplaceSubstructs instead of DeleteSubstructs. However, ReplaceSubstructs has its own problems, including my post a few minutes ago. Thanks again! Ling
_______________________________________________ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss