On Feb 7, 2017, at 19:02, Curt Fischer <curt.r.fisc...@gmail.com> wrote: > My ultimate goal is an easy way to create rdkit molecules that have isotopic > substitutions but which are otherwise exactly the same as non-substituted > variants. What's the best approach? Is it to directly call .SetIsotope() > like I do above?
Yes. There are other solutions. For example, you can ask RDKit to generate the SMILES with all explicit hydrogens. >>> Chem.MolToSmiles(mol, allHsExplicit=True) '[CH3][CH2][OH]' It's then trivial to manipulate the SMILES syntax at the string level to set an isotope. > This requires figuring out the rdkit atom index of my target atom, which is > doable but perhaps (?) overly complicated? It comes down to how you want to specify the target atom. If it's the position of the atom in the SMILES string, then it's (almost) trivial - the atom index is the index of the term in the SMILES string, minus any '[H]' terms. If you specify the target atom with a SMARTS then use RDKit's SMARTS matching to get the atom indices. > Converting to InChI and back seems to avoid the problem, I guess because > MolToInchi() has a removeHs parameter that defaults to True. That also seems > a bit hack-ish but I'm not sure what the best approach is. I don't understand how that avoids any problem. How do you specify the target atom for that case? In any case, won't the InChI normalization affect some of your structures (e.g., detaching metals) and make it even harder to specify isotopes? Andrew da...@dalkescientific.com ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot _______________________________________________ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss