Re: [Rdkit-discuss] Clearing isotope info
Open-Source Cheminformatics and Machine Learning
Brought to you by:
glandrum
|
From: Greg L. <gre...@gm...> - 2019-12-11 13:52:07
|
On Wed, Dec 11, 2019 at 11:55 AM Tim Dudgeon <tdu...@gm...> wrote: > I'm wanting to write isomeric smiles that does not include isotope > information. > The standard Chem.MolToSmiles(m, isomericSmiles=True) includes isotope > information which is what I'm wanting to exclude. > > I note that there is a Atom.SetIsotope(int) method and after a bit of > hacking around I found that doing a Atom.SetIsotope(0) seems to do the > trick, but does look a bit strange. Is this really a surrogate for the > non-existent Atom.ClearIsotope() method? > Yep. Since an isotope of 0 is totally non-physical, that's how we indicate that no isotope has been set. So looping over all the atoms and calling SetIsotope(0) is exactly the right thing. -greg |