Hi Sarah On Wed, May 30, 2012 at 12:45 PM, Sarah Langdon <sarah.lang...@icr.ac.uk> wrote: > > I am trying to remove hydrogens from a molecule using RemoveHs, but the > function isn't behaving as I expect. > > I am using it as part of some code that removes ring systems from a molecule > and replaces them with a dummy atom, here are the SMILES for an example > molecule and the 3 subsequent molecules as rings are removed > > 1 - O=C1NC(=O)N(C2CC3CCC2(CS(=O)(=O)N2CCC4(C5=CC=CC=C5CC4)CC2)C3(C)C)C1=O > 2 - c1ccc2c(c1)CCC21CCN(SCC23C([*])([*])C(CC2)CC3N2C(=[*])NC(=[*])C2=[*])CC1 > 3 - [*]=C1NC(=[*])N(C2CC3CCC2([*])C3([*])[*])C1=[*] > 4 - [*]C1([*])C2C[CH]C1([*])CC2 > > On each of these I have used RemoveHs, but for some reason, in molecule 4, > one of the carbons of the norbornane system is defined explicitly as CH. Does > anyone have any idea why this is, or know how I can remove the hydrogen? > Perhaps the hydrogen is added when I use MolToSmiles?
RemoveHs() removes explicit hydrogens from the molecule graph (i.e. Hs that are actually present as atoms). Here's an example: In [2]: m = Chem.MolFromSmiles('[H]OC([H])(Cl)F',sanitize=False) In [3]: Chem.MolToSmiles(m) Out[3]: '[H]OC(F)(Cl)[H]' In [4]: nohm=Chem.RemoveHs(m) In [5]: Chem.MolToSmiles(nohm) Out[5]: 'OC(F)Cl' H's that are written inside of square brackets with another atom, like in your norbornane example, are usually there because the C is a stereocenter. Since this one is *not* a stereocenter, something odd is going on. Can you send the code that was used to generate these molecular fragments so that I can try and figure out what's going on? -greg ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss