Re: [Rdkit-discuss] transformation of an atom or group of atoms by atom indices

2017-11-09 Thread James T. Metz via Rdkit-discuss
Jason, Exactly what I need to do. Thank you for your example code. Much appreciated. Regards, Jim Metz -Original Message- From: Jason Biggs To: James T. Metz Cc: RDKit Discuss Sent:

Re: [Rdkit-discuss] transformation of an atom or group of atoms by atom indices

2017-11-09 Thread Jason Biggs
Something along these lines? mol = Chem.MolFromSmiles('')emol = Chem.EditableMol(mol)emol.ReplaceAtom(3, Chem.Atom(1))mol = emol.GetMol() In [12]: Chem.MolToSmiles(mol) Out[12]: '[H]CCC' In [13]: Chem.MolToSmiles(Chem.RemoveHs(mol)) Out[13]: 'CCC' Jason Biggs On Thu, Nov 9, 2017

[Rdkit-discuss] transformation of an atom or group of atoms by atom indices

2017-11-09 Thread James T. Metz via Rdkit-discuss
RDKit Discussion Group, Suppose I have a molecule smiles1 = '' The carbon atoms will be assigned indices 0, 1, 2, and 3. Suppose I want to specifically change carbon 3 to a hydrogen. Is this possible using RDkit? I am aware of using SMARTS to match a pattern and