Hi everyone, I tried to virtually deprotect molecules using the AllChem.ReplaceSubstructs() function. Stereochemistry of adjacent atoms gets inverted in ChiralTag but not in _CIPCode. This gives me the wrong output SMILES:
from rdkit import Chem from rdkit.Chem import AllChem from rdkit.Chem.Draw import IPythonConsole mol=Chem.MolFromSmiles('CC[C@@H](NC(=O)OCC1c2ccccc2-c2ccccc12)C1=CC=CC=C1') mol [image: image.png] for atom in rms[0].GetAtoms(): if atom.HasProp('_CIPCode'): print(atom.GetProp('_CIPCode')) print(atom.GetChiralTag()) R CHI_TETRAHEDRAL_CCW fmoc = Chem.MolFromSmarts('NC(=O)OCC1c2ccccc2-c2ccccc12') fmoc_repl = Chem.MolFromSmiles('N') rms = AllChem.ReplaceSubstructs(mol,fmoc,fmoc_repl,replaceAll=True) rms[0] [image: image.png] Chem.MolToSmiles(rms[0]) 'CC[C@H](N)c1ccccc1' for atom in rms[0].GetAtoms(): if atom.HasProp('_CIPCode'): print(atom.GetProp('_CIPCode')) print(atom.GetChiralTag()) R CHI_TETRAHEDRAL_CW How come the ChiralTag changes upon the replacement? Sorry if this is documented somewhere but I didn't quite find it. It works in this case to do atom.SetChiralTag() to change the stereochemistry in the smiles. Thanks a lot, Fio
_______________________________________________ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss